aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPéter Dimitrov <[email protected]>2019-04-24 12:42:26 +0200
committerIngela Anderton Andin <[email protected]>2019-04-30 17:18:24 +0200
commite7a51b4877d98be1b76da7cb98892ca46e2a6e7b (patch)
tree6fbbdfcdfe6db50826beedd121cce773f47bf9cf
parentf4d4d9c5fdd504b376ed986817b8187f65e89077 (diff)
downloadotp-e7a51b4877d98be1b76da7cb98892ca46e2a6e7b.tar.gz
otp-e7a51b4877d98be1b76da7cb98892ca46e2a6e7b.tar.bz2
otp-e7a51b4877d98be1b76da7cb98892ca46e2a6e7b.zip
ssl: Update function ssl:eccs/1
Remove support of version tuples (e.g. {3,3}) from API function ssl:eccs/1. Update function spec and documentation. Change-Id: I891e42a2ca31c3e06b4edeeb866c0df874f2035b Conflicts: lib/ssl/doc/src/ssl.xml lib/ssl/src/ssl.erl
-rw-r--r--lib/ssl/doc/src/ssl.xml14
-rw-r--r--lib/ssl/src/ssl.erl23
-rw-r--r--lib/ssl/test/ssl_basic_SUITE.erl6
3 files changed, 12 insertions, 31 deletions
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index 9b3935bbca..fcbffb53a3 100644
--- a/lib/ssl/doc/src/ssl.xml
+++ b/lib/ssl/doc/src/ssl.xml
@@ -128,7 +128,7 @@
<name name="hostname"/>
</datatype>
- <datatype>
+ <datatype>
<name name="ip_address"/>
</datatype>
@@ -137,26 +137,14 @@
</datatype>
<datatype>
- <name name="protocol_version_tuple"/>
- </datatype>
-
- <datatype>
<name name="tls_version"/>
</datatype>
<datatype>
- <name name="tls_version_tuple"/>
- </datatype>
-
- <datatype>
<name name="dtls_version"/>
</datatype>
<datatype>
- <name name="dtls_version_tuple"/>
- </datatype>
-
- <datatype>
<name name="legacy_version"/>
</datatype>
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 19931ce778..6f52226d5d 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -79,7 +79,6 @@
cipher_filters/0,
sign_algo/0,
protocol_version/0,
- protocol_version_tuple/0,
protocol_extensions/0,
session_id/0,
error_alert/0,
@@ -978,27 +977,23 @@ eccs() ->
%%--------------------------------------------------------------------
-spec eccs(Version) -> NamedCurves when
- Version :: protocol_version() | protocol_version_tuple(),
+ Version :: protocol_version(),
NamedCurves :: [named_curve()].
%% Description: returns the curves supported for a given version of
%% ssl/tls.
%%--------------------------------------------------------------------
-eccs({3,0}) ->
+eccs(sslv3) ->
[];
-eccs({3,_}) ->
- Curves = tls_v1:ecc_curves(all),
- eccs_filter_supported(Curves);
-eccs({254,_} = Version) ->
- eccs(dtls_v1:corresponding_tls_version(Version));
+eccs('dtlsv1') ->
+ eccs('tlsv1.1');
+eccs('dtlsv1.2') ->
+ eccs('tlsv1.2');
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))).
+ Version == tlsv1 ->
+ Curves = tls_v1:ecc_curves(all),
+ eccs_filter_supported(Curves).
eccs_filter_supported(Curves) ->
CryptoCurves = crypto:ec_curves(),
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl
index 14d212cb10..4452adaea7 100644
--- a/lib/ssl/test/ssl_basic_SUITE.erl
+++ b/lib/ssl/test/ssl_basic_SUITE.erl
@@ -1858,14 +1858,12 @@ eccs() ->
eccs(Config) when is_list(Config) ->
[_|_] = All = ssl:eccs(),
- [] = SSL3 = ssl:eccs({3,0}),
- [_|_] = Tls = ssl:eccs({3,1}),
- [_|_] = Tls1 = ssl:eccs({3,2}),
- [_|_] = Tls2 = ssl:eccs({3,3}),
[] = SSL3 = ssl:eccs(sslv3),
[_|_] = Tls = ssl:eccs(tlsv1),
[_|_] = Tls1 = ssl:eccs('tlsv1.1'),
[_|_] = Tls2 = ssl:eccs('tlsv1.2'),
+ [_|_] = Tls1 = ssl:eccs('dtlsv1'),
+ [_|_] = Tls2 = ssl:eccs('dtlsv1.2'),
%% ordering is currently unverified by the test
true = lists:sort(All) =:= lists:usort(SSL3 ++ Tls ++ Tls1 ++ Tls2),
ok.