diff options
author | Dan Gudmundsson <dgud@erlang.org> | 2023-04-27 16:13:48 +0200 |
---|---|---|
committer | Dan Gudmundsson <dgud@erlang.org> | 2023-04-27 16:13:48 +0200 |
commit | c9c715863d195559995b311b941678f7a470c4c9 (patch) | |
tree | a40fd5d9ddf1a42d3c1175e98df7792fca96cab2 | |
parent | f2ab097a09390cda3307c9545ff287d41279d1e7 (diff) | |
download | erlang-c9c715863d195559995b311b941678f7a470c4c9.tar.gz |
ssl: Fix that users can send data during renegotiation
A timing issue was found during testing of the previous commit.
Users should be allowed to send data during the renegotiation.
-rw-r--r-- | lib/ssl/src/dtls_connection.erl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/ssl/src/dtls_connection.erl b/lib/ssl/src/dtls_connection.erl index a37a72efdc..899e7d3305 100644 --- a/lib/ssl/src/dtls_connection.erl +++ b/lib/ssl/src/dtls_connection.erl @@ -479,10 +479,7 @@ wait_cert_verify(info, Event, State) -> wait_cert_verify(state_timeout, Event, State) -> handle_state_timeout(Event, ?FUNCTION_NAME, State); wait_cert_verify(Type, Event, State) -> - try tls_dtls_connection:gen_handshake(?FUNCTION_NAME, Type, Event, State) - catch throw:#alert{} = Alert -> - ssl_gen_statem:handle_own_alert(Alert, ?FUNCTION_NAME, State) - end. + gen_handshake(?FUNCTION_NAME, Type, Event, State). %%-------------------------------------------------------------------- -spec cipher(gen_statem:event_type(), term(), #state{}) -> @@ -506,7 +503,7 @@ cipher(internal = Type, #finished{} = Event, #state{connection_states = Connecti cipher(state_timeout, Event, State) -> handle_state_timeout(Event, ?FUNCTION_NAME, State); cipher(Type, Event, State) -> - gen_handshake(?FUNCTION_NAME, Type, Event, State). + gen_handshake(?FUNCTION_NAME, Type, Event, State). %%-------------------------------------------------------------------- -spec connection(gen_statem:event_type(), @@ -761,6 +758,8 @@ alert_or_reset_connection(Alert, StateName, #state{connection_states = Cs} = Sta {next_state, connection, NewState} end. +gen_handshake(_, {call, _From}, {application_data, _Data}, _State) -> + {keep_state_and_data, [postpone]}; gen_handshake(StateName, Type, Event, State) -> try tls_dtls_connection:StateName(Type, Event, State) catch |