From 5af0d33164261fb9603d1b44f715d63659799373 Mon Sep 17 00:00:00 2001 From: Matt Johnston <matt@ucc.asn.au> Date: Mon, 1 Apr 2013 22:26:24 +0800 Subject: [PATCH] Try password before interactive - bit of a hack --- cli-auth.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cli-auth.c b/cli-auth.c index 7dc101fb..42c925bf 100644 --- a/cli-auth.c +++ b/cli-auth.c @@ -257,6 +257,16 @@ void cli_auth_try() { } #endif +#ifdef ENABLE_CLI_PASSWORD_AUTH + if (ses.keys->trans.algo_crypt->cipherdesc == NULL) { + fprintf(stderr, "Sorry, I won't let you use password auth unencrypted.\n"); + } else if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) { + cli_auth_password(); + finished = 1; + cli_ses.lastauthtype = AUTH_TYPE_PASSWORD; + } +#endif + #ifdef ENABLE_CLI_INTERACT_AUTH if (ses.keys->trans.algo_crypt->cipherdesc == NULL) { fprintf(stderr, "Sorry, I won't let you use interactive auth unencrypted.\n"); @@ -271,16 +281,6 @@ void cli_auth_try() { } #endif -#ifdef ENABLE_CLI_PASSWORD_AUTH - if (ses.keys->trans.algo_crypt->cipherdesc == NULL) { - fprintf(stderr, "Sorry, I won't let you use password auth unencrypted.\n"); - } else if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) { - cli_auth_password(); - finished = 1; - cli_ses.lastauthtype = AUTH_TYPE_PASSWORD; - } -#endif - TRACE(("cli_auth_try lastauthtype %d", cli_ses.lastauthtype)) if (!finished) { -- GitLab