mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
gpg: Fix regression for non-default --passphrase-repeat option.
* agent/command.c (cmd_get_passphrase): Take care of --repeat with --newsymkey. -- GnuPG-bug-id: 4997
This commit is contained in:
parent
4031c42bfd
commit
b8c4dd902d
@ -1716,7 +1716,11 @@ cmd_get_passphrase (assuan_context_t ctx, char *line)
|
|||||||
if (desc)
|
if (desc)
|
||||||
plus_to_blank (desc);
|
plus_to_blank (desc);
|
||||||
|
|
||||||
if (opt_newsymkey)
|
/* If opt_repeat is 2 or higher we can't use our pin_entry_info_s
|
||||||
|
* based method but fallback to the old simple method. It is
|
||||||
|
* anyway questionable whether this extra repeat count makes any
|
||||||
|
* real sense. */
|
||||||
|
if (opt_newsymkey && opt_repeat < 2)
|
||||||
{
|
{
|
||||||
/* We do not want to break any existing usage of this command
|
/* We do not want to break any existing usage of this command
|
||||||
* and thus we introduced the option --newsymkey to make this
|
* and thus we introduced the option --newsymkey to make this
|
||||||
@ -1765,13 +1769,15 @@ cmd_get_passphrase (assuan_context_t ctx, char *line)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (*pi->pin && !pi->repeat_okay
|
if (*pi->pin && !pi->repeat_okay
|
||||||
&& ctrl->pinentry_mode != PINENTRY_MODE_LOOPBACK)
|
&& ctrl->pinentry_mode != PINENTRY_MODE_LOOPBACK
|
||||||
|
&& opt_repeat)
|
||||||
{
|
{
|
||||||
/* The passphrase is empty and the pinentry did not
|
/* The passphrase is empty and the pinentry did not
|
||||||
* already run the repetition check, do it here. This
|
* already run the repetition check, do it here. This
|
||||||
* is only called when using an old and simple pinentry.
|
* is only called when using an old and simple pinentry.
|
||||||
* It is neither called in loopback mode because the
|
* It is neither called in loopback mode because the
|
||||||
* caller does any passphrase repetition by herself. */
|
* caller does any passphrase repetition by herself nor if
|
||||||
|
* no repetition was requested. */
|
||||||
xfree (response);
|
xfree (response);
|
||||||
response = NULL;
|
response = NULL;
|
||||||
rc = agent_get_passphrase (ctrl, &response,
|
rc = agent_get_passphrase (ctrl, &response,
|
||||||
|
@ -3268,7 +3268,10 @@ default. @option{--no-escape-from-lines} disables this option.
|
|||||||
@opindex passphrase-repeat
|
@opindex passphrase-repeat
|
||||||
Specify how many times @command{@gpgname} will request a new
|
Specify how many times @command{@gpgname} will request a new
|
||||||
passphrase be repeated. This is useful for helping memorize a
|
passphrase be repeated. This is useful for helping memorize a
|
||||||
passphrase. Defaults to 1 repetition.
|
passphrase. Defaults to 1 repetition; can be set to 0 to disable any
|
||||||
|
passphrase repetition. Note that a @var{n} greater than 1 will pop up
|
||||||
|
the pinentry window @var{n}+1 times even if a modern pinentry with
|
||||||
|
two entry fields is used.
|
||||||
|
|
||||||
@item --passphrase-fd @var{n}
|
@item --passphrase-fd @var{n}
|
||||||
@opindex passphrase-fd
|
@opindex passphrase-fd
|
||||||
|
Loading…
x
Reference in New Issue
Block a user