aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/test/ssl_test_lib.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-05-22 11:17:11 +0200
committerIngela Anderton Andin <[email protected]>2013-05-28 09:20:55 +0200
commit6ec1399aa8e6f80d8423acc37027eeda4394e7ad (patch)
tree6c3ac6cdd0240c0d0979c41a0c17cd33383a50d3 /lib/ssl/test/ssl_test_lib.erl
parentba77e24590283aa242bb273093152387548636ac (diff)
downloadotp-6ec1399aa8e6f80d8423acc37027eeda4394e7ad.tar.gz
otp-6ec1399aa8e6f80d8423acc37027eeda4394e7ad.tar.bz2
otp-6ec1399aa8e6f80d8423acc37027eeda4394e7ad.zip
ssl: Do not advertise EC ciphers if crypto support is insufficient
Diffstat (limited to 'lib/ssl/test/ssl_test_lib.erl')
-rw-r--r--lib/ssl/test/ssl_test_lib.erl24
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index 255df92d77..34c52b10b3 100644
--- a/lib/ssl/test/ssl_test_lib.erl
+++ b/lib/ssl/test/ssl_test_lib.erl
@@ -756,14 +756,20 @@ ecdh_rsa_suites() ->
end,
ssl:cipher_suites()).
-openssl_rsa_suites() ->
+openssl_rsa_suites(CounterPart) ->
Ciphers = ssl:cipher_suites(openssl),
+ Names = case is_sane_ecc(CounterPart) of
+ true ->
+ "DSS | ECDSA";
+ false ->
+ "DSS | ECDHE | ECDH"
+ end,
lists:filter(fun(Str) ->
- case re:run(Str,"DSS|ECDH-RSA|ECDSA",[]) of
+ case re:run(Str, Names,[]) of
nomatch ->
- true;
+ false;
_ ->
- false
+ true
end
end, Ciphers).
@@ -994,6 +1000,16 @@ is_sane_ecc(openssl) ->
_ ->
true
end;
+is_sane_ecc(crypto) ->
+ [{_,_, Bin}] = crypto:info_lib(),
+ case binary_to_list(Bin) of
+ "OpenSSL 0.9.8" ++ _ -> % Does not support ECC
+ false;
+ "OpenSSL 0.9.7" ++ _ -> % Does not support ECC
+ false;
+ _ ->
+ true
+ end;
is_sane_ecc(_) ->
true.