diff options
Diffstat (limited to 'src/handshake/peer.rs')
-rw-r--r-- | src/handshake/peer.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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<T> { state: Mutex<State>, timestamp: Mutex<Option<timestamp::TAI64N>>, + // 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), |