From 0d1451a32c7436e6d3d482351e776bc5e7824ce4 Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Tue, 23 Feb 2016 01:34:14 +0000 Subject: [PATCH] upstream commit fix spurious error message when incorrect passphrase entered for keys; reported by espie@ ok deraadt@ Upstream-ID: 58b2e46e63ed6912ed1ee780bd3bd8560f9a5899 --- sshconnect2.c | 7 ++++--- 1 file 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;