aboutsummaryrefslogtreecommitdiffstats
path: root/g10/mainproc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-05-15 10:33:03 +0000
committerWerner Koch <[email protected]>2018-05-31 09:54:07 +0000
commit3db1b48a2da42942cb5a57281441167901bdcdc8 (patch)
tree951760c6a1fbc6447b366633a3ac6b703fe8f4d0 /g10/mainproc.c
parentgpg: Turn --no-mdc-warn into a NOP. (diff)
downloadgnupg-3db1b48a2da42942cb5a57281441167901bdcdc8.tar.gz
gnupg-3db1b48a2da42942cb5a57281441167901bdcdc8.zip
gpg: Hard fail on a missing MDC even for legacy algorithms.
* g10/mainproc.c (proc_encrypted): Require an MDC or AEAD * tests/openpgp/defs.scm (create-gpghome): Use --ignore-mdc-error to allow testing with the current files. -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit d1431901f0143cdc7af8d1a23387e0c6b5bb613f) Resolved Conflicts: g10/mainproc.c - Remove AEAD stuff.
Diffstat (limited to '')
-rw-r--r--g10/mainproc.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c
index fc5b9e556..5cf15151f 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -649,15 +649,12 @@ proc_encrypted (CTX c, PACKET *pkt)
;
else if (!result
&& !opt.ignore_mdc_error
- && !pkt->pkt.encrypted->mdc_method
- && openpgp_cipher_get_algo_blklen (c->dek->algo) != 8
- && c->dek->algo != CIPHER_ALGO_TWOFISH)
+ && !pkt->pkt.encrypted->mdc_method)
{
- /* The message has been decrypted but has no MDC despite that a
- modern cipher (blocklength != 64 bit, except for Twofish) is
- used and the option to ignore MDC errors is not used: To
- avoid attacks changing an MDC message to a non-MDC message,
- we fail here. */
+ /* The message has been decrypted but does not carry an MDC.
+ * The option --ignore-mdc-error has also not been used. To
+ * avoid attacks changing an MDC message to a non-MDC message,
+ * we fail here. */
log_error (_("WARNING: message was not integrity protected\n"));
if (opt.verbose > 1)
log_info ("decryption forced to fail\n");