aboutsummaryrefslogtreecommitdiff
path: root/include/libssh
diff options
context:
space:
mode:
authormilo <milo.sshiva@gmail.com>2009-07-27 17:59:02 +0200
committerAndreas Schneider <mail@cynapses.org>2009-07-27 20:27:07 +0200
commite8f7801540e8be8b029b09269196773767a5983e (patch)
tree8cc08e3cbcc4e919f132fae4a5cde91bea8e7e94 /include/libssh
parentcdde79418a86da1c9579a022ec8c4ed73fe29f1a (diff)
downloadlibssh-e8f7801540e8be8b029b09269196773767a5983e.tar.gz
libssh-e8f7801540e8be8b029b09269196773767a5983e.tar.xz
libssh-e8f7801540e8be8b029b09269196773767a5983e.zip
Public key authentication server side
Diffstat (limited to 'include/libssh')
-rw-r--r--include/libssh/priv.h5
-rw-r--r--include/libssh/server.h2
-rw-r--r--include/libssh/ssh2.h1
3 files changed, 8 insertions, 0 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 925d55d2..5d609264 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -422,6 +422,8 @@ struct ssh_auth_request {
char *username;
int method;
char *password;
+ struct ssh_public_key_struct *public_key;
+ char signature_state;
};
struct ssh_channel_request_open {
@@ -608,6 +610,8 @@ int make_sessionid(SSH_SESSION *session);
int hashbufin_add_cookie(SSH_SESSION *session, unsigned char *cookie);
int hashbufout_add_cookie(SSH_SESSION *session);
int generate_session_keys(SSH_SESSION *session);
+int sig_verify(SSH_SESSION *session, ssh_public_key pubkey,
+ SIGNATURE *signature, unsigned char *digest, int size);
/* returns 1 if server signature ok, 0 otherwise. The NEXT crypto is checked, not the current one */
int signature_verify(SSH_SESSION *session,ssh_string signature);
bignum make_string_bn(ssh_string string);
@@ -659,6 +663,7 @@ ssh_string try_publickey_from_file(SSH_SESSION *session,
/* in keys.c */
const char *ssh_type_to_char(int type);
int ssh_type_from_name(const char *name);
+ssh_buffer ssh_userauth_build_digest(SSH_SESSION *session, struct ssh_message *msg, char *service);
ssh_private_key privatekey_make_dss(SSH_SESSION *session, ssh_buffer buffer);
ssh_private_key privatekey_make_rsa(SSH_SESSION *session, ssh_buffer buffer,
diff --git a/include/libssh/server.h b/include/libssh/server.h
index d615d2e6..e441226b 100644
--- a/include/libssh/server.h
+++ b/include/libssh/server.h
@@ -159,7 +159,9 @@ void ssh_message_free(SSH_MESSAGE *msg);
char *ssh_message_auth_user(SSH_MESSAGE *msg);
char *ssh_message_auth_password(SSH_MESSAGE *msg);
+ssh_public_key ssh_message_auth_publickey(SSH_MESSAGE *msg);
int ssh_message_auth_reply_success(SSH_MESSAGE *msg,int partial);
+int ssh_message_auth_reply_pk_ok(SSH_MESSAGE *msg, ssh_string algo, ssh_string pubkey);
int ssh_message_auth_set_methods(SSH_MESSAGE *msg, int methods);
ssh_channel ssh_message_channel_request_open_reply_accept(SSH_MESSAGE *msg);
diff --git a/include/libssh/ssh2.h b/include/libssh/ssh2.h
index bd89f4e1..f5a1fe52 100644
--- a/include/libssh/ssh2.h
+++ b/include/libssh/ssh2.h
@@ -26,6 +26,7 @@
#define SSH2_MSG_USERAUTH_PK_OK 60
#define SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ 60
#define SSH2_MSG_USERAUTH_INFO_REQUEST 60
+#define SSH2_MSG_USERAUTH_PK_OK 60
#define SSH2_MSG_USERAUTH_INFO_RESPONSE 61
#define SSH2_MSG_GLOBAL_REQUEST 80
#define SSH2_MSG_REQUEST_SUCCESS 81