From: Sverker Eriksson Date: Tue, 13 Jun 2023 19:02:32 +0200 Subject: [PATCH] crypto_SUITE: Remove md5, ripemd160 and sha as hash for rsa sign if FIPS diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 0f2d223b6b..15fd40be1d 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -2391,7 +2391,12 @@ rsa_sign_verify_tests(Config, Msg, Public, Private, PublicS, PrivateS, OptsToTry end. rsa_sign_verify_tests(Msg, Public, Private, PublicS, PrivateS, OptsToTry) -> - gen_rsa_sign_verify_tests([md5, ripemd160, sha, sha224, sha256], Msg, Public, Private, + Hashs0 = [sha224, sha256], + Hashs = case crypto:info_fips() of + enabled -> Hashs0; + _ -> [md5, ripemd160, sha | Hashs0] + end, + gen_rsa_sign_verify_tests(Hashs, Msg, Public, Private, [undefined | OptsToTry]) ++ gen_rsa_sign_verify_tests([sha384, sha512], Msg, PublicS, PrivateS, [undefined | OptsToTry]).