aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/tls_connection.erl
diff options
context:
space:
mode:
authorPéter Dimitrov <[email protected]>2018-11-07 09:51:01 +0100
committerPéter Dimitrov <[email protected]>2018-11-16 14:32:14 +0100
commit9284bc84039794cb732c8fe593b129b4623d79c7 (patch)
treeeec7523c21dffdd543ba0afbf886710a0a2d01aa /lib/ssl/src/tls_connection.erl
parent7b4d38c6cc95df1301945cd0e63fdf927189e2c1 (diff)
downloadotp-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_connection.erl')
-rw-r--r--lib/ssl/src/tls_connection.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl
index 5de1424414..9f98572691 100644
--- a/lib/ssl/src/tls_connection.erl
+++ b/lib/ssl/src/tls_connection.erl
@@ -502,9 +502,8 @@ init({call, From}, {start, Timeout},
Timer = ssl_connection:start_or_recv_cancel_timer(Timeout, From),
Hello = tls_handshake:client_hello(Host, Port, ConnectionStates0, SslOpts,
Cache, CacheCb, Renegotiation, Cert, KeyShare),
-
- Version = Hello#client_hello.client_version,
- HelloVersion = tls_record:hello_version(Version, SslOpts#ssl_options.versions),
+
+ HelloVersion = tls_record:hello_version(SslOpts#ssl_options.versions),
Handshake0 = ssl_handshake:init_handshake_history(),
{BinMsg, ConnectionStates, Handshake} =
encode_handshake(Hello, HelloVersion, ConnectionStates0, Handshake0),
@@ -518,7 +517,7 @@ init({call, From}, {start, Timeout},
ssl_logger:debug(SslOpts#ssl_options.log_level, HelloMsg, #{domain => [otp,ssl,handshake]}),
ssl_logger:debug(SslOpts#ssl_options.log_level, Report, #{domain => [otp,ssl,tls_record]}),
State1 = State0#state{connection_states = ConnectionStates,
- negotiated_version = Version, %% Requested version
+ negotiated_version = HelloVersion, %% Requested version
session =
Session0#session{session_id = Hello#client_hello.session_id},
tls_handshake_history = Handshake,