From 64211c292dba4f5a23cf179fd7d715993880dc8e Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 15 Jul 2021 17:18:10 -0500 Subject: [PATCH] unit: Fix SAE unit test failure The SAE unit test was written when group 19 was preferred by default for all SAE connections. However, we have now started to prefer higher security groups. Trick the test into using group 19 by wrapping l_ecc_supported_ike_groups implementation to return just curve 19 as a supported curve. --- Makefile.am | 1 + unit/test-sae.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Makefile.am b/Makefile.am index 32d78bd6..abe2b97e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -523,6 +523,7 @@ unit_test_sae_SOURCES = unit/test-sae.c \ src/util.h src/util.c \ src/mpdu.h src/mpdu.c unit_test_sae_LDADD = $(ell_ldadd) +unit_test_sae_LDFLAGS = -Wl,-wrap,l_ecc_supported_ike_groups unit_test_p2p_SOURCES = unit/test-p2p.c src/wscutil.h src/wscutil.c \ src/crypto.h src/crypto.c \ diff --git a/unit/test-sae.c b/unit/test-sae.c index 17243535..d9ec6b31 100644 --- a/unit/test-sae.c +++ b/unit/test-sae.c @@ -36,6 +36,14 @@ #include "src/auth-proto.h" #include "src/crypto.h" +const unsigned int *__wrap_l_ecc_supported_ike_groups(void); + +const unsigned int *__wrap_l_ecc_supported_ike_groups(void) +{ + static unsigned int supported_ike_groups[2] = { 19, 0 }; + return supported_ike_groups; +} + struct test_handshake_state { struct handshake_state super; };