diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2009-12-26 21:59:37 +0100 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2009-12-26 21:59:37 +0100 |
commit | a229cb46763cb4a1be1a0e3b6d93e6e0d106561d (patch) | |
tree | 15ef2b43daac6c125bc12f9badb0b03681910efc /include | |
parent | 682ed1812364bd42fef6f331486c5d8f5a72ef21 (diff) | |
download | libssh-a229cb46763cb4a1be1a0e3b6d93e6e0d106561d.tar.gz libssh-a229cb46763cb4a1be1a0e3b6d93e6e0d106561d.tar.xz libssh-a229cb46763cb4a1be1a0e3b6d93e6e0d106561d.zip |
Asynchronous authentication works !
Diffstat (limited to 'include')
-rw-r--r-- | include/libssh/auth.h | 40 | ||||
-rw-r--r-- | include/libssh/session.h | 17 |
2 files changed, 43 insertions, 14 deletions
diff --git a/include/libssh/auth.h b/include/libssh/auth.h index 86b31ea4..f78a3f2b 100644 --- a/include/libssh/auth.h +++ b/include/libssh/auth.h @@ -22,7 +22,47 @@ #ifndef AUTH_H_ #define AUTH_H_ #include "libssh/callbacks.h" + SSH_PACKET_CALLBACK(ssh_packet_userauth_banner); +SSH_PACKET_CALLBACK(ssh_packet_userauth_failure); +SSH_PACKET_CALLBACK(ssh_packet_userauth_success); +SSH_PACKET_CALLBACK(ssh_packet_userauth_pk_ok); + + +/** @internal + * States of authentication in the client-side. They describe + * what was the last response from the server + */ +enum ssh_auth_state_e { + /** No authentication asked */ + SSH_AUTH_STATE_NONE=0, + /** Last authentication response was a partial success */ + SSH_AUTH_STATE_PARTIAL, + /** Last authentication response was a success */ + SSH_AUTH_STATE_SUCCESS, + /** Last authentication response was failed */ + SSH_AUTH_STATE_FAILED, + /** Last authentication was erroneous */ + SSH_AUTH_STATE_ERROR, + /** Last state was a keyboard-interactive ask for info */ + SSH_AUTH_STATE_INFO, + /** Last state was a public key accepted for authentication */ + SSH_AUTH_STATE_PK_OK + +}; +/** @internal + * @brief states of the authentication service request + */ +enum ssh_auth_service_state_e { + /** initial state */ + SSH_AUTH_SERVICE_NONE=0, + /** Authentication service request packet sent */ + SSH_AUTH_SERVICE_SENT, + /** Service accepted */ + SSH_AUTH_SERVICE_ACCEPTED, + /** Access to service denied (fatal) */ + SSH_AUTH_SERVICE_DENIED +}; #endif /* AUTH_H_ */ diff --git a/include/libssh/session.h b/include/libssh/session.h index f4ed895c..64b91d90 100644 --- a/include/libssh/session.h +++ b/include/libssh/session.h @@ -24,6 +24,7 @@ #include "libssh/priv.h" #include "libssh/packet.h" #include "libssh/pcap.h" +#include "libssh/auth.h" typedef struct ssh_kbdint_struct* ssh_kbdint; @@ -41,19 +42,6 @@ enum ssh_session_state_e { SSH_SESSION_STATE_ERROR }; -/** @internal - * @brief states of the authentication service request - */ -enum ssh_auth_service_state_e { - /** initial state */ - SSH_AUTH_SERVICE_NONE=0, - /** Authentication service request packet sent */ - SSH_AUTH_SERVICE_SENT, - /** Service accepted */ - SSH_AUTH_SERVICE_ACCEPTED, - /** Access to service denied (fatal) */ - SSH_AUTH_SERVICE_DENIED -}; struct ssh_session_struct { struct error_struct error; @@ -93,8 +81,9 @@ struct ssh_session_struct { int packet_state; int dh_handshake_state; enum ssh_auth_service_state_e auth_service_state; - ssh_string dh_server_signature; //information used by dh_handshake. + enum ssh_auth_state_e auth_state; + ssh_string dh_server_signature; //information used by dh_handshake. KEX server_kex; KEX client_kex; ssh_buffer in_hashbuf; |