From e9a2612bb3b40e85b571f2b6b6962229b02434c2 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Wed, 9 May 2012 09:43:56 +0200 Subject: 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. --- lib/ssl/src/ssl_connection.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/ssl') 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) -> -- cgit v1.2.3