diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-07-18 13:20:03 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-07-18 13:20:03 +0200 |
commit | 14e9647afdf6e22a64c173fb6e92dde91a9108eb (patch) | |
tree | e77af044c1094ce9c937da285292f7605195e542 /src/types.rs | |
parent | Better seperation and introduction of timestamp (diff) | |
download | wireguard-rs-14e9647afdf6e22a64c173fb6e92dde91a9108eb.tar.xz wireguard-rs-14e9647afdf6e22a64c173fb6e92dde91a9108eb.zip |
Begin processing of initation
Diffstat (limited to '')
-rw-r--r-- | src/types.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/types.rs b/src/types.rs index 81c1dc7..464ad81 100644 --- a/src/types.rs +++ b/src/types.rs @@ -36,12 +36,11 @@ impl Error for ConfigError { // handshake error #[derive(Debug)] -pub struct HandshakeError {} - -impl HandshakeError { - pub fn new() -> Self { - HandshakeError{} - } +pub enum HandshakeError { + DecryptionFailure, + UnknownPublicKey, + InvalidMessageFormat, + OldTimestamp } impl fmt::Display for HandshakeError { @@ -74,8 +73,8 @@ pub struct KeyPair { } pub struct Output ( - Option<KeyPair>, // resulting key-pair of successful handshake - Option<Vec<u8>> // message to send + pub Option<KeyPair>, // resulting key-pair of successful handshake + pub Option<Vec<u8>> // message to send ); // per-peer state machine |