aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2018-03-29 11:54:51 +0200
committerIngela Anderton Andin <[email protected]>2018-03-29 11:54:51 +0200
commit0903ff40fa2e07c4a82e575ec577136b83ef999a (patch)
treeae7c0b9a9cffc6c38eb070230be4e0899cb2ddce /lib/ssl/src/ssl.erl
parentf274b4cb369e1d4d8474c80595a992959770abf9 (diff)
parentafc828c2bd320aefab5869d712b10e6acc1d0ec4 (diff)
downloadotp-0903ff40fa2e07c4a82e575ec577136b83ef999a.tar.gz
otp-0903ff40fa2e07c4a82e575ec577136b83ef999a.tar.bz2
otp-0903ff40fa2e07c4a82e575ec577136b83ef999a.zip
Merge branch 'ingela/ssl/DTLS-ECC'
* ingela/ssl/DTLS-ECC: ssl: Cleaner test setup to avoid unintentional test case dependencies ssl: Correct ECC suite and DTLS ECC handling
Diffstat (limited to 'lib/ssl/src/ssl.erl')
-rw-r--r--lib/ssl/src/ssl.erl22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 4efd13a6fa..e5d487a663 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -476,8 +476,9 @@ eccs() ->
eccs_filter_supported(Curves).
%%--------------------------------------------------------------------
--spec eccs(tls_record:tls_version() | tls_record:tls_atom_version()) ->
- tls_v1:curves().
+-spec eccs(tls_record:tls_version() | tls_record:tls_atom_version() |
+ dtls_record:dtls_version() | dtls_record:dtls_atom_version()) ->
+ tls_v1:curves().
%% Description: returns the curves supported for a given version of
%% ssl/tls.
%%--------------------------------------------------------------------
@@ -486,13 +487,16 @@ eccs({3,0}) ->
eccs({3,_}) ->
Curves = tls_v1:ecc_curves(all),
eccs_filter_supported(Curves);
-eccs({_,_} = DTLSVersion) ->
- eccs(dtls_v1:corresponding_tls_version(DTLSVersion));
-eccs(DTLSAtomVersion) when DTLSAtomVersion == 'dtlsv1';
- DTLSAtomVersion == 'dtlsv2' ->
- eccs(dtls_record:protocol_version(DTLSAtomVersion));
-eccs(AtomVersion) when is_atom(AtomVersion) ->
- eccs(tls_record:protocol_version(AtomVersion)).
+eccs({254,_} = Version) ->
+ eccs(dtls_v1:corresponding_tls_version(Version));
+eccs(Version) when Version == 'tlsv1.2';
+ Version == 'tlsv1.1';
+ Version == tlsv1;
+ Version == sslv3 ->
+ eccs(tls_record:protocol_version(Version));
+eccs(Version) when Version == 'dtlsv1.2';
+ Version == 'dtlsv1'->
+ eccs(dtls_v1:corresponding_tls_version(dtls_record:protocol_version(Version))).
eccs_filter_supported(Curves) ->
CryptoCurves = crypto:ec_curves(),