diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2020-03-29 22:56:57 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2020-03-29 23:07:00 +0200 |
commit | ded348d58656a6a3794181d6d010d5c4fb373944 (patch) | |
tree | 7dd77cf85f0d0a2402c475bbea6b8f011c563987 /src/wireguard/handshake/types.rs | |
parent | Restructuring and dependency version bump. (diff) | |
download | wireguard-rs-ded348d58656a6a3794181d6d010d5c4fb373944.tar.xz wireguard-rs-ded348d58656a6a3794181d6d010d5c4fb373944.zip |
Added checks for zero shared-secret
To mirror the behavior from the kernel module,
as per private correspondence with Jason.
Diffstat (limited to '')
-rw-r--r-- | src/wireguard/handshake/types.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wireguard/handshake/types.rs b/src/wireguard/handshake/types.rs index ed2fcbb..ea827b0 100644 --- a/src/wireguard/handshake/types.rs +++ b/src/wireguard/handshake/types.rs @@ -40,6 +40,7 @@ pub enum HandshakeError { UnknownPublicKey, UnknownReceiverId, InvalidMessageFormat, + InvalidSharedSecret, OldTimestamp, InvalidState, InvalidMac1, @@ -50,6 +51,7 @@ pub enum HandshakeError { impl fmt::Display for HandshakeError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { + HandshakeError::InvalidSharedSecret => write!(f, "Zero shared secret"), HandshakeError::DecryptionFailure => write!(f, "Failed to AEAD:OPEN"), HandshakeError::UnknownPublicKey => write!(f, "Unknown public key"), HandshakeError::UnknownReceiverId => { |