comparison cli-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 9ee8996a375f
children e3adf4cf5465
comparison
equal deleted inserted replaced
67:86725004a0ea 68:eee77ac31ccc
90 /* Perhaps we should be more fatal? */ 90 /* Perhaps we should be more fatal? */
91 TRACE(("But we didn't send a userauth request!!!!!!")); 91 TRACE(("But we didn't send a userauth request!!!!!!"));
92 return; 92 return;
93 } 93 }
94 94
95 #ifdef DROPBEAR_PUBKEY_AUTH 95 #ifdef ENABLE_CLI_PUBKEY_AUTH
96 /* If it was a pubkey auth request, we should cross that key 96 /* If it was a pubkey auth request, we should cross that key
97 * off the list. */ 97 * off the list. */
98 if (cli_ses.lastauthtype == AUTH_TYPE_PUBKEY) { 98 if (cli_ses.lastauthtype == AUTH_TYPE_PUBKEY) {
99 cli_pubkeyfail(); 99 cli_pubkeyfail();
100 } 100 }
124 124
125 tok = methods; /* tok stores the next method we'll compare */ 125 tok = methods; /* tok stores the next method we'll compare */
126 for (i = 0; i <= methlen; i++) { 126 for (i = 0; i <= methlen; i++) {
127 if (methods[i] == '\0') { 127 if (methods[i] == '\0') {
128 TRACE(("auth method '%s'", tok)); 128 TRACE(("auth method '%s'", tok));
129 #ifdef DROPBEAR_PUBKEY_AUTH 129 #ifdef ENABLE_CLI_PUBKEY_AUTH
130 if (strncmp(AUTH_METHOD_PUBKEY, tok, 130 if (strncmp(AUTH_METHOD_PUBKEY, tok,
131 AUTH_METHOD_PUBKEY_LEN) == 0) { 131 AUTH_METHOD_PUBKEY_LEN) == 0) {
132 ses.authstate.authtypes |= AUTH_TYPE_PUBKEY; 132 ses.authstate.authtypes |= AUTH_TYPE_PUBKEY;
133 } 133 }
134 #endif 134 #endif
135 #ifdef DROPBEAR_PASSWORD_AUTH 135 #ifdef ENABLE_CLI_PASSWORD_AUTH
136 if (strncmp(AUTH_METHOD_PASSWORD, tok, 136 if (strncmp(AUTH_METHOD_PASSWORD, tok,
137 AUTH_METHOD_PASSWORD_LEN) == 0) { 137 AUTH_METHOD_PASSWORD_LEN) == 0) {
138 ses.authstate.authtypes |= AUTH_TYPE_PASSWORD; 138 ses.authstate.authtypes |= AUTH_TYPE_PASSWORD;
139 } 139 }
140 #endif 140 #endif
161 int finished = 0; 161 int finished = 0;
162 162
163 CHECKCLEARTOWRITE(); 163 CHECKCLEARTOWRITE();
164 164
165 /* XXX We hardcode that we try a pubkey first */ 165 /* XXX We hardcode that we try a pubkey first */
166 #ifdef DROPBEAR_PUBKEY_AUTH 166 #ifdef ENABLE_CLI_PUBKEY_AUTH
167 if (ses.authstate.authtypes & AUTH_TYPE_PUBKEY) { 167 if (ses.authstate.authtypes & AUTH_TYPE_PUBKEY) {
168 finished = cli_auth_pubkey(); 168 finished = cli_auth_pubkey();
169 cli_ses.lastauthtype = AUTH_TYPE_PUBKEY; 169 cli_ses.lastauthtype = AUTH_TYPE_PUBKEY;
170 } 170 }
171 #endif 171 #endif
172 172
173 #ifdef DROPBEAR_PASSWORD_AUTH 173 #ifdef ENABLE_CLI_PASSWORD_AUTH
174 if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) { 174 if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) {
175 finished = cli_auth_password(); 175 finished = cli_auth_password();
176 cli_ses.lastauthtype = AUTH_TYPE_PASSWORD; 176 cli_ses.lastauthtype = AUTH_TYPE_PASSWORD;
177 } 177 }
178 #endif 178 #endif