summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2019-02-12 23:53:10 +0000
committerdjm <djm@openbsd.org>2019-02-12 23:53:10 +0000
commitca036c834cfbdf246b8e4a12812b96669a7b302e (patch)
tree57c784b1f9bcc007c7cd8b7b6385d9f7d643d18d
parentSkip tests for wscons devices that do not exist on the local machine. (diff)
downloadwireguard-openbsd-ca036c834cfbdf246b8e4a12812b96669a7b302e.tar.xz
wireguard-openbsd-ca036c834cfbdf246b8e4a12812b96669a7b302e.zip
fix regression in r1.302 reported by naddy@ - only the first public
key from the agent was being attempted for use.
-rw-r--r--usr.bin/ssh/sshconnect2.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/ssh/sshconnect2.c b/usr.bin/ssh/sshconnect2.c
index 5935c7180aa..bf59edcefa5 100644
--- a/usr.bin/ssh/sshconnect2.c
+++ b/usr.bin/ssh/sshconnect2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.302 2019/02/11 09:44:42 djm Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.303 2019/02/12 23:53:10 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -298,7 +298,6 @@ static int input_userauth_passwd_changereq(int, u_int32_t, struct ssh *);
static int userauth_none(struct ssh *);
static int userauth_pubkey(struct ssh *);
-static void userauth_pubkey_cleanup(struct ssh *);
static int userauth_passwd(struct ssh *);
static int userauth_kbdint(struct ssh *);
static int userauth_hostbased(struct ssh *);
@@ -314,6 +313,7 @@ static int input_gssapi_errtok(int, u_int32_t, struct ssh *);
void userauth(struct ssh *, char *);
+static void pubkey_cleanup(struct ssh *);
static int sign_and_send_pubkey(struct ssh *ssh, Identity *);
static void pubkey_prepare(Authctxt *);
static void pubkey_reset(Authctxt *);
@@ -338,7 +338,7 @@ Authmethod authmethods[] = {
NULL},
{"publickey",
userauth_pubkey,
- userauth_pubkey_cleanup,
+ NULL,
&options.pubkey_authentication,
NULL},
{"keyboard-interactive",
@@ -407,6 +407,7 @@ ssh_userauth2(struct ssh *ssh, const char *local_user,
ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &input_userauth_ext_info);
ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_ACCEPT, &input_userauth_service_accept);
ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt.success); /* loop until success */
+ pubkey_cleanup(ssh);
ssh->authctxt = NULL;
ssh_dispatch_range(ssh, SSH2_MSG_USERAUTH_MIN, SSH2_MSG_USERAUTH_MAX, NULL);
@@ -1630,10 +1631,9 @@ pubkey_prepare(Authctxt *authctxt)
}
static void
-userauth_pubkey_cleanup(struct ssh *ssh)
+pubkey_cleanup(struct ssh *ssh)
{
Authctxt *authctxt = (Authctxt *)ssh->authctxt;
-
Identity *id;
if (authctxt->agent_fd != -1) {