aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src
diff options
context:
space:
mode:
authorPéter Dimitrov <[email protected]>2019-04-24 12:42:26 +0200
committerPéter Dimitrov <[email protected]>2019-04-24 12:42:26 +0200
commit04faa82c43ba43929087b6d91fb1f9cbff34cb99 (patch)
treeea11d6d64777db0178936ece9287d8de8ab6ea19 /lib/ssl/src
parent40474905b2814f0a17d04a5cf91b0cb543e76653 (diff)
downloadotp-04faa82c43ba43929087b6d91fb1f9cbff34cb99.tar.gz
otp-04faa82c43ba43929087b6d91fb1f9cbff34cb99.tar.bz2
otp-04faa82c43ba43929087b6d91fb1f9cbff34cb99.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
Diffstat (limited to 'lib/ssl/src')
-rw-r--r--lib/ssl/src/ssl.erl26
1 files changed, 9 insertions, 17 deletions
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index a3138e8c30..f4941fe0bf 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -80,7 +80,6 @@
cipher_filters/0,
sign_algo/0,
protocol_version/0,
- protocol_version_tuple/0,
protocol_extensions/0,
session_id/0,
error_alert/0,
@@ -105,11 +104,8 @@
-type ip_address() :: inet:ip_address().
-type session_id() :: binary(). % exported
-type protocol_version() :: tls_version() | dtls_version(). % exported
--type protocol_version_tuple() :: tls_version_tuple() | dtls_version_tuple(). % exported
-type tls_version() :: 'tlsv1.2' | 'tlsv1.3' | tls_legacy_version().
--type tls_version_tuple() :: {3,0} | {3,1} | {3,2} | {3,3} | {3,4}.
-type dtls_version() :: 'dtlsv1.2' | dtls_legacy_version().
--type dtls_version_tuple() :: {254,254} | {254,253}.
-type tls_legacy_version() :: tlsv1 | 'tlsv1.1' | sslv3.
-type dtls_legacy_version() :: 'dtlsv1'.
-type verify_type() :: verify_none | verify_peer.
@@ -1083,27 +1079,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(),