aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2017-07-21 18:01:10 +0000
committerMarcus Brinkmann <[email protected]>2017-07-21 18:03:59 +0000
commite4c720fa3b31ebd3e9d764c6eab02729cf06124c (patch)
treeddcf98c6576b3bed0c668d511c31c1133c89e29e
parentgpg: Extend --quick-set-expire to allow subkey expiration setting. (diff)
downloadgnupg-e4c720fa3b31ebd3e9d764c6eab02729cf06124c.tar.gz
gnupg-e4c720fa3b31ebd3e9d764c6eab02729cf06124c.zip
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 <[email protected]> GnuPG-bug-id: 2270
Diffstat (limited to '')
-rw-r--r--g10/mainproc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c
index fddafd8cf..d0584d39a 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -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)