aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/cookie.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-06-23 04:20:14 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-23 06:08:37 +0200
commitd0bd6dc67d81236f66cb763c3d47dd6b5d7581a6 (patch)
tree6b3669f075d28267e50bda153a32e9b7ea9ff30b /src/cookie.h
parenttools: fix misspelling of strchrnul in comment (diff)
downloadwireguard-monolithic-historical-d0bd6dc67d81236f66cb763c3d47dd6b5d7581a6.tar.xz
wireguard-monolithic-historical-d0bd6dc67d81236f66cb763c3d47dd6b5d7581a6.zip
global: use ktime boottime instead of jiffies
Since this is a network protocol, expirations need to be accounted for, even across system suspend. On real systems, this isn't a problem, since we're clearing all keys before suspend. But on Android, where we don't do that, this is something of a problem. So, we switch to using boottime instead of jiffies.
Diffstat (limited to 'src/cookie.h')
-rw-r--r--src/cookie.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cookie.h b/src/cookie.h
index 9f519ef..e83c256 100644
--- a/src/cookie.h
+++ b/src/cookie.h
@@ -15,13 +15,13 @@ struct cookie_checker {
u8 secret[NOISE_HASH_LEN];
u8 cookie_encryption_key[NOISE_SYMMETRIC_KEY_LEN];
u8 message_mac1_key[NOISE_SYMMETRIC_KEY_LEN];
- u64 secret_birthdate;
+ ktime_t secret_birthdate;
struct rw_semaphore secret_lock;
struct wireguard_device *device;
};
struct cookie {
- u64 birthdate;
+ ktime_t birthdate;
bool is_valid;
u8 cookie[COOKIE_LEN];
bool have_sent_mac1;