diff options
author | Péter Dimitrov <[email protected]> | 2018-11-21 11:03:12 +0100 |
---|---|---|
committer | Péter Dimitrov <[email protected]> | 2019-01-11 09:59:12 +0100 |
commit | 822d6817e7aeb2993ad50cec374fb23aa6f70c02 (patch) | |
tree | 8a81a1c0b88f7e669f4eaab710fd30c82f05c2f5 | |
parent | e72e7e0c978b9a07a9eca6d48ac9028d8b0fa9a5 (diff) | |
download | otp-822d6817e7aeb2993ad50cec374fb23aa6f70c02.tar.gz otp-822d6817e7aeb2993ad50cec374fb23aa6f70c02.tar.bz2 otp-822d6817e7aeb2993ad50cec374fb23aa6f70c02.zip |
ssl: Update HKDF-Expand-Label function
Change-Id: I08dbfb38b198ef24798a85d8bcf498d697123fad
-rw-r--r-- | lib/ssl/src/tls_v1.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ssl/src/tls_v1.erl b/lib/ssl/src/tls_v1.erl index 83dd7585dd..6bb001d814 100644 --- a/lib/ssl/src/tls_v1.erl +++ b/lib/ssl/src/tls_v1.erl @@ -71,11 +71,14 @@ hkdf_expand_label(Secret, Label0, Context, Length, Algo) -> %% opaque label<7..255> = "tls13 " + Label; %% opaque context<0..255> = Context; %% } HkdfLabel; - Content = << <<"tls13">>/binary, Label0/binary, Context/binary>>, + Label1 = << <<"tls13 ">>/binary, Label0/binary>>, + LLen = size(Label1), + Label = <<?BYTE(LLen), Label1>>, + Content = <<Label/binary, Context/binary>>, Len = size(Content), HkdfLabel = <<?UINT16(Len), Content/binary>>, hkdf_expand(Secret, HkdfLabel, Length, Algo). - + -spec hkdf_extract(MacAlg::ssl_cipher_format:hash(), Salt::binary(), KeyingMaterial::binary()) -> PseudoRandKey::binary(). |