summaryrefslogtreecommitdiffstats
path: root/src/wireguard.h
diff options
context:
space:
mode:
authorMatt Dunwoodie <ncon@mail.noconroy.net>2019-09-22 23:15:08 +0200
committerMatt Dunwoodie <ncon@mail.noconroy.net>2019-09-22 23:16:26 +0200
commit3123c4ec9cc80882256ea405a4d0e0ffcbb745c7 (patch)
treec7a15c2cd86a673f2b0c17ad7b31605b7907c73f /src/wireguard.h
parentRename WG_PKT_STATE_PASS to WG_PKT_STATE_REQUEUED (diff)
downloadwireguard-openbsd-3123c4ec9cc80882256ea405a4d0e0ffcbb745c7.tar.xz
wireguard-openbsd-3123c4ec9cc80882256ea405a4d0e0ffcbb745c7.zip
Move antireplay to it's own header
For the time being, this is going to require static functions as antireplay.h is included in multiple source files.
Diffstat (limited to 'src/wireguard.h')
-rw-r--r--src/wireguard.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/wireguard.h b/src/wireguard.h
index efef1cefe2a..7bedbef7c2b 100644
--- a/src/wireguard.h
+++ b/src/wireguard.h
@@ -21,6 +21,7 @@
#include <sys/time.h>
#include <sys/timeout.h>
#include <sys/rwlock.h>
+#include <sys/antireplay.h>
#define WG_KEY_SIZE 32
#define WG_MAC_SIZE 16
@@ -32,9 +33,6 @@
#define WG_COOKIE_ID_VAL_MAXSIZE 32
#define WG_TIMESTAMP_SIZE 12
-#define WG_ARI_BITS (sizeof(uint64_t) * 8)
-#define WG_ARB_BITS (1<<10) /* 1024 bitmap (960 usable) */
-
#define WG_ENCRYPTED_SIZE(n) ((n) + WG_MAC_SIZE)
#define WG_PADDING_SIZE(n) ((WG_MSG_PADDING_SIZE - (n)) % WG_MSG_PADDING_SIZE)
#define WG_ENCRYPTED_PADDED_SIZE(n) WG_ENCRYPTED_SIZE(WG_PADDED_SIZE(n)) //unused
@@ -133,11 +131,8 @@ struct wg_session {
uint8_t ss_txkey[WG_KEY_SIZE];
uint8_t ss_rxkey[WG_KEY_SIZE];
-
- struct wg_antireplay {
- uint64_t ar_head;
- uint64_t ar_bitmap[WG_ARB_BITS / WG_ARI_BITS];
- } ss_ar;
+
+ struct antireplay ss_ar;
} s_ss;
};