aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/test/ssl_test_lib.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-08-09 15:15:51 +0200
committerIngela Anderton Andin <[email protected]>2012-08-22 14:00:46 +0200
commit4f68e36b57bf7b2cc608bf1fb5d50486529bff10 (patch)
tree937e5288965e629e924a95f44625bc4cd7bbe976 /lib/ssl/test/ssl_test_lib.erl
parenta0bd4951be74a5db1c382a7e19432903db10e576 (diff)
downloadotp-4f68e36b57bf7b2cc608bf1fb5d50486529bff10.tar.gz
otp-4f68e36b57bf7b2cc608bf1fb5d50486529bff10.tar.bz2
otp-4f68e36b57bf7b2cc608bf1fb5d50486529bff10.zip
ssl: Add crypto support check (TLS 1.2 require sha256 support)
Diffstat (limited to 'lib/ssl/test/ssl_test_lib.erl')
-rw-r--r--lib/ssl/test/ssl_test_lib.erl13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index 905801fe3d..b39c995552 100644
--- a/lib/ssl/test/ssl_test_lib.erl
+++ b/lib/ssl/test/ssl_test_lib.erl
@@ -725,3 +725,16 @@ init_tls_version(Version) ->
application:load(ssl),
application:set_env(ssl, protocol_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;
+sufficient_crypto_support(_) ->
+ true.