aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/tls_handshake_1_3.erl
diff options
context:
space:
mode:
authorPéter Dimitrov <[email protected]>2019-01-15 18:29:48 +0100
committerPéter Dimitrov <[email protected]>2019-01-28 09:37:07 +0100
commita0d770fb9979c295fd0b9f69c9c558e3b8250072 (patch)
treedb83fe2e3eab50842dc62e58bb4c975761aa6c78 /lib/ssl/src/tls_handshake_1_3.erl
parent9cdc4cb22a4465709e347c07f240fd6e3a74b490 (diff)
downloadotp-a0d770fb9979c295fd0b9f69c9c558e3b8250072.tar.gz
otp-a0d770fb9979c295fd0b9f69c9c558e3b8250072.tar.bz2
otp-a0d770fb9979c295fd0b9f69c9c558e3b8250072.zip
ssl: Fix key schedule and traffic keys
Fix key schedule and traffic key calculation. Add test for the server side calculation of shared secrets and traffic keys. Change-Id: Ia955e5e8787f3851bdb3170723e6586bdf4548ca
Diffstat (limited to 'lib/ssl/src/tls_handshake_1_3.erl')
-rw-r--r--lib/ssl/src/tls_handshake_1_3.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ssl/src/tls_handshake_1_3.erl b/lib/ssl/src/tls_handshake_1_3.erl
index e04242410e..25d495ed3f 100644
--- a/lib/ssl/src/tls_handshake_1_3.erl
+++ b/lib/ssl/src/tls_handshake_1_3.erl
@@ -476,7 +476,8 @@ calculate_security_parameters(ClientKey, SelectedGroup, KeyShare,
cipher_suite = CipherSuite} = SecParamsR,
%% Calculate handshake_secret
- EarlySecret = tls_v1:key_schedule(early_secret, HKDFAlgo , {psk, <<>>}),
+ PSK = binary:copy(<<0>>, ssl_cipher:hash_size(HKDFAlgo)),
+ EarlySecret = tls_v1:key_schedule(early_secret, HKDFAlgo , {psk, PSK}),
PrivateKey = get_server_private_key(KeyShare), %% #'ECPrivateKey'{}
IKM = calculate_shared_secret(ClientKey, PrivateKey, SelectedGroup),