Commit 6971249758 for strongswan.org
commit 697124975871ab4f1a0579c65bc056fea18dae8c
Author: Tobias Brunner <tobias@strongswan.org>
Date: Thu Jul 23 12:39:03 2026 +0200
auth-cfg: Avoid overflow when checking key strength compliance
The enumerator strictly handles pointers to pointers, so passing a
`u_int` is incorrect on 64-bit platforms.
Fixes: 918e92c4c9dc ("Support multiple different public key strength types in constraints")
diff --git a/src/libstrongswan/credentials/auth_cfg.c b/src/libstrongswan/credentials/auth_cfg.c
index fb052ca90f..076af520ee 100644
--- a/src/libstrongswan/credentials/auth_cfg.c
+++ b/src/libstrongswan/credentials/auth_cfg.c
@@ -1146,8 +1146,9 @@ METHOD(auth_cfg_t, complies, bool,
char *key_type DBG_UNUSED;
e2 = create_enumerator(this);
- while (e2->enumerate(e2, &t2, &strength))
+ while (e2->enumerate(e2, &t2, &value))
{
+ strength = (uintptr_t)value;
switch (t2)
{
default: