aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/cookie.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-04-27 11:10:50 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-05-17 18:07:42 +0200
commitdc34c6f2e6f038f2943fff1057a8dd307d9193cd (patch)
tree48168bb90f94f1d766ba47f8e0765dccc134c3bc /src/cookie.h
parentchacha20poly1305: implement vectorized hchacha20 (diff)
downloadwireguard-monolithic-historical-dc34c6f2e6f038f2943fff1057a8dd307d9193cd.tar.xz
wireguard-monolithic-historical-dc34c6f2e6f038f2943fff1057a8dd307d9193cd.zip
noise: redesign preshared key mode
Diffstat (limited to 'src/cookie.h')
-rw-r--r--src/cookie.h5
1 files changed, 4 insertions, 1 deletions
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);