diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-07-17 16:28:21 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-07-17 16:28:21 +0200 |
commit | 4817ca79060eb303452730aed4f4ad7ca44b8579 (patch) | |
tree | 8790b0c4e80613bd393b6a435b4866bde5fa03f0 /src/types.rs | |
parent | Use precomputed static-static (diff) | |
download | wireguard-rs-4817ca79060eb303452730aed4f4ad7ca44b8579.tar.xz wireguard-rs-4817ca79060eb303452730aed4f4ad7ca44b8579.zip |
Better seperation and introduction of timestamp
Diffstat (limited to '')
-rw-r--r-- | src/types.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/types.rs b/src/types.rs index 54f4801..81c1dc7 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,13 +1,9 @@ use std::fmt; -use std::sync::Mutex; use std::error::Error; use x25519_dalek::PublicKey; use x25519_dalek::SharedSecret; -use generic_array::typenum::U32; -use generic_array::GenericArray; - use crate::timestamp; // config error @@ -86,22 +82,3 @@ pub struct Output ( pub type Psk = [u8; 32]; -pub struct Peer { - // mutable state - pub state : Mutex<State>, - - // constant state - pub pk : PublicKey, // public key of peer - pub ss : SharedSecret, // precomputed DH(static, static) - pub psk : Psk // psk of peer -} - -pub enum State { - Reset{ - ts : Option<timestamp::TAI64N> - }, - InitiationSent{ - hs : GenericArray<u8, U32>, - ck : GenericArray<u8, U32> - }, -} |