comparison auth.h @ 475:52a644e7b8e1 pubkey-options

* Patch from Frédéric Moulins adding options to authorized_keys. Needs review.
author Matt Johnston <matt@ucc.asn.au>
date Mon, 08 Sep 2008 15:14:02 +0000
parents 4317be8b7cf9
children df7f7da7f6e4
comparison
equal deleted inserted replaced
474:f33b0898aaa6 475:52a644e7b8e1
24 24
25 #ifndef _AUTH_H_ 25 #ifndef _AUTH_H_
26 #define _AUTH_H_ 26 #define _AUTH_H_
27 27
28 #include "includes.h" 28 #include "includes.h"
29 #include "chansession.h"
29 30
30 void svr_authinitialise(); 31 void svr_authinitialise();
31 void cli_authinitialise(); 32 void cli_authinitialise();
32 33
33 /* Server functions */ 34 /* Server functions */
35 void send_msg_userauth_failure(int partial, int incrfail); 36 void send_msg_userauth_failure(int partial, int incrfail);
36 void send_msg_userauth_success(); 37 void send_msg_userauth_success();
37 void svr_auth_password(); 38 void svr_auth_password();
38 void svr_auth_pubkey(); 39 void svr_auth_pubkey();
39 void svr_auth_pam(); 40 void svr_auth_pam();
41
42 #ifdef ENABLE_SVR_PUBKEY_OPTIONS
43 int svr_pubkey_allows_agentfwd();
44 int svr_pubkey_allows_tcpfwd();
45 int svr_pubkey_allows_x11fwd();
46 int svr_pubkey_allows_pty();
47 void svr_pubkey_set_forced_command(struct ChanSess *chansess);
48 void svr_pubkey_options_cleanup();
49 int svr_add_pubkey_options(const char* opts);
50 #else
51 /* no option : success */
52 #define svr_pubkey_allows_agentfwd() 1
53 #define svr_pubkey_allows_tcpfwd() 1
54 #define svr_pubkey_allows_x11fwd() 1
55 #define svr_pubkey_allows_pty() 1
56 static inline void svr_pubkey_set_forced_command(struct ChanSess *chansess) { }
57 static inline void svr_pubkey_options_cleanup() { }
58 #define svr_add_pubkey_options(x) DROPBEAR_SUCCESS
59 #endif
40 60
41 /* Client functions */ 61 /* Client functions */
42 void recv_msg_userauth_failure(); 62 void recv_msg_userauth_failure();
43 void recv_msg_userauth_success(); 63 void recv_msg_userauth_success();
44 void recv_msg_userauth_specific_60(); 64 void recv_msg_userauth_specific_60();
95 gid_t pw_gid; 115 gid_t pw_gid;
96 char *pw_dir; 116 char *pw_dir;
97 char *pw_shell; 117 char *pw_shell;
98 char *pw_name; 118 char *pw_name;
99 char *pw_passwd; 119 char *pw_passwd;
120 #ifdef ENABLE_SVR_PUBKEY_OPTIONS
121 struct PubKeyOptions* pubkey_options;
122 #endif
123
100 }; 124 };
101 125
102 struct SignKeyList; 126 struct SignKeyList;
103 /* A singly linked list of signing keys */ 127 /* A singly linked list of signing keys */
104 struct SignKeyList { 128 struct SignKeyList {
109 /* filename? or the buffer? for encrypted keys, so we can later get 133 /* filename? or the buffer? for encrypted keys, so we can later get
110 * the private key portion */ 134 * the private key portion */
111 135
112 }; 136 };
113 137
138 #ifdef ENABLE_SVR_PUBKEY_OPTIONS
139 struct PubKeyOptions;
140 struct PubKeyOptions {
141 /* Flags */
142 int no_port_forwarding_flag;
143 int no_agent_forwarding_flag;
144 int no_x11_forwarding_flag;
145 int no_pty_flag;
146 /* "command=" option. */
147 unsigned char * forced_command;
148
149 };
150 #endif
151
114 #endif /* _AUTH_H_ */ 152 #endif /* _AUTH_H_ */