diff options
author | Erlang/OTP <[email protected]> | 2019-07-09 09:52:15 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2019-07-09 09:52:15 +0200 |
commit | 92ee8b449b9dd1003d0779566a03234f5b3d8b82 (patch) | |
tree | fc6ca08db7dc391fc875607d5479669afe8c92c9 /lib | |
parent | 861aaf5ae85c9992329b0dbb726c46696ee22fff (diff) | |
parent | ab61a13a824339d69a4e3955a21be12cb804d960 (diff) | |
download | otp-92ee8b449b9dd1003d0779566a03234f5b3d8b82.tar.gz otp-92ee8b449b9dd1003d0779566a03234f5b3d8b82.tar.bz2 otp-92ee8b449b9dd1003d0779566a03234f5b3d8b82.zip |
Merge branch 'ingela/ssl/alert-error-enhancment/OTP-15943' into maint-22
* ingela/ssl/alert-error-enhancment/OTP-15943:
ssl: Enhance error handling
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ssl/src/tls_connection.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl index 24bc508a10..f317cb169e 100644 --- a/lib/ssl/src/tls_connection.erl +++ b/lib/ssl/src/tls_connection.erl @@ -335,7 +335,9 @@ handle_protocol_record(#ssl_tls{type = ?ALERT, fragment = EncAlerts}, StateName, handle_alerts(Alerts, {next_state, StateName, State}); [] -> ssl_connection:handle_own_alert(?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE, empty_alert), - Version, StateName, State) + Version, StateName, State); + #alert{} = Alert -> + ssl_connection:handle_own_alert(Alert, Version, StateName, State) catch _:_ -> ssl_connection:handle_own_alert(?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE, alert_decode_error), @@ -1162,7 +1164,6 @@ encode_handshake(Handshake, Version, ConnectionStates0, Hist0) -> encode_change_cipher(#change_cipher_spec{}, Version, ConnectionStates) -> tls_record:encode_change_cipher_spec(Version, ConnectionStates). --spec decode_alerts(binary()) -> list(). decode_alerts(Bin) -> ssl_alert:decode(Bin). |