From 10be54054eb9a31dd3e76354822fc9ae6f9820b4 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 18 Feb 2021 10:55:47 -0800 Subject: [PATCH] Minor fixes for build errors and bad macro names. --- IDE/MQX/user_settings.h | 2 +- cyassl/ctaocrypt/settings.h | 4 ++-- wolfcrypt/benchmark/benchmark.c | 10 +++++++--- wolfcrypt/src/port/ti/ti-des3.c | 4 ++-- wolfcrypt/test/test.c | 4 ++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/IDE/MQX/user_settings.h b/IDE/MQX/user_settings.h index c8431116b..e229a26dc 100644 --- a/IDE/MQX/user_settings.h +++ b/IDE/MQX/user_settings.h @@ -54,7 +54,7 @@ #define USE_FAST_MATH #define WC_NO_ASYNC_THREADING #define HAVE_DH_DEFAULT_PARAMS -#define NO_DES +#define NO_DES3 #define WOLFSSL_DH_CONST /* MQX */ diff --git a/cyassl/ctaocrypt/settings.h b/cyassl/ctaocrypt/settings.h index 5a6df5bf4..83e8bdd22 100644 --- a/cyassl/ctaocrypt/settings.h +++ b/cyassl/ctaocrypt/settings.h @@ -534,9 +534,9 @@ #endif #if (SSL_CFG_3DES_EN == DEF_ENABLED) - #undef NO_DES + #undef NO_DES3 #else - #define NO_DES + #define NO_DES3 #endif #if (SSL_CFG_AES_EN == DEF_ENABLED) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index ce508ab85..b480f5d94 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -728,6 +728,9 @@ static const char* bench_desc_words[][9] = { || defined(HAVE_CURVE448) || defined(HAVE_ED448) #define HAVE_LOCAL_RNG static THREAD_LS_T WC_RNG gRng; + #define GLOBAL_RNG &gRng +#else + #define GLOBAL_RNG NULL #endif #if defined(HAVE_ED25519) || defined(HAVE_CURVE25519) || \ @@ -4619,7 +4622,7 @@ static void bench_rsa_helper(int doAsync, RsaKey rsaKey[BENCH_MAX_PENDING], 1, ×, ntimes, &pending)) { ret = wc_RsaPublicEncrypt(message, (word32)len, enc[i], rsaKeySz/8, &rsaKey[i], - &gRng); + GLOBAL_RNG); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV( &rsaKey[i]), 1, ×, &pending)) { goto exit_rsa_verify; @@ -4702,7 +4705,6 @@ exit_rsa_sign: } #endif /* !WOLFSSL_RSA_PUBLIC_ONLY && !WOLFSSL_RSA_VERIFY_ONLY */ -#ifndef WOLFSSL_RSA_VERIFY_ONLY /* capture resulting encrypt length */ idx = rsaKeySz/8; @@ -4750,7 +4752,6 @@ exit_rsa_sign: exit_rsa_verifyinline: bench_stats_asym_finish("RSA", rsaKeySz, desc[5], doAsync, count, start, ret); -#endif /* !WOLFSSL_RSA_VERIFY_ONLY */ } exit: @@ -4844,6 +4845,9 @@ void bench_rsa(int doAsync) bench_rsa_helper(doAsync, rsaKey, rsaKeySz); } + (void)bytes; + (void)tmp; + exit_bench_rsa: /* cleanup */ for (i = 0; i < BENCH_MAX_PENDING; i++) { diff --git a/wolfcrypt/src/port/ti/ti-des3.c b/wolfcrypt/src/port/ti/ti-des3.c index 0e3c81dcd..6e93567d7 100644 --- a/wolfcrypt/src/port/ti/ti-des3.c +++ b/wolfcrypt/src/port/ti/ti-des3.c @@ -26,7 +26,7 @@ #include -#ifndef NO_DES +#ifndef NO_DES3 #if defined(WOLFSSL_TI_CRYPT) #include @@ -201,4 +201,4 @@ WOLFSSL_API void wc_Des3Free(Des3* des) #endif /* WOLFSSL_TI_CRYPT */ -#endif /* NO_DES */ +#endif /* !NO_DES3 */ diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index c7eef799a..fea66d074 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -6253,7 +6253,7 @@ WOLFSSL_TEST_SUBROUTINE int des_test(void) return 0; } -#endif /* NO_DES3 */ +#endif /* !NO_DES3 */ #ifndef NO_DES3 @@ -6375,7 +6375,7 @@ WOLFSSL_TEST_SUBROUTINE int des3_test(void) return 0; } -#endif /* NO_DES */ +#endif /* NO_DES3 */ #ifndef NO_AES