aboutsummaryrefslogtreecommitdiffstats
path: root/src/wg_noise.h
diff options
context:
space:
mode:
authorMatt Dunwoodie <ncon@noconroy.net>2021-04-19 05:45:47 +1000
committerMatt Dunwoodie <ncon@noconroy.net>2021-04-19 11:16:40 +1000
commitf685f466dbc371783b6bc8920f542cae2bd54fd8 (patch)
treef63e231fe790c60641540e23f40fe1a601fafcc0 /src/wg_noise.h
parentif_wg: actually use DEFAULT_MTU value (diff)
downloadwireguard-freebsd-f685f466dbc371783b6bc8920f542cae2bd54fd8.tar.xz
wireguard-freebsd-f685f466dbc371783b6bc8920f542cae2bd54fd8.zip
crypto: encrypt mbuf in place
This introduces a couple of routines to encrypt the mbufs in place. It is likely that these will be replaced by something in opencrypto, however for the time being this fixes a heap overflow and sets up wg_noise for the "correct" API. When the time comes, this should make it easier to drop in new crypto. It should be noted, this was written at 0500. Signed-off-by: Matt Dunwoodie <ncon@noconroy.net>
Diffstat (limited to '')
-rw-r--r--src/wg_noise.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/wg_noise.h b/src/wg_noise.h
index 50890a3..a6de34b 100644
--- a/src/wg_noise.h
+++ b/src/wg_noise.h
@@ -86,17 +86,15 @@ int noise_keypair_nonce_check(struct noise_keypair *, uint64_t);
int noise_keep_key_fresh_send(struct noise_remote *);
int noise_keep_key_fresh_recv(struct noise_remote *);
-void noise_keypair_encrypt(
+int noise_keypair_encrypt(
struct noise_keypair *,
uint32_t *r_idx,
uint64_t nonce,
- uint8_t *buf,
- size_t buflen);
+ struct mbuf *);
int noise_keypair_decrypt(
struct noise_keypair *,
uint64_t nonce,
- uint8_t *buf,
- size_t buflen);
+ struct mbuf *);
/* Handshake functions */
int noise_create_initiation(