aboutsummaryrefslogtreecommitdiffstats
path: root/src/handshake/peer.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-09-22 21:35:06 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-09-22 21:35:06 +0200
commit794933d6ddda5f45c240b66998b636bdfc484098 (patch)
tree05fcb5f0e192e37f62571e9bbd3bda2e1376f848 /src/handshake/peer.rs
parentAdded zero_key to peer (diff)
downloadwireguard-rs-794933d6ddda5f45c240b66998b636bdfc484098.tar.xz
wireguard-rs-794933d6ddda5f45c240b66998b636bdfc484098.zip
Work on peer timers
Diffstat (limited to 'src/handshake/peer.rs')
-rw-r--r--src/handshake/peer.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/handshake/peer.rs b/src/handshake/peer.rs
index 6a85cee..c9e1c40 100644
--- a/src/handshake/peer.rs
+++ b/src/handshake/peer.rs
@@ -1,4 +1,3 @@
-use lazy_static::lazy_static;
use spin::Mutex;
use std::mem;
@@ -18,9 +17,7 @@ use super::macs;
use super::timestamp;
use super::types::*;
-lazy_static! {
- pub static ref TIME_BETWEEN_INITIATIONS: Duration = Duration::from_millis(20);
-}
+const TIME_BETWEEN_INITIATIONS: Duration = Duration::from_millis(20);
/* Represents the recomputation and state of a peer.
*
@@ -123,7 +120,7 @@ impl Peer {
// check flood attack
match *last_initiation_consumption {
Some(last) => {
- if last.elapsed() < *TIME_BETWEEN_INITIATIONS {
+ if last.elapsed() < TIME_BETWEEN_INITIATIONS {
return Err(HandshakeError::InitiationFlood);
}
}