aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2018-10-23 09:26:50 +0200
committerIngela Anderton Andin <[email protected]>2018-10-23 09:26:50 +0200
commit639bb57cf7d6550a48608dc827a6fd3aed1af005 (patch)
treeb9ec2d9869c1f715eeb1be187f4fb94a386030ad /lib
parent18aabe65117a7c2f9ca55bcbbfaa8847af9486ed (diff)
parentcf7d1cfdb2215bf8b35bc277d06154f83f069e47 (diff)
downloadotp-639bb57cf7d6550a48608dc827a6fd3aed1af005.tar.gz
otp-639bb57cf7d6550a48608dc827a6fd3aed1af005.tar.bz2
otp-639bb57cf7d6550a48608dc827a6fd3aed1af005.zip
Merge branch 'ingela/ssl/use-correct-len-aead' into maint
* ingela/ssl/use-correct-len-aead: ssl: Correct length to be used in additional data in CHACHA20_POLY1305 cipher
Diffstat (limited to 'lib')
-rw-r--r--lib/ssl/src/ssl_record.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_record.erl b/lib/ssl/src/ssl_record.erl
index d31e429283..b9d1320ef3 100644
--- a/lib/ssl/src/ssl_record.erl
+++ b/lib/ssl/src/ssl_record.erl
@@ -452,7 +452,7 @@ decrypt_nonce(?AES_GCM, #cipher_state{iv = <<Salt:4/bytes, _/binary>>}, <<Explic
aead_ciphertext_split(?CHACHA20_POLY1305, #cipher_state{tag_len = Len}, CipherTextFragment, AAD) ->
CipherLen = size(CipherTextFragment) - Len,
<<CipherText:CipherLen/bytes, CipherTag:Len/bytes>> = CipherTextFragment,
- {end_additional_data(AAD, Len), CipherText, CipherTag};
+ {end_additional_data(AAD, CipherLen), CipherText, CipherTag};
aead_ciphertext_split(?AES_GCM, #cipher_state{tag_len = Len}, CipherTextFragment, AAD) ->
CipherLen = size(CipherTextFragment) - (Len + 8), %% 8 is length of explicit Nonce
<< _:8/bytes, CipherText:CipherLen/bytes, CipherTag:Len/bytes>> = CipherTextFragment,