From 8a2640f29b4dce4ffe7fdc7480b7ac377ab96093 Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Thu, 1 Jun 2017 17:17:39 +0200 Subject: crypto: filter out small mod in test suite for rsa keygen in FIPS mode --- lib/crypto/test/crypto_SUITE.erl | 11 +++++++++-- 1 file 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 = -- cgit v1.2.3 From b803e2999a374aff4d20e8e30c66e8d5ee83f98b Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Fri, 2 Jun 2017 10:54:59 +0200 Subject: crypto: add test for rsa keygen 1024/3 --- lib/crypto/test/crypto_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 1390ee9650..164f43dcb0 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -1166,7 +1166,7 @@ group_config(rsa = Type, Config) -> rsa_oaep(), no_padding() ], - Generate = [{rsa, 2048, 17}, {rsa, 3072, 65537}], + Generate = [{rsa, 1024, 3}, {rsa, 2048, 17}, {rsa, 3072, 65537}], [{sign_verify, SignVerify}, {pub_priv_encrypt, PubPrivEnc}, {generate, Generate} | Config]; group_config(dss = Type, Config) -> Msg = dss_plain(), -- cgit v1.2.3