diff options
author | 2019-11-15 02:38:07 +0000 | |
---|---|---|
committer | 2019-11-15 02:38:07 +0000 | |
commit | 2b753a7aed51617ba0512955f0385d1a9cf097f8 (patch) | |
tree | 0820676c500c262f05167bccfe46804c803b4686 /usr.bin/ssh/ssh-agent.c | |
parent | close the "touch your security key" notifier on the error path too (diff) | |
download | wireguard-openbsd-2b753a7aed51617ba0512955f0385d1a9cf097f8.tar.xz wireguard-openbsd-2b753a7aed51617ba0512955f0385d1a9cf097f8.zip |
show the "please touch your security key" notifier when using the
(default) build-in security key support.
Diffstat (limited to 'usr.bin/ssh/ssh-agent.c')
-rw-r--r-- | usr.bin/ssh/ssh-agent.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c index 474f07fd259..dc688f5fddf 100644 --- a/usr.bin/ssh/ssh-agent.c +++ b/usr.bin/ssh/ssh-agent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-agent.c,v 1.243 2019/11/14 21:27:30 djm Exp $ */ +/* $OpenBSD: ssh-agent.c,v 1.244 2019/11/15 02:38:07 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -72,6 +72,7 @@ #include "ssherr.h" #include "match.h" #include "msg.h" +#include "ssherr.h" #include "pathnames.h" #include "ssh-pkcs11.h" #include "ssh-sk.h" @@ -284,9 +285,21 @@ provider_sign(const char *provider, struct sshkey *key, *sigp = NULL; *lenp = 0; + if ((fp = sshkey_fingerprint(key, SSH_FP_HASH_DEFAULT, + SSH_FP_DEFAULT)) == NULL) + fatal("%s: sshkey_fingerprint failed", __func__); + notifier = notify_start(0, + "Confirm user presence for key %s %s", sshkey_type(key), fp); + if (strcasecmp(provider, "internal") == 0) { - return sshsk_sign(provider, key, sigp, lenp, + r = sshsk_sign(provider, key, sigp, lenp, data, datalen, compat); + if (r != 0) { + error("%s: sshsk_sign internal: %s", + __func__, ssh_err(r)); + } + notify_complete(notifier); + return r; } helper = getenv("SSH_SK_HELPER"); @@ -335,17 +348,10 @@ provider_sign(const char *provider, struct sshkey *key, error("%s: send: %s", __func__, ssh_err(r)); goto out; } - if ((fp = sshkey_fingerprint(key, SSH_FP_HASH_DEFAULT, - SSH_FP_DEFAULT)) == NULL) - fatal("%s: sshkey_fingerprint failed", __func__); - notifier = notify_start(0, - "Confirm user presence for key %s %s", sshkey_type(key), fp); if ((r = ssh_msg_recv(pair[0], resp)) != 0) { error("%s: receive: %s", __func__, ssh_err(r)); goto out; } - notify_complete(notifier); - notifier = NULL; if ((r = sshbuf_get_u8(resp, &version)) != 0) { error("%s: parse version: %s", __func__, ssh_err(r)); goto out; |