summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-add.c
diff options
context:
space:
mode:
authorrees <rees@openbsd.org>2002-03-21 22:44:05 +0000
committerrees <rees@openbsd.org>2002-03-21 22:44:05 +0000
commit6ce251419a809941620756b7475b9466e59ad8d3 (patch)
tree869b2550a6a27cec3604929b3535c853b8b24e25 /usr.bin/ssh/ssh-add.c
parentbasic sftp put/get test (diff)
downloadwireguard-openbsd-6ce251419a809941620756b7475b9466e59ad8d3.tar.xz
wireguard-openbsd-6ce251419a809941620756b7475b9466e59ad8d3.zip
Add PIN-protection for secret key.
Diffstat (limited to 'usr.bin/ssh/ssh-add.c')
-rw-r--r--usr.bin/ssh/ssh-add.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c
index ce14e2e7a61..8a2e43e9173 100644
--- a/usr.bin/ssh/ssh-add.c
+++ b/usr.bin/ssh/ssh-add.c
@@ -35,7 +35,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-add.c,v 1.52 2002/03/21 10:21:20 markus Exp $");
+RCSID("$OpenBSD: ssh-add.c,v 1.53 2002/03/21 22:44:05 rees Exp $");
#include <openssl/evp.h>
@@ -170,7 +170,13 @@ add_file(AuthenticationConnection *ac, const char *filename)
static int
update_card(AuthenticationConnection *ac, int add, const char *id)
{
- if (ssh_update_card(ac, add, id)) {
+ char *pin;
+
+ pin = read_passphrase("Enter passphrase for smartcard: ", RP_ALLOW_STDIN);
+ if (pin == NULL)
+ return -1;
+
+ if (ssh_update_card(ac, add, id, pin)) {
fprintf(stderr, "Card %s: %s\n",
add ? "added" : "removed", id);
return 0;