diff options
author | Colin Watson <cjwatson@debian.org> | 2014-02-10 00:18:28 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2014-02-10 00:18:28 +0000 |
commit | 9a975a9faed7c4f334e8c8490db3e77e102f2b21 (patch) | |
tree | 764a885ec9a963f6a8b15de6e1765f16b9ac4738 /ssh-add.c | |
parent | ee196dab7c5f97f0b80c8099343a375bead92010 (diff) | |
parent | cdb6c90811caa5df2df856be9b0b16db020fe31d (diff) |
Import openssh_6.5p1.orig.tar.gz
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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) | |||
292 | static int | 293 | static int |
293 | update_card(AuthenticationConnection *ac, int add, const char *id) | 294 | update_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; |