summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/sshconnect2.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2017-09-02 21:58:42 +0000
committerdes <des@FreeBSD.org>2017-09-02 21:58:42 +0000
commitca26403304720e30901aa6f7bde4883af9662d2d (patch)
tree24e8f197b92c6ecd99617ac7584b6ba544a46aec /crypto/openssh/sshconnect2.c
parentce0d6faba2a9fd27ff0fc0942a4e51f5203bb88f (diff)
downloadFreeBSD-src-ca26403304720e30901aa6f7bde4883af9662d2d.zip
FreeBSD-src-ca26403304720e30901aa6f7bde4883af9662d2d.tar.gz
MFH (r314306,r314720): Upgrade OpenSSH to 7.4p1.
Diffstat (limited to 'crypto/openssh/sshconnect2.c')
-rw-r--r--crypto/openssh/sshconnect2.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/crypto/openssh/sshconnect2.c b/crypto/openssh/sshconnect2.c
index fae8b0f..103a2b3 100644
--- a/crypto/openssh/sshconnect2.c
+++ b/crypto/openssh/sshconnect2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.247 2016/07/22 05:46:11 dtucker Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.251 2016/12/04 23:54:02 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -318,6 +318,7 @@ void userauth(Authctxt *, char *);
static int sign_and_send_pubkey(Authctxt *, Identity *);
static void pubkey_prepare(Authctxt *);
static void pubkey_cleanup(Authctxt *);
+static void pubkey_reset(Authctxt *);
static Key *load_identity_file(Identity *);
static Authmethod *authmethod_get(char *authlist);
@@ -404,6 +405,8 @@ ssh_userauth2(const char *local_user, const char *server_user, char *host,
pubkey_cleanup(&authctxt);
ssh_dispatch_range(ssh, SSH2_MSG_USERAUTH_MIN, SSH2_MSG_USERAUTH_MAX, NULL);
+ if (!authctxt.success)
+ fatal("Authentication failed.");
debug("Authentication succeeded (%s).", authctxt.method->name);
}
@@ -558,8 +561,7 @@ input_userauth_failure(int type, u_int32_t seq, void *ctxt)
if (partial != 0) {
verbose("Authenticated with partial success.");
/* reset state */
- pubkey_cleanup(authctxt);
- pubkey_prepare(authctxt);
+ pubkey_reset(authctxt);
}
debug("Authentications that can continue: %s", authlist);
@@ -1412,6 +1414,15 @@ pubkey_cleanup(Authctxt *authctxt)
}
}
+static void
+pubkey_reset(Authctxt *authctxt)
+{
+ Identity *id;
+
+ TAILQ_FOREACH(id, &authctxt->keys, next)
+ id->tried = 0;
+}
+
static int
try_identity(Identity *id)
{
@@ -1460,6 +1471,7 @@ userauth_pubkey(Authctxt *authctxt)
}
key_free(id->key);
id->key = NULL;
+ id->isprivate = 0;
}
}
if (sent)
OpenPOWER on IntegriCloud