1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-17 14:07:03 +01:00

gpg: Add canceled status message.

* common/status.h (STATUS_CANCELED_BY_USER): New.
* g10/passphrase.c (passphrase_to_dek): Send STATUS_CANCELED_BY_USER
instead of STATUS_MISSING_PASSPHRASE when canceled is set.
--

This is to prevent further pinentry tries when the pinentry is canceled
by the user during symmetric decryption.

Signed-off-by: Ben Kibbey <bjk@luxsci.net>
This commit is contained in:
Ben Kibbey 2020-11-04 21:51:06 -08:00
parent f808012ac2
commit 31e47dfad0
2 changed files with 2 additions and 1 deletions

View File

@ -37,6 +37,7 @@ enum
STATUS_ENTER, STATUS_ENTER,
STATUS_LEAVE, STATUS_LEAVE,
STATUS_ABORT, STATUS_ABORT,
STATUS_CANCELED_BY_USER,
STATUS_GOODSIG, STATUS_GOODSIG,
STATUS_BADSIG, STATUS_BADSIG,

View File

@ -359,7 +359,7 @@ passphrase_to_dek (int cipher_algo, STRING2KEY *s2k,
if (*canceled) if (*canceled)
{ {
xfree (pw); xfree (pw);
write_status( STATUS_MISSING_PASSPHRASE ); write_status( STATUS_CANCELED_BY_USER );
return NULL; return NULL;
} }
} }