Add rate limiter check to handshake messages.

This commit is contained in:
Mathias Hall-Andersen
2019-08-06 13:02:13 +02:00
parent 8f488882be
commit a12e6e139c
7 changed files with 194 additions and 8 deletions

View File

@@ -43,6 +43,7 @@ pub enum HandshakeError {
OldTimestamp,
InvalidState,
InvalidMac1,
RateLimited
}
impl fmt::Display for HandshakeError {
@@ -57,6 +58,7 @@ 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")
}
}
}