aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/test
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-06-01 17:17:39 +0200
committerHans Nilsson <[email protected]>2017-06-12 12:22:34 +0200
commit8a2640f29b4dce4ffe7fdc7480b7ac377ab96093 (patch)
treead4895d6f15f8ba5812ba20722e63042ea095507 /lib/crypto/test
parent4665af0b305cb45e2bf5da10ca540a0a032ece47 (diff)
downloadotp-8a2640f29b4dce4ffe7fdc7480b7ac377ab96093.tar.gz
otp-8a2640f29b4dce4ffe7fdc7480b7ac377ab96093.tar.bz2
otp-8a2640f29b4dce4ffe7fdc7480b7ac377ab96093.zip
crypto: filter out small mod in test suite for rsa keygen in FIPS mode
Diffstat (limited to 'lib/crypto/test')
-rw-r--r--lib/crypto/test/crypto_SUITE.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index 30ee782fe9..1390ee9650 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -809,8 +809,15 @@ do_generate({ecdh = Type, Curve, Priv, Pub}) ->
ct:fail({{crypto, generate_key, [Type, Priv, Curve]}, {expected, Pub}, {got, Other}})
end;
do_generate({rsa = Type, Mod, Exp}) ->
- {Pub,Priv} = crypto:generate_key(Type, {Mod,Exp}),
- do_sign_verify({rsa, sha256, Pub, Priv, rsa_plain()}).
+ case crypto:info_fips() of
+ enabled when Mod < 3072 ->
+ ct:log("SKIP do_generate ~p FIPS=~p, Mod=~p Exp=~p", [Type, enabled, Mod, Exp]),
+ {skip, "FIPS violation"};
+ FIPS ->
+ ct:log("do_generate ~p FIPS=~p, Mod=~p Exp=~p", [Type, FIPS, Mod, Exp]),
+ {Pub,Priv} = crypto:generate_key(Type, {Mod,Exp}),
+ do_sign_verify({rsa, sha256, Pub, Priv, rsa_plain()})
+ end.
notsup(Fun, Args) ->
Result =