diff options
author | Ingela Anderton Andin <[email protected]> | 2018-03-05 10:40:40 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2018-03-05 10:40:40 +0100 |
commit | 48ac9a112097cc3d42c399112c608fcf69dc2558 (patch) | |
tree | f93af5e89146130acd159f2a6d2ad88f3d97986b | |
parent | 075baa1d95f225b60b9d9d53592cdfaecf81c24f (diff) | |
parent | 174062a2d90e98fe15927b1483ee760e0ec02022 (diff) | |
download | otp-48ac9a112097cc3d42c399112c608fcf69dc2558.tar.gz otp-48ac9a112097cc3d42c399112c608fcf69dc2558.tar.bz2 otp-48ac9a112097cc3d42c399112c608fcf69dc2558.zip |
Merge branch 'ingela/ssl/AEAD-handling/ERL-568' into maint
* ingela/ssl/AEAD-handling/ERL-568:
ssl: Correct AEAD handling
-rw-r--r-- | lib/ssl/src/ssl_cipher.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl index c6927bd276..62a172ca7c 100644 --- a/lib/ssl/src/ssl_cipher.erl +++ b/lib/ssl/src/ssl_cipher.erl @@ -95,7 +95,7 @@ security_parameters(Version, CipherSuite, SecParams) -> expanded_key_material_length = expanded_key_material(Cipher), key_material_length = key_material(Cipher), iv_size = iv_size(Cipher), - mac_algorithm = hash_algorithm(Hash), + mac_algorithm = mac_algorithm(Hash), prf_algorithm = prf_algorithm(PrfHashAlg, Version), hash_size = hash_size(Hash)}. @@ -2334,6 +2334,11 @@ prf_algorithm(default_prf, {3, _}) -> prf_algorithm(Algo, _) -> hash_algorithm(Algo). +mac_algorithm(aead) -> + aead; +mac_algorithm(Algo) -> + hash_algorithm(Algo). + hash_algorithm(null) -> ?NULL; hash_algorithm(md5) -> ?MD5; hash_algorithm(sha) -> ?SHA; %% Only sha always refers to "SHA-1" @@ -2364,6 +2369,10 @@ sign_algorithm(Other) when is_integer(Other) andalso ((Other >= 224) and (Other hash_size(null) -> 0; +%% The AEAD MAC hash size is not used in the context +%% of calculating the master secret. See RFC 5246 Section 6.2.3.3. +hash_size(aead) -> + 0; hash_size(md5) -> 16; hash_size(sha) -> |