diff --git a/configure.ac b/configure.ac index ef20fc2f1..09aa1357b 100644 --- a/configure.ac +++ b/configure.ac @@ -215,8 +215,9 @@ AC_ARG_ENABLE([fips], # rand - wolfRand # v5-RC8 - historical FIPS 140-3 (wolfCrypt WCv5.0-RC8) # v5-RC9 - historical FIPS 140-3 (wolfCrypt WCv5.0-RC9) -# v5-RC10 - FIPS 140-3, wolfCrypt/fips WCv5.0-RC10 -# v5 - currently, alias for v5-RC10 +# v5-RC10 - historical FIPS 140-3, wolfCrypt/fips WCv5.0-RC10 +# v5-RC11 - FIPS 140-3, wolfCrypt/fips WCv5.0-RC11 +# v5 - currently, alias for v5-RC11 # v5-ready - FIPS 140-3 settings with in-tree wolfcrypt sources, feature locked # v5-dev - FIPS 140-3 settings with in-tree wolfcrypt sources, features freely adjustable # ready - currently, same as v5-ready @@ -257,12 +258,18 @@ AS_CASE([$ENABLED_FIPS], HAVE_FIPS_VERSION_MINOR=1 ENABLED_FIPS="yes" ], - [v5|v5-RC10],[ + [v5-RC10],[ FIPS_VERSION="v5-RC10" HAVE_FIPS_VERSION=5 HAVE_FIPS_VERSION_MINOR=2 ENABLED_FIPS="yes" ], + [v5|v5-RC11],[ + FIPS_VERSION="v5-RC11" + HAVE_FIPS_VERSION=5 + HAVE_FIPS_VERSION_MINOR=2 + ENABLED_FIPS="yes" + ], [ready|v5-ready],[ FIPS_VERSION="v5-ready" HAVE_FIPS_VERSION=5 diff --git a/fips-check.sh b/fips-check.sh index b29b0a085..e31420e14 100755 --- a/fips-check.sh +++ b/fips-check.sh @@ -6,20 +6,20 @@ # may be advancing, they must work correctly with the last tested # copy of our FIPS approved code. # -# This should check out all the approved versions. The command line -# option selects the version. +# This should check out all the approved flavors. The command line +# option selects the flavor. # -# $ ./fips-check [version] [keep] +# $ ./fips-check [flavor] [keep] # -# - version: linux (default), ios, android, windows, freertos, linux-ecc, netbsd-selftest, linuxv2, fips-ready, stm32l4-v2 +# - flavor: linux (default), ios, android, windows, freertos, linux-ecc, netbsd-selftest, linuxv2, fips-ready, stm32l4-v2, linuxv5, linuxv5-ready, linuxv5-dev # # - keep: (default off) XXX-fips-test temp dir around for inspection # Usage() { cat <$CRYPT_SRC_PATH/fips_test.c + cp "${CRYPT_SRC_PATH}/fips_test.c" "${CRYPT_SRC_PATH}/fips_test.c.bak" + sed "s/^\".*\";/\"${NEWHASH}\";/" "${CRYPT_SRC_PATH}/fips_test.c.bak" >"${CRYPT_SRC_PATH}/fips_test.c" make clean fi fi @@ -468,7 +443,7 @@ fi # Clean up popd || exit 2 -if [ "x$KEEP" == "xno" ]; +if [ "$KEEP" == "no" ]; then - rm -rf $TEST_DIR + rm -rf "$TEST_DIR" fi diff --git a/src/internal.c b/src/internal.c index 34298ca7b..dfca942ee 100644 --- a/src/internal.c +++ b/src/internal.c @@ -25011,7 +25011,7 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input, { #if (defined(WOLFSSL_RENESAS_SCEPROTECT) && \ defined(WOLFSSL_RENESAS_SCEPROTECT_ECC)) || \ - defined(WOLFSSL_RENESAS_TSIP_TLS) + defined(WOLFSSL_RENESAS_TSIP_TLS) /* already checked signature result by SCE */ /* skip the sign checks below */ if (Renesas_cmn_usable(ssl, 0)) { diff --git a/tests/api.c b/tests/api.c index 05132e065..10290f437 100644 --- a/tests/api.c +++ b/tests/api.c @@ -18495,18 +18495,21 @@ static int test_RsaDecryptBoundsCheck(void) ret = wc_RsaDirect(flatC, flatCSz, out, &outSz, &key, RSA_PRIVATE_DECRYPT, &rng); + + if (ret == RSA_OUT_OF_RANGE_E) { + mp_int c; + mp_init_copy(&c, &key.n); + mp_sub_d(&c, 1, &c); + mp_to_unsigned_bin(&c, flatC); + ret = wc_RsaDirect(flatC, flatCSz, out, &outSz, &key, + RSA_PRIVATE_DECRYPT, NULL); + mp_clear(&c); + } + if (ret == RSA_OUT_OF_RANGE_E) + ret = 0; + else + ret = WOLFSSL_FATAL_ERROR; } - if (ret == RSA_OUT_OF_RANGE_E) { - mp_int c; - mp_init_copy(&c, &key.n); - mp_sub_d(&c, 1, &c); - mp_to_unsigned_bin(&c, flatC); - ret = wc_RsaDirect(flatC, flatCSz, out, &outSz, &key, - RSA_PRIVATE_DECRYPT, NULL); - mp_clear(&c); - } - if (ret == RSA_OUT_OF_RANGE_E) - ret = 0; if (wc_FreeRsaKey(&key) || wc_FreeRng(&rng) || ret != 0) ret = WOLFSSL_FATAL_ERROR; diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index 3a2b99f4d..8ab1d8317 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -369,7 +369,7 @@ int wolfCrypt_Cleanup(void) #ifdef WOLFSSL_RENESAS_TSIP tsip_Close(); - #endif + #endif #ifdef WOLFSSL_RENESAS_SCEPROTECT wc_sce_Close();