diff options
author | Ingela Anderton Andin <[email protected]> | 2019-01-03 09:06:21 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2019-01-14 18:04:17 +0100 |
commit | 15183f8e798e1fe5ac613f711df491d3bf4f2db7 (patch) | |
tree | be51736b9235210583fed27033be498e4dc285b9 /lib/ssl/src/ssl_connection.erl | |
parent | c71927bda9c2eb99bf40e6c799a90482b5674d4a (diff) | |
download | otp-15183f8e798e1fe5ac613f711df491d3bf4f2db7.tar.gz otp-15183f8e798e1fe5ac613f711df491d3bf4f2db7.tar.bz2 otp-15183f8e798e1fe5ac613f711df491d3bf4f2db7.zip |
ssl: Client shall only save verified sessions
Modernize test case option handling
Diffstat (limited to 'lib/ssl/src/ssl_connection.erl')
-rw-r--r-- | lib/ssl/src/ssl_connection.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index 36ab1740f0..0529194f82 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -1044,7 +1044,7 @@ cipher(internal, #finished{verify_data = Data} = Finished, get_current_prf(ConnectionStates0, read), MasterSecret, Handshake0) of verified -> - Session = register_session(Role, host_id(Role, Host, SslOpts), Port, Session0), + Session = handle_session(Role, SslOpts, Host, Port, Session0), cipher_role(Role, Data, Session, State#state{expecting_finished = false}, Connection); #alert{} = Alert -> @@ -2406,6 +2406,12 @@ session_handle_params(#server_ecdh_params{curve = ECCurve}, Session) -> session_handle_params(_, Session) -> Session. +handle_session(Role = server, SslOpts, Host, Port, Session0) -> + register_session(Role, host_id(Role, Host, SslOpts), Port, Session0); +handle_session(Role = client, #ssl_options{verify = verify_peer} = SslOpts, Host, Port, Session0) -> + register_session(Role, host_id(Role, Host, SslOpts), Port, Session0); +handle_session(client, _, _, _, Session0) -> + Session0. register_session(client, Host, Port, #session{is_resumable = new} = Session0) -> Session = Session0#session{is_resumable = true}, |