summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-agent.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2004-10-29 22:53:56 +0000
committerdjm <djm@openbsd.org>2004-10-29 22:53:56 +0000
commit4ec46a0eba55cca735e43b61bb86efdcda561d15 (patch)
tree13c6a539951b17a4006d87e97e4d2c999d154ba7 /usr.bin/ssh/ssh-agent.c
parentfix some window size change bugs for multiplexed connections: windows sizes (diff)
downloadwireguard-openbsd-4ec46a0eba55cca735e43b61bb86efdcda561d15.tar.xz
wireguard-openbsd-4ec46a0eba55cca735e43b61bb86efdcda561d15.zip
factor out common permission-asking code to separate function; ok markus@
Diffstat (limited to 'usr.bin/ssh/ssh-agent.c')
-rw-r--r--usr.bin/ssh/ssh-agent.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c
index 18dc1db12d5..63b59a55d7b 100644
--- a/usr.bin/ssh/ssh-agent.c
+++ b/usr.bin/ssh/ssh-agent.c
@@ -35,7 +35,7 @@
#include "includes.h"
#include <sys/queue.h>
-RCSID("$OpenBSD: ssh-agent.c,v 1.121 2004/10/07 10:12:36 djm Exp $");
+RCSID("$OpenBSD: ssh-agent.c,v 1.122 2004/10/29 22:53:56 djm Exp $");
#include <openssl/evp.h>
#include <openssl/md5.h>
@@ -164,23 +164,15 @@ lookup_identity(Key *key, int version)
static int
confirm_key(Identity *id)
{
- char *p, prompt[1024];
+ char *p;
int ret = -1;
p = key_fingerprint(id->key, SSH_FP_MD5, SSH_FP_HEX);
- snprintf(prompt, sizeof(prompt), "Allow use of key %s?\n"
- "Key fingerprint %s.", id->comment, p);
+ if (ask_permission("Allow use of key %s?\nKey fingerprint %s.",
+ id->comment, p))
+ ret = 0;
xfree(p);
- p = read_passphrase(prompt, RP_ALLOW_EOF);
- if (p != NULL) {
- /*
- * Accept empty responses and responses consisting
- * of the word "yes" as affirmative.
- */
- if (*p == '\0' || *p == '\n' || strcasecmp(p, "yes") == 0)
- ret = 0;
- xfree(p);
- }
+
return (ret);
}