comparison auth.h @ 45:9ee8996a375f

Pubkey auth is mostly there for the client. Something strange with remote hostkey verification though.
author Matt Johnston <matt@ucc.asn.au>
date Tue, 03 Aug 2004 17:26:56 +0000
parents 942b22d7dd1c
children 4b53a43f0082
comparison
equal deleted inserted replaced
44:45edf30ea0a6 45:9ee8996a375f
28 #include "includes.h" 28 #include "includes.h"
29 29
30 void svr_authinitialise(); 30 void svr_authinitialise();
31 void cli_authinitialise(); 31 void cli_authinitialise();
32 32
33 void svr_auth_password();
34 void svr_auth_pubkey();
35
36 int cli_auth_password();
37 int cli_auth_pubkey();
38
39 /* Server functions */ 33 /* Server functions */
40 void recv_msg_userauth_request(); 34 void recv_msg_userauth_request();
41 void send_msg_userauth_failure(int partial, int incrfail); 35 void send_msg_userauth_failure(int partial, int incrfail);
42 void send_msg_userauth_success(); 36 void send_msg_userauth_success();
37 void svr_auth_password();
38 void svr_auth_pubkey();
43 39
44 /* Client functions */ 40 /* Client functions */
45 void recv_msg_userauth_failure(); 41 void recv_msg_userauth_failure();
46 void recv_msg_userauth_success(); 42 void recv_msg_userauth_success();
43 void recv_msg_userauth_pk_ok();
47 void cli_get_user(); 44 void cli_get_user();
48 void cli_auth_getmethods(); 45 void cli_auth_getmethods();
49 void cli_auth_try(); 46 void cli_auth_try();
50 void recv_msg_userauth_banner(); 47 void recv_msg_userauth_banner();
48 void cli_pubkeyfail();
49 int cli_auth_password();
50 int cli_auth_pubkey();
51 51
52 52
53 #define MAX_USERNAME_LEN 25 /* arbitrary for the moment */ 53 #define MAX_USERNAME_LEN 25 /* arbitrary for the moment */
54 54
55 #define AUTH_TYPE_PUBKEY 1 << 0 55 #define AUTH_TYPE_PUBKEY 1 << 0
60 #define AUTH_METHOD_NONE_LEN 4 60 #define AUTH_METHOD_NONE_LEN 4
61 #define AUTH_METHOD_PUBKEY "publickey" 61 #define AUTH_METHOD_PUBKEY "publickey"
62 #define AUTH_METHOD_PUBKEY_LEN 9 62 #define AUTH_METHOD_PUBKEY_LEN 9
63 #define AUTH_METHOD_PASSWORD "password" 63 #define AUTH_METHOD_PASSWORD "password"
64 #define AUTH_METHOD_PASSWORD_LEN 8 64 #define AUTH_METHOD_PASSWORD_LEN 8
65
66 /* For a 4096 bit DSS key, empirically determined to be 1590 bytes */
67 #define MAX_PUBKEY_SIZE 1600
65 68
66 /* This structure is shared between server and client - it contains 69 /* This structure is shared between server and client - it contains
67 * relatively little extraneous bits when used for the client rather than the 70 * relatively little extraneous bits when used for the client rather than the
68 * server */ 71 * server */
69 struct AuthState { 72 struct AuthState {
81 char *printableuser; /* stripped of control chars, used for logs etc */ 84 char *printableuser; /* stripped of control chars, used for logs etc */
82 struct passwd * pw; 85 struct passwd * pw;
83 86
84 }; 87 };
85 88
89 struct PubkeyList;
90 /* A singly linked list of pubkeys */
91 struct PubkeyList {
92
93 sign_key *key;
94 int type; /* The type of key */
95 struct PubkeyList *next;
96 /* filename? or the buffer? for encrypted keys, so we can later get
97 * the private key portion */
98
99 };
100
86 #endif /* _AUTH_H_ */ 101 #endif /* _AUTH_H_ */