From ab98d9dcedf02553b8d3321cc876b066adb11dd6 Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Thu, 1 Aug 2019 11:12:30 +0200 Subject: Make unit tests pass --- src/handshake/peer.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/handshake/peer.rs') diff --git a/src/handshake/peer.rs b/src/handshake/peer.rs index 5b01d75..309a9cf 100644 --- a/src/handshake/peer.rs +++ b/src/handshake/peer.rs @@ -10,6 +10,7 @@ use x25519_dalek::StaticSecret; use super::device::Device; use super::timestamp; use super::types::*; +use super::macs; /* Represents the recomputation and state of a peer. * @@ -24,6 +25,9 @@ pub struct Peer { state: Mutex, timestamp: Mutex>, + // state related to DoS mitigation fields + pub(crate) macs: macs::Generator, + // constant state pub(crate) pk: PublicKey, // public key of peer pub(crate) ss: SharedSecret, // precomputed DH(static, static) @@ -69,6 +73,7 @@ where ss: SharedSecret, // precomputed DH(static, static) ) -> Self { Self { + macs: macs::Generator::new(pk), identifier: identifier, state: Mutex::new(State::Reset), timestamp: Mutex::new(None), -- cgit v1.2.3-59-g8ed1b