summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-01-15 11:04:36 +0000
committerDamien Miller <djm@mindrot.org>2015-01-15 22:08:56 +1100
commitf14564c1f7792446bca143580aef0e7ac25dcdae (patch)
treea0d41b99305a4bc9bc89589fc823ac85732a5f05
parent45c0fd70bb2a88061319dfff20cb12ef7b1bc47e (diff)
upstream commit
fix regression reported by brad@ for passworded keys without agent present
-rw-r--r--sshconnect2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sshconnect2.c b/sshconnect2.c
index 343ca7459..9265ca4a5 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect2.c,v 1.214 2015/01/14 20:05:27 djm Exp $ */ 1/* $OpenBSD: sshconnect2.c,v 1.215 2015/01/15 11:04:36 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2008 Damien Miller. All rights reserved. 4 * Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -402,6 +402,7 @@ ssh_userauth2(const char *local_user, const char *server_user, char *host,
402 authctxt.methoddata = NULL; 402 authctxt.methoddata = NULL;
403 authctxt.sensitive = sensitive; 403 authctxt.sensitive = sensitive;
404 authctxt.info_req_seen = 0; 404 authctxt.info_req_seen = 0;
405 authctxt.agent_fd = -1;
405 if (authctxt.method == NULL) 406 if (authctxt.method == NULL)
406 fatal("ssh_userauth2: internal error: cannot send userauth none request"); 407 fatal("ssh_userauth2: internal error: cannot send userauth none request");
407 408
@@ -1108,7 +1109,7 @@ load_identity_file(char *filename, int userprovided)
1108{ 1109{
1109 Key *private; 1110 Key *private;
1110 char prompt[300], *passphrase; 1111 char prompt[300], *passphrase;
1111 int r, perm_ok = 0, quit, i; 1112 int r, perm_ok = 0, quit = 0, i;
1112 struct stat st; 1113 struct stat st;
1113 1114
1114 if (stat(filename, &st) < 0) { 1115 if (stat(filename, &st) < 0) {
@@ -1138,7 +1139,8 @@ load_identity_file(char *filename, int userprovided)
1138 quit = 1; 1139 quit = 1;
1139 break; 1140 break;
1140 } 1141 }
1141 debug2("bad passphrase given, try again..."); 1142 if (i != 0)
1143 debug2("bad passphrase given, try again...");
1142 break; 1144 break;
1143 case SSH_ERR_SYSTEM_ERROR: 1145 case SSH_ERR_SYSTEM_ERROR:
1144 if (errno == ENOENT) { 1146 if (errno == ENOENT) {