aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2018-03-05 10:41:57 +0100
committerIngela Anderton Andin <[email protected]>2018-03-05 10:41:57 +0100
commitfc0f3a42827003ecbe71f29d279004c606636408 (patch)
tree514ecad107f73dcc6b17347512dba64406f4d370 /lib
parentb9cc6b6aaeb5cd00026824a3d83ca797051fd61d (diff)
parent48ac9a112097cc3d42c399112c608fcf69dc2558 (diff)
downloadotp-fc0f3a42827003ecbe71f29d279004c606636408.tar.gz
otp-fc0f3a42827003ecbe71f29d279004c606636408.tar.bz2
otp-fc0f3a42827003ecbe71f29d279004c606636408.zip
Merge branch 'maint'
Diffstat (limited to 'lib')
-rw-r--r--lib/ssl/src/ssl_cipher.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl
index 1d645e5782..a83ce42455 100644
--- a/lib/ssl/src/ssl_cipher.erl
+++ b/lib/ssl/src/ssl_cipher.erl
@@ -96,7 +96,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)}.
@@ -2531,6 +2531,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"
@@ -2561,6 +2566,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) ->