summaryrefslogtreecommitdiffstats
path: root/sshconnect2.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2016-02-23 02:34:14 +0100
committerDamien Miller <djm@mindrot.org>2016-02-23 02:44:20 +0100
commit0d1451a32c7436e6d3d482351e776bc5e7824ce4 (patch)
tree4431db923512161810cfdcf6ce12ff523af31a4d /sshconnect2.c
parentupstream commit (diff)
downloadopenssh-0d1451a32c7436e6d3d482351e776bc5e7824ce4.tar.xz
openssh-0d1451a32c7436e6d3d482351e776bc5e7824ce4.zip
upstream commit
fix spurious error message when incorrect passphrase entered for keys; reported by espie@ ok deraadt@ Upstream-ID: 58b2e46e63ed6912ed1ee780bd3bd8560f9a5899
Diffstat (limited to '')
-rw-r--r--sshconnect2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sshconnect2.c b/sshconnect2.c
index 88365817b..f79c96beb 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.238 2016/02/05 04:31:21 jsg Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.239 2016/02/23 01:34:14 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -1039,7 +1039,7 @@ identity_sign(struct identity *id, u_char **sigp, size_t *lenp,
compat));
/* load the private key from the file */
if ((prv = load_identity_file(id)) == NULL)
- return (-1); /* XXX return decent error code */
+ return SSH_ERR_KEY_NOT_FOUND;
ret = sshkey_sign(prv, sigp, lenp, data, datalen, alg, compat);
sshkey_free(prv);
return (ret);
@@ -1125,7 +1125,8 @@ sign_and_send_pubkey(Authctxt *authctxt, Identity *id)
ret = identity_sign(id, &signature, &slen,
buffer_ptr(&b), buffer_len(&b), datafellows);
if (ret != 0) {
- error("%s: signing failed: %s", __func__, ssh_err(ret));
+ if (ret != SSH_ERR_KEY_NOT_FOUND)
+ error("%s: signing failed: %s", __func__, ssh_err(ret));
free(blob);
buffer_free(&b);
return 0;