diff --git a/src/tls.c b/src/tls.c index e2d1cc2c6..1506d9a0e 100644 --- a/src/tls.c +++ b/src/tls.c @@ -6486,7 +6486,7 @@ static int TLSX_KeyShare_GenX448Key(WOLFSSL *ssl, KeyShareEntry* kse) static int TLSX_KeyShare_GenEccKey(WOLFSSL *ssl, KeyShareEntry* kse) { int ret = 0; -#ifdef HAVE_ECC +#if defined(HAVE_ECC) && defined(HAVE_ECC_KEY_EXPORT) word32 keySize = 0; word16 curveId = ECC_CURVE_INVALID; ecc_key* eccKey = (ecc_key*)kse->key; @@ -6611,7 +6611,7 @@ static int TLSX_KeyShare_GenEccKey(WOLFSSL *ssl, KeyShareEntry* kse) (void)kse; ret = NOT_COMPILED_IN; -#endif /* HAVE_ECC */ +#endif /* HAVE_ECC && HAVE_ECC_KEY_EXPORT */ return ret; } diff --git a/tests/api.c b/tests/api.c index c15adaa8a..884b3e9dd 100644 --- a/tests/api.c +++ b/tests/api.c @@ -26334,7 +26334,7 @@ static int test_ToTraditional (void) static int test_wc_EccPrivateKeyToDer (void) { int ret = 0; -#if defined(HAVE_ECC) && !defined(WC_NO_RNG) +#if defined(HAVE_ECC) && defined(HAVE_ECC_KEY_EXPORT) && !defined(WC_NO_RNG) byte output[ONEK_BUF]; ecc_key eccKey; diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index e953e8ef5..761e66efa 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -21468,9 +21468,7 @@ static int ecc_test_make_pub(WC_RNG* rng) byte tmp[ECC_BUFSIZE]; #endif const byte* msg = (const byte*)"test wolfSSL ECC public gen"; -#if defined(HAVE_ECC_KEY_EXPORT) word32 x; -#endif word32 tmpSz; int ret = 0; ecc_point* pubPoint = NULL;