diff options
author | djm@openbsd.org <djm@openbsd.org> | 2016-02-23 01:34:14 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2016-02-23 12:44:20 +1100 |
commit | 0d1451a32c7436e6d3d482351e776bc5e7824ce4 (patch) | |
tree | 4431db923512161810cfdcf6ce12ff523af31a4d /sshconnect2.c | |
parent | 09d87d79741beb85768b5e788d7dfdf4bc3543dc (diff) |
upstream commit
fix spurious error message when incorrect passphrase
entered for keys; reported by espie@ ok deraadt@
Upstream-ID: 58b2e46e63ed6912ed1ee780bd3bd8560f9a5899
Diffstat (limited to 'sshconnect2.c')
-rw-r--r-- | sshconnect2.c | 7 |
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 @@ | |||
1 | /* $OpenBSD: sshconnect2.c,v 1.238 2016/02/05 04:31:21 jsg Exp $ */ | 1 | /* $OpenBSD: sshconnect2.c,v 1.239 2016/02/23 01:34:14 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * Copyright (c) 2008 Damien Miller. All rights reserved. | 4 | * Copyright (c) 2008 Damien Miller. All rights reserved. |
@@ -1039,7 +1039,7 @@ identity_sign(struct identity *id, u_char **sigp, size_t *lenp, | |||
1039 | compat)); | 1039 | compat)); |
1040 | /* load the private key from the file */ | 1040 | /* load the private key from the file */ |
1041 | if ((prv = load_identity_file(id)) == NULL) | 1041 | if ((prv = load_identity_file(id)) == NULL) |
1042 | return (-1); /* XXX return decent error code */ | 1042 | return SSH_ERR_KEY_NOT_FOUND; |
1043 | ret = sshkey_sign(prv, sigp, lenp, data, datalen, alg, compat); | 1043 | ret = sshkey_sign(prv, sigp, lenp, data, datalen, alg, compat); |
1044 | sshkey_free(prv); | 1044 | sshkey_free(prv); |
1045 | return (ret); | 1045 | return (ret); |
@@ -1125,7 +1125,8 @@ sign_and_send_pubkey(Authctxt *authctxt, Identity *id) | |||
1125 | ret = identity_sign(id, &signature, &slen, | 1125 | ret = identity_sign(id, &signature, &slen, |
1126 | buffer_ptr(&b), buffer_len(&b), datafellows); | 1126 | buffer_ptr(&b), buffer_len(&b), datafellows); |
1127 | if (ret != 0) { | 1127 | if (ret != 0) { |
1128 | error("%s: signing failed: %s", __func__, ssh_err(ret)); | 1128 | if (ret != SSH_ERR_KEY_NOT_FOUND) |
1129 | error("%s: signing failed: %s", __func__, ssh_err(ret)); | ||
1129 | free(blob); | 1130 | free(blob); |
1130 | buffer_free(&b); | 1131 | buffer_free(&b); |
1131 | return 0; | 1132 | return 0; |