diff options
author | Ingela Anderton Andin <[email protected]> | 2014-06-12 10:37:53 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2014-06-12 10:37:53 +0200 |
commit | 0ce0df2b41c47735ec342853b305041394423633 (patch) | |
tree | bd799563b6283034239ae439df43de299a7df961 /lib/ssl/src/tls_connection.erl | |
parent | 7274a9db9b17cc14fde15a3aa0574136c58e8551 (diff) | |
parent | d73bce518926026de6b74ffa41225b9d53dfb872 (diff) | |
download | otp-0ce0df2b41c47735ec342853b305041394423633.tar.gz otp-0ce0df2b41c47735ec342853b305041394423633.tar.bz2 otp-0ce0df2b41c47735ec342853b305041394423633.zip |
Merge branch 'ia/ssl/CSS/OTP-11975' into maint
* ia/ssl/CSS/OTP-11975:
ssl: Make sure change cipher spec is correctly handled
Diffstat (limited to 'lib/ssl/src/tls_connection.erl')
-rw-r--r-- | lib/ssl/src/tls_connection.erl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl index 2ab085321a..26de51985a 100644 --- a/lib/ssl/src/tls_connection.erl +++ b/lib/ssl/src/tls_connection.erl @@ -444,12 +444,16 @@ next_state(_, StateName, #ssl_tls{type = ?APPLICATION_DATA, fragment = Data}, St next_state(StateName, StateName, Record, State) end; next_state(Current, Next, #ssl_tls{type = ?CHANGE_CIPHER_SPEC, fragment = <<1>>} = - _ChangeCipher, - #state{connection_states = ConnectionStates0} = State0) -> + _ChangeCipher, + #state{connection_states = ConnectionStates0} = State0) + when Next == cipher; Next == abbreviated -> ConnectionStates1 = ssl_record:activate_pending_connection_state(ConnectionStates0, read), {Record, State} = next_record(State0#state{connection_states = ConnectionStates1}), - next_state(Current, Next, Record, State); + next_state(Current, Next, Record, State#state{expecting_finished = true}); +next_state(Current, _Next, #ssl_tls{type = ?CHANGE_CIPHER_SPEC, fragment = <<1>>} = + _ChangeCipher, #state{negotiated_version = Version} = State) -> + handle_own_alert(?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE), Version, Current, State); next_state(Current, Next, #ssl_tls{type = _Unknown}, State0) -> %% Ignore unknown type {Record, State} = next_record(State0), |