mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-21 22:46:54 +02:00
Add PSK to h as well.
This commit is contained in:
parent
5fbaf28c12
commit
ccb5ff8e6d
1 changed files with 3 additions and 1 deletions
|
@ -948,7 +948,7 @@ impl<Application: ApplicationLayer> Context<Application> {
|
|||
assert!(metadata.len() <= (u16::MAX as usize));
|
||||
reply_len = append_to_slice(&mut reply_buffer, reply_len, &(metadata.len() as u16).to_le_bytes())?;
|
||||
|
||||
let noise_h_next = mix_hash(&noise_h_next, &reply_buffer[HEADER_SIZE..reply_len]);
|
||||
let noise_h_next = mix_hash(&mix_hash(&noise_h_next, &reply_buffer[HEADER_SIZE..reply_len]), session.psk.as_bytes());
|
||||
|
||||
enc_start = reply_len;
|
||||
reply_len = append_to_slice(&mut reply_buffer, reply_len, metadata)?;
|
||||
|
@ -1047,6 +1047,8 @@ impl<Application: ApplicationLayer> Context<Application> {
|
|||
}
|
||||
let (alice_noise_s, psk, application_data) = check_result.unwrap();
|
||||
|
||||
let noise_h_next = mix_hash(&noise_h_next, psk.as_bytes());
|
||||
|
||||
// Complete Noise_XKpsk3 on Bob's side.
|
||||
let noise_es_ee_se_hk_psk = Secret(hmac_sha512(
|
||||
&hmac_sha512(
|
||||
|
|
Loading…
Add table
Reference in a new issue