comparison cli-auth.c @ 732:2e5f2bc60e40

Try password before interactive - bit of a hack
author Matt Johnston <matt@ucc.asn.au>
date Mon, 01 Apr 2013 22:26:24 +0800
parents 714b9106e335
children 619b1ed837fd
comparison
equal deleted inserted replaced
731:9a5438271556 732:2e5f2bc60e40
255 finished = cli_auth_pubkey(); 255 finished = cli_auth_pubkey();
256 cli_ses.lastauthtype = AUTH_TYPE_PUBKEY; 256 cli_ses.lastauthtype = AUTH_TYPE_PUBKEY;
257 } 257 }
258 #endif 258 #endif
259 259
260 #ifdef ENABLE_CLI_PASSWORD_AUTH
261 if (ses.keys->trans.algo_crypt->cipherdesc == NULL) {
262 fprintf(stderr, "Sorry, I won't let you use password auth unencrypted.\n");
263 } else if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) {
264 cli_auth_password();
265 finished = 1;
266 cli_ses.lastauthtype = AUTH_TYPE_PASSWORD;
267 }
268 #endif
269
260 #ifdef ENABLE_CLI_INTERACT_AUTH 270 #ifdef ENABLE_CLI_INTERACT_AUTH
261 if (ses.keys->trans.algo_crypt->cipherdesc == NULL) { 271 if (ses.keys->trans.algo_crypt->cipherdesc == NULL) {
262 fprintf(stderr, "Sorry, I won't let you use interactive auth unencrypted.\n"); 272 fprintf(stderr, "Sorry, I won't let you use interactive auth unencrypted.\n");
263 } else if (!finished && ses.authstate.authtypes & AUTH_TYPE_INTERACT) { 273 } else if (!finished && ses.authstate.authtypes & AUTH_TYPE_INTERACT) {
264 if (cli_ses.auth_interact_failed) { 274 if (cli_ses.auth_interact_failed) {
266 } else { 276 } else {
267 cli_auth_interactive(); 277 cli_auth_interactive();
268 cli_ses.lastauthtype = AUTH_TYPE_INTERACT; 278 cli_ses.lastauthtype = AUTH_TYPE_INTERACT;
269 finished = 1; 279 finished = 1;
270 } 280 }
271 }
272 #endif
273
274 #ifdef ENABLE_CLI_PASSWORD_AUTH
275 if (ses.keys->trans.algo_crypt->cipherdesc == NULL) {
276 fprintf(stderr, "Sorry, I won't let you use password auth unencrypted.\n");
277 } else if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) {
278 cli_auth_password();
279 finished = 1;
280 cli_ses.lastauthtype = AUTH_TYPE_PASSWORD;
281 } 281 }
282 #endif 282 #endif
283 283
284 TRACE(("cli_auth_try lastauthtype %d", cli_ses.lastauthtype)) 284 TRACE(("cli_auth_try lastauthtype %d", cli_ses.lastauthtype))
285 285