aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/tls_connection_1_3.erl
diff options
context:
space:
mode:
authorPéter Dimitrov <[email protected]>2019-05-21 16:57:37 +0200
committerPéter Dimitrov <[email protected]>2019-05-22 16:36:17 +0200
commita4226b1fd9093a43902510b6e7b0e7af2406a23e (patch)
tree265a7250ad7720558aa231485256396d7841d281 /lib/ssl/src/tls_connection_1_3.erl
parent8c55d3f17a88a919df1a86430b59f6d8fe816fb8 (diff)
downloadotp-a4226b1fd9093a43902510b6e7b0e7af2406a23e.tar.gz
otp-a4226b1fd9093a43902510b6e7b0e7af2406a23e.tar.bz2
otp-a4226b1fd9093a43902510b6e7b0e7af2406a23e.zip
ssl: Implement hello_retry_request (client)
Diffstat (limited to 'lib/ssl/src/tls_connection_1_3.erl')
-rw-r--r--lib/ssl/src/tls_connection_1_3.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/ssl/src/tls_connection_1_3.erl b/lib/ssl/src/tls_connection_1_3.erl
index d1b004975c..821b7000cc 100644
--- a/lib/ssl/src/tls_connection_1_3.erl
+++ b/lib/ssl/src/tls_connection_1_3.erl
@@ -130,6 +130,13 @@ start(internal, #client_hello{} = Hello, State0, _Module) ->
{State, negotiated} ->
{next_state, negotiated, State, [{next_event, internal, start_handshake}]}
end;
+start(internal, #server_hello{} = ServerHello, State0, _Module) ->
+ case tls_handshake_1_3:do_start(ServerHello, State0) of
+ #alert{} = Alert ->
+ ssl_connection:handle_own_alert(Alert, {3,4}, start, State0);
+ {State, NextState} ->
+ {next_state, NextState, State, []}
+ end;
start(Type, Msg, State, Connection) ->
ssl_connection:handle_common_event(Type, Msg, ?FUNCTION_NAME, State, Connection).
@@ -194,9 +201,9 @@ wait_sh(internal, #server_hello{} = Hello, State0, _Module) ->
case tls_handshake_1_3:do_wait_sh(Hello, State0) of
#alert{} = Alert ->
ssl_connection:handle_own_alert(Alert, {3,4}, wait_sh, State0);
- {State1, start} ->
- %% TODO: Implement hello_retry_request
- {next_state, start, State1, []};
+ {State1, start, ServerHello} ->
+ %% hello_retry_request: go to start
+ {next_state, start, State1, [{next_event, internal, ServerHello}]};
{State1, wait_ee} ->
tls_connection:next_event(wait_ee, no_record, State1)
end;