]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix build without CONFIG_ERP=y
authorJouni Malinen <j@w1.fi>
Sun, 25 Oct 2015 22:42:14 +0000 (00:42 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 25 Oct 2015 22:42:14 +0000 (00:42 +0200)
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 <j@w1.fi>
src/crypto/crypto_module_tests.c
wpa_supplicant/Android.mk
wpa_supplicant/Makefile

index 2d508c1c08ed6f3303a973de343819804e548021..2b19a4a0c31fd3c75dc54466c69dbfd33fd7eea2 100644 (file)
@@ -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);
        }
index efdb198bf66adf653f84644fc30bf99437e18259..ef698d01f1f47c88a212aa99eac885496bf37684 100644 (file)
@@ -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)
index d6bebe3c8c6e9c47a742382e8baa01ca0f1a01c6..61f8f1870a9723596385bc1d1185064fdde38871 100644 (file)
@@ -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)