aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2017-12-20 12:24:10 +0100
committerIngela Anderton Andin <[email protected]>2017-12-20 12:24:10 +0100
commit97df070c819ac1a6781e542e891c3419b56c59df (patch)
tree5a56c5962955c6ef1d94ff76a49ca371eb4a3130
parent04233733012408b75754ff4de2742e97d41b25af (diff)
parent8af2f67e15af0aba9555e9d1d00add894eeaa17e (diff)
downloadotp-97df070c819ac1a6781e542e891c3419b56c59df.tar.gz
otp-97df070c819ac1a6781e542e891c3419b56c59df.tar.bz2
otp-97df070c819ac1a6781e542e891c3419b56c59df.zip
Merge branch 'ingela/ssl/dtls-progress' into maint
* ingela/ssl/dtls-progress: dtls: Add handling of lost key exchange in cipher state ssl: Correct DTLS client close handling
-rw-r--r--lib/ssl/src/dtls_connection.erl18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/ssl/src/dtls_connection.erl b/lib/ssl/src/dtls_connection.erl
index 55091c0219..9cb6934dce 100644
--- a/lib/ssl/src/dtls_connection.erl
+++ b/lib/ssl/src/dtls_connection.erl
@@ -143,10 +143,16 @@ next_record(#state{role = server,
dtls_udp_listener:active_once(Listener, Client, self()),
{no_record, State};
next_record(#state{role = client,
- socket = {_Server, Socket},
+ socket = {_Server, Socket} = DTLSSocket,
+ close_tag = CloseTag,
transport_cb = Transport} = State) ->
- dtls_socket:setopts(Transport, Socket, [{active,once}]),
- {no_record, State};
+ case dtls_socket:setopts(Transport, Socket, [{active,once}]) of
+ ok ->
+ {no_record, State};
+ _ ->
+ self() ! {CloseTag, DTLSSocket},
+ {no_record, State}
+ end;
next_record(State) ->
{no_record, State}.
@@ -604,6 +610,12 @@ certify(info, Event, State) ->
gen_info(Event, ?FUNCTION_NAME, State);
certify(internal = Type, #server_hello_done{} = Event, State) ->
ssl_connection:certify(Type, Event, prepare_flight(State), ?MODULE);
+certify(internal, #change_cipher_spec{type = <<1>>}, State0) ->
+ {State1, Actions0} = send_handshake_flight(State0, retransmit_epoch(?FUNCTION_NAME, State0)),
+ {Record, State2} = next_record(State1),
+ {next_state, ?FUNCTION_NAME, State, Actions} = next_event(?FUNCTION_NAME, Record, State2, Actions0),
+ %% This will reset the retransmission timer by repeating the enter state event
+ {repeat_state, State, Actions};
certify(state_timeout, Event, State) ->
handle_state_timeout(Event, ?FUNCTION_NAME, State);
certify(Type, Event, State) ->