From 60a86157c721daf7929a5116e5b2dec63348611d Mon Sep 17 00:00:00 2001 From: Kareem Date: Wed, 3 Nov 2021 16:03:26 -0700 Subject: [PATCH] Fix building with NO_ECC_KEY_EXPORT. --- src/tls.c | 4 ++-- tests/api.c | 2 +- wolfcrypt/test/test.c | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/tls.c b/src/tls.c index 8f0b7104c..a16ae82f5 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 81aa480b1..cdb0f701c 100644 --- a/tests/api.c +++ b/tests/api.c @@ -26293,7 +26293,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;