00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AUTH_H_
00022 #define AUTH_H_
00023 #include "config.h"
00024 #include "libssh/callbacks.h"
00025
00026 SSH_PACKET_CALLBACK(ssh_packet_userauth_banner);
00027 SSH_PACKET_CALLBACK(ssh_packet_userauth_failure);
00028 SSH_PACKET_CALLBACK(ssh_packet_userauth_success);
00029 SSH_PACKET_CALLBACK(ssh_packet_userauth_pk_ok);
00030 SSH_PACKET_CALLBACK(ssh_packet_userauth_info_request);
00031 SSH_PACKET_CALLBACK(ssh_packet_userauth_info_response);
00032
00037 struct ssh_kbdint_struct {
00038 uint32_t nprompts;
00039 uint32_t nanswers;
00040 char *name;
00041 char *instruction;
00042 char **prompts;
00043 unsigned char *echo;
00044 char **answers;
00045 };
00046 typedef struct ssh_kbdint_struct* ssh_kbdint;
00047
00048 ssh_kbdint ssh_kbdint_new(void);
00049 void ssh_kbdint_clean(ssh_kbdint kbd);
00050 void ssh_kbdint_free(ssh_kbdint kbd);
00051
00052
00053 #ifdef WITH_SSH1
00054 void ssh_auth1_handler(ssh_session session, uint8_t type);
00055
00056
00057 int ssh_userauth1_none(ssh_session session, const char *username);
00058 int ssh_userauth1_offer_pubkey(ssh_session session, const char *username,
00059 int type, ssh_string pubkey);
00060 int ssh_userauth1_password(ssh_session session, const char *username,
00061 const char *password);
00062
00063
00064 #endif
00065
00070 enum ssh_auth_state_e {
00072 SSH_AUTH_STATE_NONE=0,
00074 SSH_AUTH_STATE_PARTIAL,
00076 SSH_AUTH_STATE_SUCCESS,
00078 SSH_AUTH_STATE_FAILED,
00080 SSH_AUTH_STATE_ERROR,
00082 SSH_AUTH_STATE_INFO,
00084 SSH_AUTH_STATE_PK_OK,
00086 SSH_AUTH_STATE_KBDINT_SENT,
00088 SSH_AUTH_STATE_GSSAPI_REQUEST_SENT,
00090 SSH_AUTH_STATE_GSSAPI_TOKEN,
00092 SSH_AUTH_STATE_GSSAPI_MIC_SENT,
00093 };
00094
00098 enum ssh_auth_service_state_e {
00100 SSH_AUTH_SERVICE_NONE=0,
00102 SSH_AUTH_SERVICE_SENT,
00104 SSH_AUTH_SERVICE_ACCEPTED,
00106 SSH_AUTH_SERVICE_DENIED,
00108 SSH_AUTH_SERVICE_USER_SENT
00109 };
00110
00111 #endif