Skip to content

Commit c829f59

Browse files
committed
configure.ac:
* allow for fips-dev in v7|ready|dev ENABLED_SHA256_DRBG and ENABLED_SHA512_DRBG setup and change from AC_MSG_WARN to AC_MSG_ERROR if user tries to disable outside fips-dev; * set ENABLED_SHA512_DRBG=no in lean-aesgcm setup; wolfcrypt/test/test.c: suppress concurrency-mt-unsafe in myFipsCb(); .wolfssl_known_macro_extras: fix lexical order.
1 parent 31cee2d commit c829f59

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

.wolfssl_known_macro_extras

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@ WOLFSSL_NO_KCAPI_HMAC_SHA384
832832
WOLFSSL_NO_KCAPI_HMAC_SHA512
833833
WOLFSSL_NO_KCAPI_SHA224
834834
WOLFSSL_NO_KTRI_ORACLE_WARNING
835+
WOLFSSL_NO_LMS_SHAKE256_256
835836
WOLFSSL_NO_OCSP_DATE_CHECK
836837
WOLFSSL_NO_OCSP_ISSUER_CHAIN_CHECK
837838
WOLFSSL_NO_OCSP_OPTIONAL_CERTS
@@ -1134,4 +1135,3 @@ ssize_t
11341135
sun
11351136
versal
11361137
wc_Tls13_HKDF_Expand_Label
1137-
WOLFSSL_NO_LMS_SHAKE256_256

configure.ac

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6350,14 +6350,14 @@ AS_CASE([$FIPS_VERSION],
63506350
SLHDSA_PARAM_SHA2_256F="yes"])
63516351
63526352
# SHA-256 DRBG -- cannot be disabled at build time in FIPS mode
6353-
AS_IF([test "$enable_sha256_drbg" = "no"],
6354-
[AC_MSG_WARN([Can not disable SHA256-DRBG at build time in FIPS mode, disable at run-time with wc_Sha256Drbg_Disable() or wc_Sha256Drbg_Disable_fips()])])
6355-
ENABLED_SHA256_DRBG="yes"
6353+
AS_IF([test "$ENABLED_SHA256_DRBG" != "yes" &&
6354+
test "$FIPS_VERSION" != "dev"],
6355+
[AC_MSG_ERROR([Can not disable SHA256-DRBG at build time in FIPS mode. Disable at run-time with wc_Sha256Drbg_Disable() or wc_Sha256Drbg_Disable_fips()])])
63566356
63576357
# SHA-512 DRBG -- cannot be disabled at build time in FIPS mode
6358-
AS_IF([test "$enable_sha512_drbg" = "no"],
6359-
[AC_MSG_WARN([Can not disable SHA512-DRBG at build time in FIPS mode, disable it at run-time with wc_Sha512Drbg_Disable() or wc_Sha512Drbg_Disable_fips()])])
6360-
ENABLED_SHA512_DRBG="yes"
6358+
AS_IF([test "$ENABLED_SHA512_DRBG" != "yes" &&
6359+
test "$FIPS_VERSION" != "dev"],
6360+
[AC_MSG_ERROR([Can not disable SHA512-DRBG at build time in FIPS mode. Disable it at run-time with wc_Sha512Drbg_Disable() or wc_Sha512Drbg_Disable_fips()])])
63616361
63626362
# Old TLS requires MD5 + HMAC, which is not allowed under FIPS 140-3
63636363
AS_IF([test "$ENABLED_OLD_TLS" != "no"],
@@ -6683,7 +6683,7 @@ AS_CASE([$FIPS_VERSION],
66836683
66846684
AS_IF([test "$ENABLED_SHA512" != "no" &&
66856685
(test "$FIPS_VERSION" != "lean-aesgcm-dev" || test "$enable_sha512" != "yes")],
6686-
[enable_sha512="no"; ENABLED_SHA512="no"; AM_CFLAGS="$AM_CFLAGS -UWOLFSSL_SHA512 -UWOLFSSL_SHA384"])
6686+
[enable_sha512="no"; ENABLED_SHA512="no"; ENABLED_SHA512_DRBG="no"; AM_CFLAGS="$AM_CFLAGS -UWOLFSSL_SHA512 -UWOLFSSL_SHA384"])
66876687
66886688
# SHA512-224 and SHA512-256 are SHA-2 algorithms not in our FIPS algorithm list
66896689
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256"
@@ -7813,7 +7813,8 @@ then
78137813
fi
78147814
78157815
# FIPS override: Hash DRBG is mandatory
7816-
if test "x$ENABLED_HASHDRBG" != "xyes" && test "x$ENABLED_FIPS" = "xyes" && test "x$ENABLED_KCAPI" = "xno"
7816+
if test "$ENABLED_HASHDRBG" != "yes" && test "$ENABLED_FIPS" = "yes" &&
7817+
test "$FIPS_VERSION" != "dev" && test "$ENABLED_KCAPI" = "no"
78177818
then
78187819
if test "$enable_hashdrbg" = "no"
78197820
then

wolfcrypt/test/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ static void myFipsCb(int ok, int err, const char* hash)
12721272
* fail, fire this callback, and produce millions of lines of
12731273
* redundant output. Exit now -- the hash has been printed for
12741274
* fips-hash.sh to extract, and no test can possibly pass. */
1275-
exit(IN_CORE_FIPS_E);
1275+
exit(IN_CORE_FIPS_E); /* NOLINT(concurrency-mt-unsafe) */
12761276
#endif
12771277
}
12781278
#ifdef REALLY_LONG_DRBG_CONTINUOUS_TEST

0 commit comments

Comments
 (0)