summaryrefslogtreecommitdiff
path: root/ssh-agent.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-agent.c')
-rw-r--r--ssh-agent.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/ssh-agent.c b/ssh-agent.c
index fffed1342..dd7e22ad5 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -35,7 +35,7 @@
35 35
36#include "includes.h" 36#include "includes.h"
37#include "openbsd-compat/sys-queue.h" 37#include "openbsd-compat/sys-queue.h"
38RCSID("$OpenBSD: ssh-agent.c,v 1.121 2004/10/07 10:12:36 djm Exp $"); 38RCSID("$OpenBSD: ssh-agent.c,v 1.122 2004/10/29 22:53:56 djm Exp $");
39 39
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41#include <openssl/md5.h> 41#include <openssl/md5.h>
@@ -168,23 +168,15 @@ lookup_identity(Key *key, int version)
168static int 168static int
169confirm_key(Identity *id) 169confirm_key(Identity *id)
170{ 170{
171 char *p, prompt[1024]; 171 char *p;
172 int ret = -1; 172 int ret = -1;
173 173
174 p = key_fingerprint(id->key, SSH_FP_MD5, SSH_FP_HEX); 174 p = key_fingerprint(id->key, SSH_FP_MD5, SSH_FP_HEX);
175 snprintf(prompt, sizeof(prompt), "Allow use of key %s?\n" 175 if (ask_permission("Allow use of key %s?\nKey fingerprint %s.",
176 "Key fingerprint %s.", id->comment, p); 176 id->comment, p))
177 ret = 0;
177 xfree(p); 178 xfree(p);
178 p = read_passphrase(prompt, RP_ALLOW_EOF); 179
179 if (p != NULL) {
180 /*
181 * Accept empty responses and responses consisting
182 * of the word "yes" as affirmative.
183 */
184 if (*p == '\0' || *p == '\n' || strcasecmp(p, "yes") == 0)
185 ret = 0;
186 xfree(p);
187 }
188 return (ret); 180 return (ret);
189} 181}
190 182