41
41
/* Client functions */
42
42
void recv_msg_userauth_failure();
43
43
void recv_msg_userauth_success();
44
void recv_msg_userauth_specific_60();
44
45
void recv_msg_userauth_pk_ok();
46
void recv_msg_userauth_info_request();
45
47
void cli_get_user();
46
48
void cli_auth_getmethods();
47
49
void cli_auth_try();
48
50
void recv_msg_userauth_banner();
49
51
void cli_pubkeyfail();
50
int cli_auth_password();
52
void cli_auth_password();
51
53
int cli_auth_pubkey();
54
void cli_auth_interactive();
54
57
#define MAX_USERNAME_LEN 25 /* arbitrary for the moment */
56
#define AUTH_TYPE_PUBKEY 1 << 0
57
#define AUTH_TYPE_PASSWORD 1 << 1
59
#define AUTH_TYPE_NONE 1
60
#define AUTH_TYPE_PUBKEY 1 << 1
61
#define AUTH_TYPE_PASSWORD 1 << 2
62
#define AUTH_TYPE_INTERACT 1 << 3
59
/* auth types, "none" means we should return list of acceptable types */
60
#define AUTH_METHOD_NONE "none"
64
#define AUTH_METHOD_NONE "none"
61
65
#define AUTH_METHOD_NONE_LEN 4
62
66
#define AUTH_METHOD_PUBKEY "publickey"
63
67
#define AUTH_METHOD_PUBKEY_LEN 9
64
68
#define AUTH_METHOD_PASSWORD "password"
65
69
#define AUTH_METHOD_PASSWORD_LEN 8
70
#define AUTH_METHOD_INTERACT "keyboard-interactive"
71
#define AUTH_METHOD_INTERACT_LEN 20
67
75
/* This structure is shared between server and client - it contains
68
76
* relatively little extraneous bits when used for the client rather than the
77
85
unsigned authdone : 1; /* 0 if we haven't authed, 1 if we have. Applies for
78
86
client and server (though has differing [obvious]
88
unsigned perm_warn : 1; /* Server only, set if bad permissions on
89
~/.ssh/authorized_keys have already been
81
92
/* These are only used for the server */
82
93
char *printableuser; /* stripped of control chars, used for logs etc */
88
/* A singly linked list of pubkeys */
99
/* A singly linked list of signing keys */
92
103
int type; /* The type of key */
93
struct PubkeyList *next;
104
struct SignKeyList *next;
94
105
/* filename? or the buffer? for encrypted keys, so we can later get
95
106
* the private key portion */