comparison svr-auth.c @ 68:eee77ac31ccc

cleaning up the pubkey defines
author Matt Johnston <matt@ucc.asn.au>
date Thu, 12 Aug 2004 14:56:22 +0000
parents 0ad5fb979f42
children b0316ce64e4b
comparison
equal deleted inserted replaced
67:86725004a0ea 68:eee77ac31ccc
30 #include "session.h" 30 #include "session.h"
31 #include "buffer.h" 31 #include "buffer.h"
32 #include "ssh.h" 32 #include "ssh.h"
33 #include "packet.h" 33 #include "packet.h"
34 #include "auth.h" 34 #include "auth.h"
35 #include "authpasswd.h"
36 #include "authpubkey.h"
37 #include "runopts.h" 35 #include "runopts.h"
38 36
39 static void authclear(); 37 static void authclear();
40 static int checkusername(unsigned char *username, unsigned int userlen); 38 static int checkusername(unsigned char *username, unsigned int userlen);
41 static void send_msg_userauth_banner(); 39 static void send_msg_userauth_banner();
52 * user decides to try with a different username etc, and is also invoked 50 * user decides to try with a different username etc, and is also invoked
53 * on initialisation */ 51 * on initialisation */
54 static void authclear() { 52 static void authclear() {
55 53
56 memset(&ses.authstate, 0, sizeof(ses.authstate)); 54 memset(&ses.authstate, 0, sizeof(ses.authstate));
57 #ifdef DROPBEAR_PUBKEY_AUTH 55 #ifdef ENABLE_SVR_PUBKEY_AUTH
58 ses.authstate.authtypes |= AUTH_TYPE_PUBKEY; 56 ses.authstate.authtypes |= AUTH_TYPE_PUBKEY;
59 #endif 57 #endif
60 #ifdef DROPBEAR_PASSWORD_AUTH 58 #ifdef ENABLE_SVR_PASSWORD_AUTH
61 if (!svr_opts.noauthpass) { 59 if (!svr_opts.noauthpass) {
62 ses.authstate.authtypes |= AUTH_TYPE_PASSWORD; 60 ses.authstate.authtypes |= AUTH_TYPE_PASSWORD;
63 } 61 }
64 #endif 62 #endif
65 63
141 TRACE(("sending checkusername failure")); 139 TRACE(("sending checkusername failure"));
142 send_msg_userauth_failure(0, 1); 140 send_msg_userauth_failure(0, 1);
143 goto out; 141 goto out;
144 } 142 }
145 143
146 #ifdef DROPBEAR_PASSWORD_AUTH 144 #ifdef ENABLE_SVR_PASSWORD_AUTH
147 if (!svr_opts.noauthpass && 145 if (!svr_opts.noauthpass &&
148 !(svr_opts.norootpass && ses.authstate.pw->pw_uid == 0) ) { 146 !(svr_opts.norootpass && ses.authstate.pw->pw_uid == 0) ) {
149 /* user wants to try password auth */ 147 /* user wants to try password auth */
150 if (methodlen == AUTH_METHOD_PASSWORD_LEN && 148 if (methodlen == AUTH_METHOD_PASSWORD_LEN &&
151 strncmp(methodname, AUTH_METHOD_PASSWORD, 149 strncmp(methodname, AUTH_METHOD_PASSWORD,
154 goto out; 152 goto out;
155 } 153 }
156 } 154 }
157 #endif 155 #endif
158 156
159 #ifdef DROPBEAR_PUBKEY_AUTH 157 #ifdef ENABLE_SVR_PUBKEY_AUTH
160 /* user wants to try pubkey auth */ 158 /* user wants to try pubkey auth */
161 if (methodlen == AUTH_METHOD_PUBKEY_LEN && 159 if (methodlen == AUTH_METHOD_PUBKEY_LEN &&
162 strncmp(methodname, AUTH_METHOD_PUBKEY, 160 strncmp(methodname, AUTH_METHOD_PUBKEY,
163 AUTH_METHOD_PUBKEY_LEN) == 0) { 161 AUTH_METHOD_PUBKEY_LEN) == 0) {
164 svr_auth_pubkey(); 162 svr_auth_pubkey();