Bugzilla – Attachment 3590 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]
Use prefer_agent
bz3429.diff (text/plain), 1.62 KB, created by
Damien Miller
on 2022-05-09 09:16:21 AEST
(
hide
)
Description:
Use prefer_agent
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2022-05-09 09:16:21 AEST
Size:
1.62 KB
patch
obsolete
>commit ecb9957282e3848c3ae152ca8e10a0161ea261b3 >Author: Damien Miller <djm@mindrot.org> >Date: Mon May 9 09:14:50 2022 +1000 > > use prefer_agent > >diff --git a/ssh-keygen.c b/ssh-keygen.c >index 9059f3a..00fa18d 100644 >--- a/ssh-keygen.c >+++ b/ssh-keygen.c >@@ -2631,8 +2631,8 @@ sig_process_opts(char * const *opts, size_t nopts, char **hashalgp, > > > static int >-sig_sign(const char *keypath, const char *sig_namespace, int argc, char **argv, >- char * const *opts, size_t nopts) >+sig_sign(const char *keypath, const char *sig_namespace, int require_agent, >+ int argc, char **argv, char * const *opts, size_t nopts) > { > int i, fd = -1, r, ret = -1; > int agent_fd = -1; >@@ -2656,13 +2656,18 @@ sig_sign(const char *keypath, const char *sig_namespace, int argc, char **argv, > goto done; > } > >- if ((r = ssh_get_authentication_socket(&agent_fd)) != 0) >+ if ((r = ssh_get_authentication_socket(&agent_fd)) != 0) { >+ if (require_agent) >+ fatal("Couldn't get agent socket"); > debug_r(r, "Couldn't get agent socket"); >- else { >+ } else { > if ((r = ssh_agent_has_key(agent_fd, pubkey)) == 0) > signer = agent_signer; >- else >+ else { >+ if (require_agent) >+ fatal("Couldn't find key in agent"); > debug_r(r, "Couldn't find key in agent"); >+ } > } > > if (signer == NULL) { >@@ -3517,7 +3522,7 @@ main(int argc, char **argv) > exit(1); > } > return sig_sign(identity_file, cert_principals, >- argc, argv, opts, nopts); >+ prefer_agent, argc, argv, opts, nopts); > } else if (strncmp(sign_op, "check-novalidate", 16) == 0) { > /* NB. cert_principals is actually namespace, via -n */ > if (cert_principals == NULL ||
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