erlang/otp-0019-crypto_SUITE-Remove-md5-ripemd160-and-sha-as-hash-fo.patch
Peter Lemenkov a0135c1679 Erlang ver. 25.3.2.10
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2024-03-14 22:45:08 +01:00

25 lines
1.1 KiB
Diff

From: Sverker Eriksson <sverker@erlang.org>
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]).