From d64a1fc60502ecdc8a61b4a6fdc4af3e0e8857a2 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Mon, 8 Jan 2018 16:50:39 -0800 Subject: add more consts from the spec --- src/consts.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/consts.rs') diff --git a/src/consts.rs b/src/consts.rs index ba9d0d0..a6806ad 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -1,2 +1,19 @@ +// via Section 6.1 of the WireGuard spec draft + +#![allow(dead_code)] +use std::u64; + +// transport ratcheting time limits, in seconds +pub const REKEY_ATTEMPT_TIME: u64 = 90; pub const REKEY_AFTER_TIME: u64 = 120; +pub const REJECT_AFTER_TIME: u64 = 180; + +// transport ratcheting message limits, in seconds +pub const REJECT_AFTER_MESSAGES: u64 = u64::MAX - 65537; +pub const REKEY_AFTER_MESSAGES: u64 = u64::MAX - 17; + +// how often to attempt rekeying +pub const REKEY_TIMEOUT: u64 = 5; + +// keepalive packet timer, in seconds pub const KEEPALIVE_TIMEOUT: u64 = 10; -- cgit v1.2.3-59-g8ed1b