aboutsummaryrefslogtreecommitdiffstats
path: root/src/handshake/types.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-07 11:29:39 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-07 11:29:39 +0200
commitf7f10881235e3b9b0c272772a0f4c646f987a8d3 (patch)
tree1fb3c1641dce2315d9f18c2cb8af67ce062c3623 /src/handshake/types.rs
parentAdd rate limiter check to handshake messages. (diff)
downloadwireguard-rs-f7f10881235e3b9b0c272772a0f4c646f987a8d3.tar.xz
wireguard-rs-f7f10881235e3b9b0c272772a0f4c646f987a8d3.zip
Added initiation flood protection
Diffstat (limited to 'src/handshake/types.rs')
-rw-r--r--src/handshake/types.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/handshake/types.rs b/src/handshake/types.rs
index 967704e..7b190ec 100644
--- a/src/handshake/types.rs
+++ b/src/handshake/types.rs
@@ -43,7 +43,8 @@ pub enum HandshakeError {
OldTimestamp,
InvalidState,
InvalidMac1,
- RateLimited
+ RateLimited,
+ InitiationFlood,
}
impl fmt::Display for HandshakeError {
@@ -58,7 +59,10 @@ impl fmt::Display for HandshakeError {
HandshakeError::OldTimestamp => write!(f, "Timestamp is less/equal to the newest"),
HandshakeError::InvalidState => write!(f, "Message does not apply to handshake state"),
HandshakeError::InvalidMac1 => write!(f, "Message has invalid mac1 field"),
- HandshakeError::RateLimited => write!(f, "Message was dropped by rate limiter")
+ HandshakeError::RateLimited => write!(f, "Message was dropped by rate limiter"),
+ HandshakeError::InitiationFlood => {
+ write!(f, "Message was dropped because of initiation flood")
+ }
}
}
}