1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

agent: Fix regression with --newsymkey in loopback mode.

* agent/command.c (cmd_get_passphrase): Never repeat in loopback mode;
same as with !OPT_NEWSYMKEY.
--

In loopback mode there shall not be any repeat because the caller is
expected to do any confirmation before passing a new passphrase to
gpg.

Fixes-commit: eace4bbe1ded8b01f9ad52ebc1871f2fd13c3a08
GnuPG-bug-id: 4991
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-07-13 14:30:14 +02:00
parent 3e730c55e7
commit 0a6af6dc12
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -1738,11 +1738,14 @@ cmd_get_passphrase (assuan_context_t ctx, char *line)
pi2->failed_tries = 0;
continue;
}
if (*pi->pin && !pi->repeat_okay)
if (*pi->pin && !pi->repeat_okay
&& ctrl->pinentry_mode != PINENTRY_MODE_LOOPBACK)
{
/* The passphrase is empty and the pinentry did not
* 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
* caller does any passphrase repetition by herself. */
xfree (response);
response = NULL;
rc = agent_get_passphrase (ctrl, &response,