aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2018-10-23 09:21:18 +0200
committerIngela Anderton Andin <[email protected]>2018-10-23 09:24:58 +0200
commitcf7d1cfdb2215bf8b35bc277d06154f83f069e47 (patch)
tree56834afa6f99d84c8ba8d350429eb245cfe575fa
parent57e9c998574695433fa21f8c42e2bccba77448ef (diff)
downloadotp-cf7d1cfdb2215bf8b35bc277d06154f83f069e47.tar.gz
otp-cf7d1cfdb2215bf8b35bc277d06154f83f069e47.tar.bz2
otp-cf7d1cfdb2215bf8b35bc277d06154f83f069e47.zip
ssl: Correct length to be used in additional data in CHACHA20_POLY1305 cipher
-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,