summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ssh-add.c15
2 files changed, 14 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index b8108d92f..32ec354e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
120131229 120131229
2 - (djm) [loginrec.c] Check for username truncation when looking up lastlog 2 - (djm) [loginrec.c] Check for username truncation when looking up lastlog
3 entries 3 entries
4 - (djm) OpenBSD CVS Sync
5 - djm@cvs.openbsd.org 2013/12/19 00:10:30
6 [ssh-add.c]
7 skip requesting smartcard PIN when removing keys from agent; bz#2187
8 patch from jay AT slushpupie.com; ok dtucker
4 9
520131221 1020131221
6 - (dtucker) [regress/keytype.sh] Actually test ecdsa key types. 11 - (dtucker) [regress/keytype.sh] Actually test ecdsa key types.
diff --git a/ssh-add.c b/ssh-add.c
index 896584482..63ce72083 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-add.c,v 1.107 2013/12/15 18:17:26 pascal 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
@@ -293,14 +293,17 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only)
293static int 293static int
294update_card(AuthenticationConnection *ac, int add, const char *id) 294update_card(AuthenticationConnection *ac, int add, const char *id)
295{ 295{
296 char *pin; 296 char *pin = NULL;
297 int ret = -1; 297 int ret = -1;
298 298
299 pin = read_passphrase("Enter passphrase for PKCS#11: ", RP_ALLOW_STDIN); 299 if (add) {
300 if (pin == NULL) 300 if ((pin = read_passphrase("Enter passphrase for PKCS#11: ",
301 return -1; 301 RP_ALLOW_STDIN)) == NULL)
302 return -1;
303 }
302 304
303 if (ssh_update_card(ac, add, id, pin, lifetime, confirm)) { 305 if (ssh_update_card(ac, add, id, pin == NULL ? "" : pin,
306 lifetime, confirm)) {
304 fprintf(stderr, "Card %s: %s\n", 307 fprintf(stderr, "Card %s: %s\n",
305 add ? "added" : "removed", id); 308 add ? "added" : "removed", id);
306 ret = 0; 309 ret = 0;