diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-08-16 12:33:10 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-08-16 12:33:10 +0200 |
commit | 726163b7f1a788d084643926dd92f03e36fdf27a (patch) | |
tree | be39bcf2b6701562e53f93ad114b489ea6b444e6 /src/handshake | |
parent | Implement add_keypair semantics (diff) | |
download | wireguard-rs-726163b7f1a788d084643926dd92f03e36fdf27a.tar.xz wireguard-rs-726163b7f1a788d084643926dd92f03e36fdf27a.zip |
Layout work on router
Diffstat (limited to 'src/handshake')
-rw-r--r-- | src/handshake/noise.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/handshake/noise.rs b/src/handshake/noise.rs index 4eea627..6a1eb6d 100644 --- a/src/handshake/noise.rs +++ b/src/handshake/noise.rs @@ -23,6 +23,8 @@ use super::types::*; use crate::types::{Key, KeyPair}; +use std::time::Instant; + // HMAC hasher (generic construction) type HMACBlake2s = Hmac<Blake2s>; @@ -388,6 +390,7 @@ pub fn create_response<T: Copy, R: RngCore + CryptoRng>( // return unconfirmed key-pair Ok(KeyPair { + birth: Instant::now(), confirmed: false, send: Key { id: sender, @@ -462,6 +465,7 @@ pub fn consume_response<T: Copy>( Some(peer.identifier), // proves overship of the public key (e.g. for updating the endpoint) None, // no response message Some(KeyPair { + birth: Instant::now(), confirmed: true, send: Key { id: sender, |