Commit efd8bce49c for strongswan.org
commit efd8bce49c82008fe4bef397cf538b5003f16091
Author: Tobias Brunner <tobias@strongswan.org>
Date: Mon Oct 26 18:55:35 2026 +0100
aes: Enforce correct IV length when decrypting
diff --git a/src/libstrongswan/plugins/aes/aes_crypter.c b/src/libstrongswan/plugins/aes/aes_crypter.c
index 37954d9df3..5bb31d5ec0 100644
--- a/src/libstrongswan/plugins/aes/aes_crypter.c
+++ b/src/libstrongswan/plugins/aes/aes_crypter.c
@@ -796,6 +796,11 @@ METHOD(crypter_t, decrypt, bool,
const uint32_t *iv_i;
uint8_t *in, *out;
+ if (this->has_iv && iv.len != AES_BLOCK_SIZE)
+ {
+ return FALSE;
+ }
+
if (decrypted)
{
*decrypted = chunk_alloc(data.len);