From 884503bc69157d2a3c6bd72389b4e2a800f97fb6 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Wed, 20 Mar 2019 10:38:43 +0100 Subject: ssl: Correct handling of crypto exception handling. Documentation was incorrect, and new specs provided dialyzer errors. --- lib/ssl/src/ssl_record.erl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/ssl/src/ssl_record.erl') diff --git a/lib/ssl/src/ssl_record.erl b/lib/ssl/src/ssl_record.erl index 91f1876980..669626aefb 100644 --- a/lib/ssl/src/ssl_record.erl +++ b/lib/ssl/src/ssl_record.erl @@ -395,12 +395,7 @@ decipher_aead(Type, #cipher_state{key = Key} = CipherState, AAD0, CipherFragment try Nonce = decrypt_nonce(Type, CipherState, CipherFragment), {AAD, CipherText, CipherTag} = aead_ciphertext_split(Type, CipherState, CipherFragment, AAD0), - case ssl_cipher:aead_decrypt(Type, Key, Nonce, CipherText, CipherTag, AAD) of - Content when is_binary(Content) -> - Content; - _ -> - ?ALERT_REC(?FATAL, ?BAD_RECORD_MAC, decryption_failed) - end + ssl_cipher:aead_decrypt(Type, Key, Nonce, CipherText, CipherTag, AAD) catch _:_ -> ?ALERT_REC(?FATAL, ?BAD_RECORD_MAC, decryption_failed) -- cgit v1.2.3