From 8f3ea3175f80e75b326720f29b55a6888d8605cf Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 26 Oct 2015 00:42:14 +0200 Subject: [PATCH] tests: Fix build without CONFIG_ERP=y hmac_sha256_kdf() got pulled in only if CONFIG_ERP=y is set. Fix test_sha256() by making the test case conditional on the function being present. Signed-off-by: Jouni Malinen --- src/crypto/crypto_module_tests.c | 2 ++ wpa_supplicant/Android.mk | 1 + wpa_supplicant/Makefile | 1 + 3 files changed, 4 insertions(+) diff --git a/src/crypto/crypto_module_tests.c b/src/crypto/crypto_module_tests.c index 2d508c1c0..2b19a4a0c 100644 --- a/src/crypto/crypto_module_tests.c +++ b/src/crypto/crypto_module_tests.c @@ -1576,6 +1576,7 @@ static int test_sha256(void) key = os_malloc(8161); if (key) { +#ifdef CONFIG_HMAC_SHA256_KDF int res; res = hmac_sha256_kdf((u8 *) "secret", 6, "label", @@ -1593,6 +1594,7 @@ static int test_sha256(void) "Unexpected hmac_sha256_kdf(outlen=8161) success"); errors++; } +#endif /* CONFIG_HMAC_SHA256_KDF */ os_free(key); } diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk index efdb198bf..ef698d01f 100644 --- a/wpa_supplicant/Android.mk +++ b/wpa_supplicant/Android.mk @@ -1277,6 +1277,7 @@ ifdef NEED_TLS_PRF_SHA256 SHA256OBJS += src/crypto/sha256-tlsprf.c endif ifdef NEED_HMAC_SHA256_KDF +L_CFLAGS += -DCONFIG_HMAC_SHA256_KDF SHA256OBJS += src/crypto/sha256-kdf.c endif OBJS += $(SHA256OBJS) diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile index d6bebe3c8..61f8f1870 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -1301,6 +1301,7 @@ ifdef NEED_TLS_PRF_SHA256 SHA256OBJS += ../src/crypto/sha256-tlsprf.o endif ifdef NEED_HMAC_SHA256_KDF +CFLAGS += -DCONFIG_HMAC_SHA256_KDF OBJS += ../src/crypto/sha256-kdf.o endif OBJS += $(SHA256OBJS)