From 9bc0e31a322bb332f991ede428f06281a4611807 Mon Sep 17 00:00:00 2001 From: Lealem Amedie Date: Fri, 19 Apr 2024 12:35:33 -0600 Subject: [PATCH 1/3] Fix for AES CTR on STM32 --- wolfcrypt/src/aes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index c24b3c953..9c5bd0824 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -6151,7 +6151,7 @@ int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) return BAD_FUNC_ARG; } - return wc_AesSetKeyLocal(aes, key, len, iv, dir, 0); + return wc_AesSetKey(aes, key, len, iv, dir); } #endif /* NEED_AES_CTR_SOFT */ From acc6ff84d87dd4cb1a2f71e22b6d153941207f5e Mon Sep 17 00:00:00 2001 From: Lealem Amedie Date: Fri, 19 Apr 2024 12:36:20 -0600 Subject: [PATCH 2/3] Move rng seed cb call to wolfcrypt_test --- wolfcrypt/test/test.c | 8 ++++---- wolfssl/wolfcrypt/settings.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 9eb3021bf..6881b9b12 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -996,6 +996,10 @@ wc_test_ret_t wolfcrypt_test(void* args) heap_baselineBytes = wolfCrypt_heap_peakBytes_checkpoint(); #endif +#ifdef WC_RNG_SEED_CB + wc_SetSeed_Cb(wc_GenerateSeed); +#endif + printf("------------------------------------------------------------------------------\n"); printf(" wolfSSL version %s\n", LIBWOLFSSL_VERSION_STRING); #ifdef WOLF_CRYPTO_CB @@ -2094,10 +2098,6 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ printf("Math: %s\n", wc_GetMathInfo()); #endif -#ifdef WC_RNG_SEED_CB - wc_SetSeed_Cb(wc_GenerateSeed); -#endif - #ifdef HAVE_STACK_SIZE StackSizeCheck(&args, wolfcrypt_test); #else diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index b68d65725..be1e64b71 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -388,7 +388,7 @@ * system or other set of headers included by wolfSSL already defines * RNG. Examples are: * wolfEngine, wolfProvider and potentially other use-cases */ - #ifndef RNG + #if !defined(RNG) && !defined(NO_OLD_RNGNAME) #define RNG WC_RNG #endif #endif From eafa4250197bca976640785be4af4b1698afb7ca Mon Sep 17 00:00:00 2001 From: Lealem Amedie Date: Fri, 19 Apr 2024 16:15:38 -0600 Subject: [PATCH 3/3] Engine doesn't need NO_OLD_RNG_NAME --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 152da7ed9..08228af95 100644 --- a/configure.ac +++ b/configure.ac @@ -1915,9 +1915,9 @@ AC_ARG_ENABLE([opensslcoexist], if test "x$ENABLED_OPENSSLCOEXIST" = "xyes" || test "$ENABLED_WOLFENGINE" = "yes" then - # make sure old names are disabled - enable_oldnames=no - + # make sure old names are disabled (except RNG) + AM_CFLAGS="$AM_CFLAGS -DNO_OLD_WC_NAMES -DNO_OLD_SSL_NAMES" + AM_CFLAGS="$AM_CFLAGS -DNO_OLD_SHA_NAMES -DNO_OLD_MD5_NAME" AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COEXIST" fi