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@
This commit is contained in:
halex@openbsd.org 2015-02-03 00:34:14 +00:00 committed by Damien Miller
parent cb3bde373e
commit 5d34aa9493
1 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ssh-add.c,v 1.118 2015/01/28 22:36:00 djm Exp $ */
/* $OpenBSD: ssh-add.c,v 1.119 2015/02/03 00:34:14 halex Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* 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)
if (private == NULL) {
/* clear passphrase since it did not work */
clear_pass();
snprintf(msg, sizeof msg, "Enter passphrase for %.200s: ",
comment);
snprintf(msg, sizeof msg, "Enter passphrase for %.200s%s: ",
comment, confirm ? " (will confirm each use)" : "");
for (;;) {
pass = read_passphrase(msg, RP_ALLOW_STDIN);
if (strcmp(pass, "") == 0)
@ -253,7 +253,8 @@ add_file(int agent_fd, const char *filename, int key_only)
}
clear_pass();
snprintf(msg, sizeof msg,
"Bad passphrase, try again for %.200s: ", comment);
"Bad passphrase, try again for %.200s%s: ", comment,
confirm ? " (will confirm each use)" : "");
}
}
sshbuf_free(keyblob);