Bugzilla – Attachment 3589 Details for
Bug 3429
Confusing error message from `ssh-keygen -Y sign` when private key is not in agent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
improve error message
bz3429.diff (text/plain), 1.24 KB, created by
Damien Miller
on 2022-05-06 14:28:21 AEST
(
hide
)
Description:
improve error message
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2022-05-06 14:28:21 AEST
Size:
1.24 KB
patch
obsolete
>diff --git a/ssh-keygen.c b/ssh-keygen.c >index ef2361e..5a3e8ce 100644 >--- a/ssh-keygen.c >+++ b/ssh-keygen.c >@@ -2439,7 +2439,8 @@ load_sign_key(const char *keypath, const struct sshkey *pubkey) > char *privpath = xstrdup(keypath); > static const char * const suffixes[] = { "-cert.pub", ".pub", NULL }; > struct sshkey *ret = NULL, *privkey = NULL; >- int r; >+ int r, waspub = 0; >+ struct stat st; > > /* > * If passed a public key filename, then try to locate the corresponding >@@ -2454,8 +2455,15 @@ load_sign_key(const char *keypath, const struct sshkey *pubkey) > privpath[plen - slen] = '\0'; > debug_f("%s looks like a public key, using private key " > "path %s instead", keypath, privpath); >+ waspub = 1; > } >- if ((privkey = load_identity(privpath, NULL)) == NULL) { >+ if (waspub && stat(privpath, &st) != 0 && errno == ENOENT) >+ fatal("No private key found for public key \"%s\"", keypath); >+ if ((r = sshkey_load_private(privpath, "", &privkey, NULL)) != 0 && >+ (r != SSH_ERR_KEY_WRONG_PASSPHRASE)) { >+ debug_fr(r, "load private key \"%s\"", privpath); >+ fatal("No private key found for \"%s\"", privpath); >+ } else if ((privkey = load_identity(privpath, NULL)) == NULL) { > error("Couldn't load identity %s", keypath); > goto done; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 3429
:
3589
|
3590