upstream commit

fix spurious error message when incorrect passphrase
 entered for keys; reported by espie@ ok deraadt@

Upstream-ID: 58b2e46e63ed6912ed1ee780bd3bd8560f9a5899
This commit is contained in:
djm@openbsd.org 2016-02-23 01:34:14 +00:00 committed by Damien Miller
parent 09d87d7974
commit 0d1451a32c
1 changed files with 4 additions and 3 deletions

View File

@ -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) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. 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)); compat));
/* load the private key from the file */ /* load the private key from the file */
if ((prv = load_identity_file(id)) == NULL) 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); ret = sshkey_sign(prv, sigp, lenp, data, datalen, alg, compat);
sshkey_free(prv); sshkey_free(prv);
return (ret); return (ret);
@ -1125,6 +1125,7 @@ sign_and_send_pubkey(Authctxt *authctxt, Identity *id)
ret = identity_sign(id, &signature, &slen, ret = identity_sign(id, &signature, &slen,
buffer_ptr(&b), buffer_len(&b), datafellows); buffer_ptr(&b), buffer_len(&b), datafellows);
if (ret != 0) { if (ret != 0) {
if (ret != SSH_ERR_KEY_NOT_FOUND)
error("%s: signing failed: %s", __func__, ssh_err(ret)); error("%s: signing failed: %s", __func__, ssh_err(ret));
free(blob); free(blob);
buffer_free(&b); buffer_free(&b);