aboutsummaryrefslogtreecommitdiffstats
path: root/src/types.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-07-22 23:40:04 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-07-22 23:40:04 +0200
commitc77697b8edb529834bc5f57fe3bdb35cbbe3e809 (patch)
tree63e998e9ea488c5e1b1cce2b1da99a91997d3953 /src/types.rs
parentBegin creation of response (diff)
downloadwireguard-rs-c77697b8edb529834bc5f57fe3bdb35cbbe3e809.tar.xz
wireguard-rs-c77697b8edb529834bc5f57fe3bdb35cbbe3e809.zip
Finish handshake exchange
Diffstat (limited to '')
-rw-r--r--src/types.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/types.rs b/src/types.rs
index a2a7cdd..5500ffc 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -34,8 +34,10 @@ impl Error for ConfigError {
pub enum HandshakeError {
DecryptionFailure,
UnknownPublicKey,
+ UnknownReceiverId,
InvalidMessageFormat,
- OldTimestamp
+ OldTimestamp,
+ InvalidState
}
impl fmt::Display for HandshakeError {
@@ -45,10 +47,14 @@ impl fmt::Display for HandshakeError {
write!(f, "Failed to AEAD:OPEN"),
HandshakeError::UnknownPublicKey =>
write!(f, "Unknown public key"),
+ HandshakeError::UnknownReceiverId =>
+ write!(f, "Receiver id not allocated to any handshake"),
HandshakeError::InvalidMessageFormat =>
write!(f, "Invalid handshake message format"),
HandshakeError::OldTimestamp =>
- write!(f, "Timestamp is less/equal to the newest")
+ write!(f, "Timestamp is less/equal to the newest"),
+ HandshakeError::InvalidState =>
+ write!(f, "Message does not apply to handshake state")
}
}
}