diff options
| author | Marcus Brinkmann <[email protected]> | 2017-07-21 18:01:10 +0000 |
|---|---|---|
| committer | Marcus Brinkmann <[email protected]> | 2017-07-21 18:03:59 +0000 |
| commit | e4c720fa3b31ebd3e9d764c6eab02729cf06124c (patch) | |
| tree | ddcf98c6576b3bed0c668d511c31c1133c89e29e | |
| parent | gpg: Extend --quick-set-expire to allow subkey expiration setting. (diff) | |
| download | gnupg-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
| -rw-r--r-- | g10/mainproc.c | 3 |
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) |
