diff options
author | halex@openbsd.org <halex@openbsd.org> | 2015-02-03 00:34:14 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-02-05 07:42:59 +1100 |
commit | 5d34aa94938abb12b877a25be51862757f25d54b (patch) | |
tree | c63936c26f9ab318bb0730a8990eb5330e03f40f | |
parent | cb3bde373e80902c7d5d0db429f85068d19b2918 (diff) |
upstream commit
slightly extend the passphrase prompt if running with -c
in order to give the user a chance to notice if unintentionally running
without it
wording tweak and ok djm@
-rw-r--r-- | ssh-add.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-add.c,v 1.118 2015/01/28 22:36:00 djm Exp $ */ | 1 | /* $OpenBSD: ssh-add.c,v 1.119 2015/02/03 00:34:14 halex 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 |
@@ -232,8 +232,8 @@ add_file(int agent_fd, const char *filename, int key_only) | |||
232 | if (private == NULL) { | 232 | if (private == NULL) { |
233 | /* clear passphrase since it did not work */ | 233 | /* clear passphrase since it did not work */ |
234 | clear_pass(); | 234 | clear_pass(); |
235 | snprintf(msg, sizeof msg, "Enter passphrase for %.200s: ", | 235 | snprintf(msg, sizeof msg, "Enter passphrase for %.200s%s: ", |
236 | comment); | 236 | comment, confirm ? " (will confirm each use)" : ""); |
237 | for (;;) { | 237 | for (;;) { |
238 | pass = read_passphrase(msg, RP_ALLOW_STDIN); | 238 | pass = read_passphrase(msg, RP_ALLOW_STDIN); |
239 | if (strcmp(pass, "") == 0) | 239 | if (strcmp(pass, "") == 0) |
@@ -253,7 +253,8 @@ add_file(int agent_fd, const char *filename, int key_only) | |||
253 | } | 253 | } |
254 | clear_pass(); | 254 | clear_pass(); |
255 | snprintf(msg, sizeof msg, | 255 | snprintf(msg, sizeof msg, |
256 | "Bad passphrase, try again for %.200s: ", comment); | 256 | "Bad passphrase, try again for %.200s%s: ", comment, |
257 | confirm ? " (will confirm each use)" : ""); | ||
257 | } | 258 | } |
258 | } | 259 | } |
259 | sshbuf_free(keyblob); | 260 | sshbuf_free(keyblob); |