summaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-add.c')
-rw-r--r--ssh-add.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/ssh-add.c b/ssh-add.c
index 084478d78..90e5be20b 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-add.c,v 1.91 2009/08/27 17:44:52 djm Exp $ */ 1/* $OpenBSD: ssh-add.c,v 1.92 2010/02/08 10:50:20 markus 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
@@ -211,7 +211,7 @@ update_card(AuthenticationConnection *ac, int add, const char *id)
211 char *pin; 211 char *pin;
212 int ret = -1; 212 int ret = -1;
213 213
214 pin = read_passphrase("Enter passphrase for smartcard: ", RP_ALLOW_STDIN); 214 pin = read_passphrase("Enter passphrase for PKCS#11: ", RP_ALLOW_STDIN);
215 if (pin == NULL) 215 if (pin == NULL)
216 return -1; 216 return -1;
217 217
@@ -317,10 +317,8 @@ usage(void)
317 fprintf(stderr, " -X Unlock agent.\n"); 317 fprintf(stderr, " -X Unlock agent.\n");
318 fprintf(stderr, " -t life Set lifetime (in seconds) when adding identities.\n"); 318 fprintf(stderr, " -t life Set lifetime (in seconds) when adding identities.\n");
319 fprintf(stderr, " -c Require confirmation to sign using identities\n"); 319 fprintf(stderr, " -c Require confirmation to sign using identities\n");
320#ifdef SMARTCARD 320 fprintf(stderr, " -s pkcs11 Add keys from PKCS#11 provider.\n");
321 fprintf(stderr, " -s reader Add key in smartcard reader.\n"); 321 fprintf(stderr, " -e pkcs11 Remove keys provided by PKCS#11 provider.\n");
322 fprintf(stderr, " -e reader Remove key in smartcard reader.\n");
323#endif
324} 322}
325 323
326int 324int
@@ -329,7 +327,7 @@ main(int argc, char **argv)
329 extern char *optarg; 327 extern char *optarg;
330 extern int optind; 328 extern int optind;
331 AuthenticationConnection *ac = NULL; 329 AuthenticationConnection *ac = NULL;
332 char *sc_reader_id = NULL; 330 char *pkcs11provider = NULL;
333 int i, ch, deleting = 0, ret = 0; 331 int i, ch, deleting = 0, ret = 0;
334 332
335 /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ 333 /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
@@ -371,11 +369,11 @@ main(int argc, char **argv)
371 ret = 1; 369 ret = 1;
372 goto done; 370 goto done;
373 case 's': 371 case 's':
374 sc_reader_id = optarg; 372 pkcs11provider = optarg;
375 break; 373 break;
376 case 'e': 374 case 'e':
377 deleting = 1; 375 deleting = 1;
378 sc_reader_id = optarg; 376 pkcs11provider = optarg;
379 break; 377 break;
380 case 't': 378 case 't':
381 if ((lifetime = convtime(optarg)) == -1) { 379 if ((lifetime = convtime(optarg)) == -1) {
@@ -392,8 +390,8 @@ main(int argc, char **argv)
392 } 390 }
393 argc -= optind; 391 argc -= optind;
394 argv += optind; 392 argv += optind;
395 if (sc_reader_id != NULL) { 393 if (pkcs11provider != NULL) {
396 if (update_card(ac, !deleting, sc_reader_id) == -1) 394 if (update_card(ac, !deleting, pkcs11provider) == -1)
397 ret = 1; 395 ret = 1;
398 goto done; 396 goto done;
399 } 397 }