Commit 849dfad2bf for strongswan.org
commit 849dfad2bffb0cdcdc6b5f4eb75cab8bd5d9f467
Author: Tobias Brunner <tobias@strongswan.org>
Date: Mon Oct 26 18:56:16 2026 +0100
des: Enforce correct IV length when decrypting
diff --git a/src/libstrongswan/plugins/des/des_crypter.c b/src/libstrongswan/plugins/des/des_crypter.c
index f8261b057c..086540c62e 100644
--- a/src/libstrongswan/plugins/des/des_crypter.c
+++ b/src/libstrongswan/plugins/des/des_crypter.c
@@ -1414,6 +1414,11 @@ METHOD(crypter_t, decrypt, bool,
des_cblock ivb;
uint8_t *out;
+ if (iv.len < sizeof(des_cblock))
+ {
+ return FALSE;
+ }
+
out = data.ptr;
if (decrypted)
{
@@ -1483,6 +1488,11 @@ METHOD(crypter_t, decrypt3, bool,
des_cblock ivb;
uint8_t *out;
+ if (iv.len < sizeof(des_cblock))
+ {
+ return FALSE;
+ }
+
out = data.ptr;
if (decrypted)
{