encrypted-payload: Check for non-zero payload size

Signed-off-by: Markus Theil <markus.theil@secunet.com>
This commit is contained in:
Markus Theil
2026-04-13 15:12:55 +02:00
committed by Tobias Brunner
parent fdd06d99ec
commit febe474926
@@ -637,7 +637,7 @@ static status_t decrypt_content(char *label, aead_t *aead, chunk_t encrypted,
crypt.ptr = iv.ptr + iv.len;
crypt.len = encrypted.len - iv.len;
if (iv.len + icv.len > encrypted.len ||
if (iv.len + icv.len >= encrypted.len ||
(crypt.len - icv.len) % bs)
{
DBG1(DBG_ENC, "decrypting %s payload failed, invalid length", label);