Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require public key for signing only when necessary #499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ssh-keygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2735,16 +2735,16 @@ sig_sign(const char *keypath, const char *sig_namespace, int require_agent,
if (sig_process_opts(opts, nopts, &hashalg, NULL, NULL) != 0)
goto done; /* error already logged */

if ((r = sshkey_load_public(keypath, &pubkey, NULL)) != 0) {
error_r(r, "Couldn't load public key %s", keypath);
goto done;
}
if ((r = sshkey_load_public(keypath, &pubkey, NULL)) != 0)
debug_r(r, "Couldn't load public key %s", keypath);

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 {
if (pubkey == NULL)
fatal("Couldn't load public key %s", keypath);
if ((r = ssh_agent_has_key(agent_fd, pubkey)) == 0)
signer = agent_signer;
else {
Expand Down
Loading