aboutsummaryrefslogtreecommitdiffstats
path: root/sm
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2026-06-18 10:51:34 +0200
committerWerner Koch <[email protected]>2026-06-18 10:52:27 +0200
commit4c7e68cf3d335328821bdbb70db309a60d0e4fd4 (patch)
tree1318f79f3e1dabec7fb5b8a362205fe2bef1287d /sm
parentw32:common: Fix usleep in w32_wait_when_sharing_violation. (diff)
downloadgnupg-4c7e68cf3d335328821bdbb70db309a60d0e4fd4.tar.gz
gnupg-4c7e68cf3d335328821bdbb70db309a60d0e4fd4.zip
gpgsm: Require a minimum tag length for GCM decryption.
* sm/decrypt.c (gpgsm_decrypt): Require a minimum authtaglen. -- Reported-by: Thai Duong <[email protected]> This is similar to OpenSSL's CVE-id: CVE-2026-34182
Diffstat (limited to 'sm')
-rw-r--r--sm/decrypt.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sm/decrypt.c b/sm/decrypt.c
index 20fb96060..92a33c6e6 100644
--- a/sm/decrypt.c
+++ b/sm/decrypt.c
@@ -1447,7 +1447,14 @@ gpgsm_decrypt (ctrl_t ctrl, estream_t in_fp, estream_t out_fp)
}
if (DBG_CRYPTO)
log_printhex (authtag, authtaglen, "Authtag ...:");
- rc = gcry_cipher_checktag (dfparm.hd, authtag, authtaglen);
+ if (authtaglen < 12)
+ {
+ log_info ("authentication tag is too short (%zu octets)\n",
+ authtaglen);
+ rc = gpg_error (GPG_ERR_CHECKSUM);
+ }
+ else
+ rc = gcry_cipher_checktag (dfparm.hd, authtag, authtaglen);
xfree (authtag);
if (rc)
log_error ("data is not authentic: %s\n", gpg_strerror (rc));