aboutsummaryrefslogtreecommitdiffstats
path: root/src/handshake/types.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-05 21:37:31 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-05 21:37:31 +0200
commitabc8cacf44247597aa76213770ff49e0505a19b7 (patch)
treec0509b8a6babe099f3bd8fdc579746c7a58f999f /src/handshake/types.rs
parentValidate mac2 field (diff)
downloadwireguard-rs-abc8cacf44247597aa76213770ff49e0505a19b7.tar.xz
wireguard-rs-abc8cacf44247597aa76213770ff49e0505a19b7.zip
Checking of mac2 fields on initiation & response
In addition, moved the rng out. This will allow allocating one instance per worker, rather than every call.
Diffstat (limited to '')
-rw-r--r--src/handshake/types.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/handshake/types.rs b/src/handshake/types.rs
index 38b044e..08c43d0 100644
--- a/src/handshake/types.rs
+++ b/src/handshake/types.rs
@@ -43,7 +43,6 @@ pub enum HandshakeError {
OldTimestamp,
InvalidState,
InvalidMac1,
- InvalidMac2
}
impl fmt::Display for HandshakeError {
@@ -58,7 +57,6 @@ 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::InvalidMac2 => write!(f, "Message has invalid mac2 field"),
}
}
}
@@ -74,8 +72,7 @@ impl Error for HandshakeError {
}
pub type Output<T> = (
- T, // external identifier associated with peer
- // (e.g. a reference or vector index)
+ Option<T>, // external identifier associated with peer
Option<Vec<u8>>, // message to send
Option<KeyPair>, // resulting key-pair of successful handshake
);