From 41e7aa153984364087a9ef07eca02c72961825c7 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 27 Apr 2017 11:10:50 +0200 Subject: noise: redesign preshared key mode Signed-off-by: Jason A. Donenfeld --- src/cookie.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/cookie.h') diff --git a/src/cookie.h b/src/cookie.h index 87a0e5a..c87d3dd 100644 --- a/src/cookie.h +++ b/src/cookie.h @@ -14,6 +14,7 @@ struct sk_buff; 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; struct rw_semaphore secret_lock; struct ratelimiter ratelimiter; @@ -27,6 +28,7 @@ struct cookie { bool have_sent_mac1; u8 last_mac1_sent[COOKIE_LEN]; u8 cookie_decryption_key[NOISE_SYMMETRIC_KEY_LEN]; + u8 message_mac1_key[NOISE_SYMMETRIC_KEY_LEN]; struct rw_semaphore lock; }; @@ -39,7 +41,8 @@ enum cookie_mac_state { int cookie_checker_init(struct cookie_checker *checker, struct wireguard_device *wg); void cookie_checker_uninit(struct cookie_checker *checker); -void cookie_checker_precompute_keys(struct cookie_checker *checker, struct wireguard_peer *peer); +void cookie_checker_precompute_device_keys(struct cookie_checker *checker); +void cookie_checker_precompute_peer_keys(struct wireguard_peer *peer); void cookie_init(struct cookie *cookie); enum cookie_mac_state cookie_validate_packet(struct cookie_checker *checker, struct sk_buff *skb, bool check_cookie); -- cgit v1.2.3