aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-05-09 09:43:56 +0200
committerIngela Anderton Andin <[email protected]>2012-06-08 16:52:05 +0200
commite9a2612bb3b40e85b571f2b6b6962229b02434c2 (patch)
tree9e6b022569d43d326eb33eb60d39cd15c1ebc7d6
parent35ffd19df295f5ff73f9968b65dc8ad957c943e5 (diff)
downloadotp-e9a2612bb3b40e85b571f2b6b6962229b02434c2.tar.gz
otp-e9a2612bb3b40e85b571f2b6b6962229b02434c2.tar.bz2
otp-e9a2612bb3b40e85b571f2b6b6962229b02434c2.zip
ssl: Renegotiate updates session id in gen_fsm state
The session id keept in the connection processes state must be updated to be the id selected by ssl_handshake:client_hello, failing to do so will cause a crash if the session is not reused.
-rw-r--r--lib/ssl/src/ssl_connection.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index 431e6a3eaf..cadc7f4185 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -690,7 +690,7 @@ cipher(Msg, State) ->
%%--------------------------------------------------------------------
connection(#hello_request{}, #state{host = Host, port = Port,
socket = Socket,
- session = #session{own_certificate = Cert},
+ session = #session{own_certificate = Cert} = Session0,
session_cache = Cache, session_cache_cb = CacheCb,
ssl_options = SslOpts,
negotiated_version = Version,
@@ -706,6 +706,7 @@ connection(#hello_request{}, #state{host = Host, port = Port,
Transport:send(Socket, BinMsg),
{Record, State} = next_record(State0#state{connection_states =
ConnectionStates1,
+ session = Session0#session{session_id = Hello#client_hello.session_id},
tls_handshake_hashes = Hashes1}),
next_state(connection, hello, Record, State);
connection(#client_hello{} = Hello, #state{role = server, allow_renegotiate = true} = State) ->