summaryrefslogtreecommitdiffstats
path: root/src/handshake
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-16 12:33:10 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-16 12:33:10 +0200
commit726163b7f1a788d084643926dd92f03e36fdf27a (patch)
treebe39bcf2b6701562e53f93ad114b489ea6b444e6 /src/handshake
parentImplement add_keypair semantics (diff)
downloadwireguard-rs-726163b7f1a788d084643926dd92f03e36fdf27a.tar.xz
wireguard-rs-726163b7f1a788d084643926dd92f03e36fdf27a.zip
Layout work on router
Diffstat (limited to 'src/handshake')
-rw-r--r--src/handshake/noise.rs4
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,