summaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2014-02-10 00:18:28 +0000
committerColin Watson <cjwatson@debian.org>2014-02-10 00:18:28 +0000
commit9a975a9faed7c4f334e8c8490db3e77e102f2b21 (patch)
tree764a885ec9a963f6a8b15de6e1765f16b9ac4738 /ssh-add.c
parentee196dab7c5f97f0b80c8099343a375bead92010 (diff)
parentcdb6c90811caa5df2df856be9b0b16db020fe31d (diff)
Import openssh_6.5p1.orig.tar.gz
Diffstat (limited to 'ssh-add.c')
-rw-r--r--ssh-add.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ssh-add.c b/ssh-add.c
index 5e8166f66..63ce72083 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-add.c,v 1.106 2013/05/17 00:13:14 djm Exp $ */ 1/* $OpenBSD: ssh-add.c,v 1.108 2013/12/19 00:10:30 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -73,6 +73,7 @@ static char *default_files[] = {
73#ifdef OPENSSL_HAS_ECC 73#ifdef OPENSSL_HAS_ECC
74 _PATH_SSH_CLIENT_ID_ECDSA, 74 _PATH_SSH_CLIENT_ID_ECDSA,
75#endif 75#endif
76 _PATH_SSH_CLIENT_ID_ED25519,
76 _PATH_SSH_CLIENT_IDENTITY, 77 _PATH_SSH_CLIENT_IDENTITY,
77 NULL 78 NULL
78}; 79};
@@ -292,14 +293,17 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only)
292static int 293static int
293update_card(AuthenticationConnection *ac, int add, const char *id) 294update_card(AuthenticationConnection *ac, int add, const char *id)
294{ 295{
295 char *pin; 296 char *pin = NULL;
296 int ret = -1; 297 int ret = -1;
297 298
298 pin = read_passphrase("Enter passphrase for PKCS#11: ", RP_ALLOW_STDIN); 299 if (add) {
299 if (pin == NULL) 300 if ((pin = read_passphrase("Enter passphrase for PKCS#11: ",
300 return -1; 301 RP_ALLOW_STDIN)) == NULL)
302 return -1;
303 }
301 304
302 if (ssh_update_card(ac, add, id, pin, lifetime, confirm)) { 305 if (ssh_update_card(ac, add, id, pin == NULL ? "" : pin,
306 lifetime, confirm)) {
303 fprintf(stderr, "Card %s: %s\n", 307 fprintf(stderr, "Card %s: %s\n",
304 add ? "added" : "removed", id); 308 add ? "added" : "removed", id);
305 ret = 0; 309 ret = 0;