diff options
author | Andreas Schultz <aschultz@tpip.net> | 2013-02-19 17:31:54 +0100 |
---|---|---|
committer | Andreas Schultz <aschultz@tpip.net> | 2013-02-27 19:24:14 +0100 |
commit | 2da38637a507e35d4b2ea9d4aba1983ea28c2898 (patch) | |
tree | edcc38a806d6aa8ada15ebe6f50966c436e67420 | |
parent | 9e850b2e8be99e53dbf98177e20503287c6b09ef (diff) | |
download | erlang-2da38637a507e35d4b2ea9d4aba1983ea28c2898.tar.gz |
SSL: replace sha256_mac() tests with crypto:algorithms()
-rw-r--r-- | lib/ssl/src/ssl_record.erl | 10 | ||||
-rw-r--r-- | lib/ssl/test/ssl_test_lib.erl | 10 |
2 files changed, 2 insertions, 18 deletions
diff --git a/lib/ssl/src/ssl_record.erl b/lib/ssl/src/ssl_record.erl index 173b9611c6..5101beeac8 100644 --- a/lib/ssl/src/ssl_record.erl +++ b/lib/ssl/src/ssl_record.erl @@ -704,12 +704,4 @@ mac_hash({3, N} = Version, MacAlg, MacSecret, SeqNo, Type, Length, Fragment) Length, Fragment). sufficient_tlsv1_2_crypto_support() -> - Data = "Sampl", - Data2 = "e #1", - Key = <<0,1,2,3,16,17,18,19,32,33,34,35,48,49,50,51,4,5,6,7,20,21,22,23,36,37,38,39, - 52,53,54,55,8,9,10,11,24,25,26,27,40,41,42,43,56,57,58,59>>, - try - crypto:sha256_mac(Key, lists:flatten([Data, Data2])), - true - catch _:_ -> false - end. + proplists:get_bool(sha256, crypto:algorithms()). diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl index d655d7659e..3e5f7b1dcb 100644 --- a/lib/ssl/test/ssl_test_lib.erl +++ b/lib/ssl/test/ssl_test_lib.erl @@ -817,15 +817,7 @@ init_tls_version(Version) -> ssl:start(). sufficient_crypto_support('tlsv1.2') -> - Data = "Sampl", - Data2 = "e #1", - Key = <<0,1,2,3,16,17,18,19,32,33,34,35,48,49,50,51,4,5,6,7,20,21,22,23,36,37,38,39, - 52,53,54,55,8,9,10,11,24,25,26,27,40,41,42,43,56,57,58,59>>, - try - crypto:sha256_mac(Key, lists:flatten([Data, Data2])), - true - catch _:_ -> false - end; + proplists:get_bool(sha256, crypto:algorithms()); sufficient_crypto_support(_) -> true. |