diff options
author | Péter Dimitrov <[email protected]> | 2018-11-07 09:51:01 +0100 |
---|---|---|
committer | Péter Dimitrov <[email protected]> | 2018-11-16 14:32:14 +0100 |
commit | 9284bc84039794cb732c8fe593b129b4623d79c7 (patch) | |
tree | eec7523c21dffdd543ba0afbf886710a0a2d01aa /lib/ssl/src/tls_record.erl | |
parent | 7b4d38c6cc95df1301945cd0e63fdf927189e2c1 (diff) | |
download | otp-9284bc84039794cb732c8fe593b129b4623d79c7.tar.gz otp-9284bc84039794cb732c8fe593b129b4623d79c7.tar.bz2 otp-9284bc84039794cb732c8fe593b129b4623d79c7.zip |
ssl: Fix encode/decode of ClientHello (TLS 1.3)
- Fix handling of hello versions. TLS 1.3 ClientHello will use
TLS 1.3 encoding.
- Fix encoding/decoding of TLS records when record protection
has not yet been engaged (NULL cipher).
Change-Id: I7511d1a7751f1ec8c2f2f2fb3d21ddf80a3f428b
Diffstat (limited to 'lib/ssl/src/tls_record.erl')
-rw-r--r-- | lib/ssl/src/tls_record.erl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ssl/src/tls_record.erl b/lib/ssl/src/tls_record.erl index 7debac7d37..50fad2e680 100644 --- a/lib/ssl/src/tls_record.erl +++ b/lib/ssl/src/tls_record.erl @@ -47,7 +47,7 @@ -export([protocol_version/1, lowest_protocol_version/1, lowest_protocol_version/2, highest_protocol_version/1, highest_protocol_version/2, is_higher/2, supported_protocol_versions/0, - is_acceptable_version/1, is_acceptable_version/2, hello_version/2]). + is_acceptable_version/1, is_acceptable_version/2, hello_version/1]). -export_type([tls_version/0, tls_atom_version/0]). @@ -386,10 +386,10 @@ is_acceptable_version({N,_} = Version, Versions) is_acceptable_version(_,_) -> false. --spec hello_version(tls_version(), [tls_version()]) -> tls_version(). -hello_version(Version, _) when Version >= {3, 3} -> - Version; -hello_version(_, Versions) -> +-spec hello_version([tls_version()]) -> tls_version(). +hello_version([Highest|_]) when Highest >= {3,3} -> + Highest; +hello_version(Versions) -> lowest_protocol_version(Versions). %%-------------------------------------------------------------------- |