diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-07-22 23:40:04 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-07-22 23:40:04 +0200 |
commit | c77697b8edb529834bc5f57fe3bdb35cbbe3e809 (patch) | |
tree | 63e998e9ea488c5e1b1cce2b1da99a91997d3953 /src/types.rs | |
parent | Begin creation of response (diff) | |
download | wireguard-rs-c77697b8edb529834bc5f57fe3bdb35cbbe3e809.tar.xz wireguard-rs-c77697b8edb529834bc5f57fe3bdb35cbbe3e809.zip |
Finish handshake exchange
Diffstat (limited to '')
-rw-r--r-- | src/types.rs | 10 |
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") } } } |