From baf0a86ab5fe75a25e80fedd3ece1e18ccea5371 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Tue, 2 Apr 2013 00:11:53 +0800 Subject: 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 --- cli-session.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cli-session.c') diff --git a/cli-session.c b/cli-session.c index 0c6635a..b13948f 100644 --- a/cli-session.c +++ b/cli-session.c @@ -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; -- cgit v1.2.1