From 9cdbff8ee736dc2717340044054331cd576c1b35 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 17 Nov 2020 18:27:32 +0700 Subject: [PATCH] fix for no filesystem build with DH test case --- wolfcrypt/test/test.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 54846351a..73ee77cb7 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -15474,7 +15474,8 @@ static int dh_test(void) #endif /* Test DH key import / export */ -#if defined(WOLFSSL_DH_EXTRA) && (!defined(HAVE_FIPS) || \ +#if defined(WOLFSSL_DH_EXTRA) && !defined(NO_FILESYSTEM) && \ + (!defined(HAVE_FIPS) || \ (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION > 2))) wc_FreeDhKey(key); ret = wc_InitDhKey_ex(key, HEAP_HINT, devId); @@ -15496,8 +15497,14 @@ static int dh_test(void) if (ret != 0) { ERROR_OUT(-7951, done); } +#else + ret = wc_DhSetKey(key, dh_p, sizeof(dh_p), dh_g, sizeof(dh_g)); + if (ret != 0) { + ERROR_OUT(-7951, done); + } #endif + privSz = DH_TEST_BUF_SIZE; pubSz = DH_TEST_BUF_SIZE; ret = wc_DhExportKeyPair(key, priv, &privSz, pub, &pubSz);