Skip to content

Commit

Permalink
Try password before interactive - bit of a hack
Browse files Browse the repository at this point in the history
  • Loading branch information
mkj committed Apr 1, 2013
1 parent 90cf7f0 commit 5af0d33
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cli-auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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) {
Expand Down

0 comments on commit 5af0d33

Please sign in to comment.