From 697124975871ab4f1a0579c65bc056fea18dae8c Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Thu, 23 Jul 2026 12:39:03 +0200 Subject: [PATCH] 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") --- src/libstrongswan/credentials/auth_cfg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstrongswan/credentials/auth_cfg.c b/src/libstrongswan/credentials/auth_cfg.c index fb052ca90..076af520e 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: