aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/tls_sender.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2018-12-18 12:30:46 +0100
committerIngela Anderton Andin <[email protected]>2018-12-19 12:32:00 +0100
commita10200ce143a32c7c15e804e9f401a0904bb49ef (patch)
tree8ff9ee92612052cb6bf0419d32057d8171a21f3f /lib/ssl/src/tls_sender.erl
parent2d683624bc38ef39ad175477d12fa1cd32aeaf82 (diff)
downloadotp-a10200ce143a32c7c15e804e9f401a0904bb49ef.tar.gz
otp-a10200ce143a32c7c15e804e9f401a0904bb49ef.tar.bz2
otp-a10200ce143a32c7c15e804e9f401a0904bb49ef.zip
ssl: Fix renegotiation with new TLS sender
Wtite connection state was not synchronized when peer initiated renegotiation
Diffstat (limited to 'lib/ssl/src/tls_sender.erl')
-rw-r--r--lib/ssl/src/tls_sender.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/ssl/src/tls_sender.erl b/lib/ssl/src/tls_sender.erl
index 7520832f39..11fcc6def0 100644
--- a/lib/ssl/src/tls_sender.erl
+++ b/lib/ssl/src/tls_sender.erl
@@ -29,7 +29,7 @@
%% API
-export([start/0, start/1, initialize/2, send_data/2, send_alert/2,
- send_and_ack_alert/2, setopts/2, renegotiate/1, downgrade/2,
+ send_and_ack_alert/2, setopts/2, renegotiate/1, peer_renegotiate/1, downgrade/2,
update_connection_state/3, dist_tls_socket/1, dist_handshake_complete/3]).
%% gen_statem callbacks
@@ -118,6 +118,15 @@ setopts(Pid, Opts) ->
renegotiate(Pid) ->
%% Needs error handling for external API
call(Pid, renegotiate).
+
+%%--------------------------------------------------------------------
+-spec peer_renegotiate(pid()) -> {ok, WriteState::map()} | {error, term()}.
+%% Description: So TLS connection process can synchronize the
+%% encryption state to be used when handshaking.
+%%--------------------------------------------------------------------
+peer_renegotiate(Pid) ->
+ gen_statem:call(Pid, renegotiate, ?DEFAULT_TIMEOUT).
+
%%--------------------------------------------------------------------
-spec update_connection_state(pid(), WriteState::map(), tls_record:tls_version()) -> ok.
%% Description: So TLS connection process can synchronize the