From 083f143c89a0dac02903ae269dc800d5c071e24d Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 21 Aug 2020 15:18:54 -0700 Subject: [PATCH] Fixes for warnings with minimum ECC build. --- wolfcrypt/benchmark/benchmark.c | 7 +++++++ wolfcrypt/test/test.c | 12 ++++++++++-- wolfssl/wolfcrypt/random.h | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 00d2380ee..c5ee772cb 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -5428,6 +5428,13 @@ exit: FREE_ARRAY(sig, BENCH_MAX_PENDING, HEAP_HINT); FREE_ARRAY(digest, BENCH_MAX_PENDING, HEAP_HINT); #endif + + (void)pending; + (void)x; + (void)count; + (void)times; + (void)desc; + (void)start; } diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index ca66ca3db..40602ac6b 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -18360,6 +18360,11 @@ static int ecc_test_make_pub(WC_RNG* rng) XFILE file; #endif + (void)msg; + (void)verify; + (void)exportBuf; + (void)rng; + wc_ecc_init_ex(&key, HEAP_HINT, devId); #ifndef NO_ECC256 @@ -20604,7 +20609,7 @@ static int ecc_test_nonblock(WC_RNG* rng) int ecc_test(void) { int ret; - WC_RNG rng; + WC_RNG rng; #ifdef WOLFSSL_CERT_EXT ret = ecc_decode_test(); @@ -20617,8 +20622,10 @@ int ecc_test(void) #else ret = wc_InitRng(&rng); #endif +#ifndef WC_NO_RNG if (ret != 0) return -9900; +#endif #if defined(HAVE_ECC112) || defined(HAVE_ALL_CURVES) ret = ecc_test_curve(&rng, 14); @@ -20935,7 +20942,8 @@ done: #endif /* HAVE_ECC_ENCRYPT */ #if defined(USE_CERT_BUFFERS_256) && !defined(WOLFSSL_ATECC508A) && \ - !defined(WOLFSSL_ATECC608A) && !defined(NO_ECC256) + !defined(WOLFSSL_ATECC608A) && !defined(NO_ECC256) && \ + defined(HAVE_ECC_VERIFY) && defined(HAVE_ECC_SIGN) int ecc_test_buffers(void) { size_t bytes; ecc_key cliKey; diff --git a/wolfssl/wolfcrypt/random.h b/wolfssl/wolfcrypt/random.h index aaa21c48b..aefd44e37 100644 --- a/wolfssl/wolfcrypt/random.h +++ b/wolfssl/wolfcrypt/random.h @@ -219,7 +219,7 @@ WOLFSSL_API int wc_FreeRng(WC_RNG*); #define wc_InitRng_ex(rng, h, d) NOT_COMPILED_IN #define wc_InitRngNonce(rng, n, s) NOT_COMPILED_IN #define wc_InitRngNonce_ex(rng, n, s, h, d) NOT_COMPILED_IN -#define wc_RNG_GenerateBlock(rng, b, s) NOT_COMPILED_IN +#define wc_RNG_GenerateBlock(rng, b, s) ({(void)rng; (void)b; (void)s; NOT_COMPILED_IN;}) #define wc_RNG_GenerateByte(rng, b) NOT_COMPILED_IN #define wc_FreeRng(rng) (void)NOT_COMPILED_IN #endif