aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-07-07 12:18:56 +0200
committerHans Nilsson <[email protected]>2017-07-07 14:31:49 +0200
commit0efea034a03db099a0e47fe49fc4f56e386e65d8 (patch)
treeea97dc1f90b6355659aab59a51983bea9da555e1 /lib/crypto
parenta05f8cf0121814702a48d474f9c3a91049103788 (diff)
downloadotp-0efea034a03db099a0e47fe49fc4f56e386e65d8.tar.gz
otp-0efea034a03db099a0e47fe49fc4f56e386e65d8.tar.bz2
otp-0efea034a03db099a0e47fe49fc4f56e386e65d8.zip
crypto: test case for sign/verify dss with sha256 etc
In OpenSSL version >= 1.0.1 the hash algos sha, sha224, sha256, sha384 and sha512 are supported. In 1.0.0 sha, sha224 and sha256 are supported In 0.9.8 sha is supported
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/test/crypto_SUITE.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index 7f039297dd..d6e3b99aae 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -1220,7 +1220,17 @@ group_config(dss = Type, Config) ->
Msg = dss_plain(),
Public = dss_params() ++ [dss_public()],
Private = dss_params() ++ [dss_private()],
- SignVerify = [{Type, sha, Public, Private, Msg}],
+ SupportedHashs = proplists:get_value(hashs, crypto:supports(), []),
+ DssHashs =
+ case crypto:info_lib() of
+ [{<<"OpenSSL">>,LibVer,_}] when is_integer(LibVer), LibVer > 16#10001000 ->
+ [sha, sha224, sha256, sha384, sha512];
+ _Else ->
+ [sha]
+ end,
+ SignVerify = [{Type, Hash, Public, Private, Msg}
+ || Hash <- DssHashs,
+ lists:member(Hash, SupportedHashs)],
[{sign_verify, SignVerify} | Config];
group_config(ecdsa = Type, Config) ->