comparison cli-auth.c @ 685:5af8993f7529 insecure-nocrypto

Add ALLOW_NONE_PASSWORD_AUTH option
author Matt Johnston <matt@ucc.asn.au>
date Thu, 17 May 2012 08:33:11 +0800
parents a4b7627b3157
children 983a817f8e41
comparison
equal deleted inserted replaced
684:c37857676924 685:5af8993f7529
255 cli_ses.lastauthtype = AUTH_TYPE_PUBKEY; 255 cli_ses.lastauthtype = AUTH_TYPE_PUBKEY;
256 } 256 }
257 #endif 257 #endif
258 258
259 #ifdef ENABLE_CLI_INTERACT_AUTH 259 #ifdef ENABLE_CLI_INTERACT_AUTH
260 #if defined(DROPBEAR_NONE_CIPHER) && !defined(ALLOW_NONE_PASSWORD_AUTH)
260 if (ses.keys->trans.algo_crypt->cipherdesc == NULL) { 261 if (ses.keys->trans.algo_crypt->cipherdesc == NULL) {
261 fprintf(stderr, "Sorry, I won't let you use interactive auth unencrypted.\n"); 262 fprintf(stderr, "Sorry, I won't let you use interactive auth unencrypted.\n");
262 } 263 }
263 else if (!finished && ses.authstate.authtypes & AUTH_TYPE_INTERACT) { 264 else
265 #endif
266 if (!finished && ses.authstate.authtypes & AUTH_TYPE_INTERACT) {
264 if (cli_ses.auth_interact_failed) { 267 if (cli_ses.auth_interact_failed) {
265 finished = 0; 268 finished = 0;
266 } else { 269 } else {
267 cli_auth_interactive(); 270 cli_auth_interactive();
268 cli_ses.lastauthtype = AUTH_TYPE_INTERACT; 271 cli_ses.lastauthtype = AUTH_TYPE_INTERACT;
270 } 273 }
271 } 274 }
272 #endif 275 #endif
273 276
274 #ifdef ENABLE_CLI_PASSWORD_AUTH 277 #ifdef ENABLE_CLI_PASSWORD_AUTH
278 #if defined(DROPBEAR_NONE_CIPHER) && !defined(ALLOW_NONE_PASSWORD_AUTH)
275 if (ses.keys->trans.algo_crypt->cipherdesc == NULL) { 279 if (ses.keys->trans.algo_crypt->cipherdesc == NULL) {
276 fprintf(stderr, "Sorry, I won't let you use password auth unencrypted.\n"); 280 fprintf(stderr, "Sorry, I won't let you use password auth unencrypted.\n");
277 } 281 }
278 else if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) { 282 else
283 #endif
284 if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) {
279 cli_auth_password(); 285 cli_auth_password();
280 finished = 1; 286 finished = 1;
281 cli_ses.lastauthtype = AUTH_TYPE_PASSWORD; 287 cli_ses.lastauthtype = AUTH_TYPE_PASSWORD;
282 } 288 }
283 #endif 289 #endif