1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-05-29 21:58:04 +02:00

g10: Avoid caching passphrase for failed symmetric encryption.

* g10/mainproc.c (proc_encrypted): If error code is GPG_ERR_CIPHER_ALGO,
assume the symmetric passphrase was wrong and invalidate the cache.

Signed-off-by: Marcus Brinkmann <mb@g10code.com>
GnuPG-bug-id: 2270
This commit is contained in:
Marcus Brinkmann 2017-07-21 20:01:10 +02:00
parent b55b72bb81
commit e4c720fa3b

View File

@ -681,7 +681,8 @@ proc_encrypted (CTX c, PACKET *pkt)
}
else
{
if (gpg_err_code (result) == GPG_ERR_BAD_KEY
if ((gpg_err_code (result) == GPG_ERR_BAD_KEY
|| gpg_err_code (result) == GPG_ERR_CIPHER_ALGO)
&& *c->dek->s2k_cacheid != '\0')
{
if (opt.debug)