Be a bit more careful about when we want to use CLI_AUTH_IMMEDIATE

Only use it if we have pubkeys to try, or we have $DROPBEAR_PASSWORD set
This commit is contained in:
Matt Johnston
2013-04-02 00:11:53 +08:00
parent 90b5691183
commit ff2aa20565
3 changed files with 35 additions and 25 deletions

View File

@@ -221,7 +221,9 @@ static void cli_sessionloop() {
return;
case USERAUTH_FAIL_RCVD:
cli_auth_try();
if (cli_auth_try() == DROPBEAR_FAILURE) {
dropbear_exit("No auth methods could be used.");
}
cli_ses.state = USERAUTH_REQ_SENT;
TRACE(("leave cli_sessionloop: cli_auth_try"))
return;