Go to file
Matt Dunwoodie 87a62f1322 wg_noise: avoid handshake/keypair type confusion
So the last change broke consuming responses, as it may return an
invalid remote pointer. Thanks for the catch zx2c4. We just pass a flag
"lookup_keypair" which will lookup the keypair when we want (for cookie)
and will not when we don't (for consuming responses).

It would be possible to merge both noise_remote_index_lookup and
noise_keypair_lookup, but the result would probably need to return a
void * (for both keypair and remote) or a noise_index * which would need
to be cast to the relevant type somewhere. The trickiest thing here
would be for if_wg to "put" the result of the function, as it may be a
remote or a keypair (which store their refcount in different locations).
Perhaps it would return a noise_index * which could contain the refcount
for both keypair and remote. It all seems easier to leave them separate.
The only argument for combining them would be to reduce duplication of
(similar) functions.

Signed-off-by: Matt Dunwoodie <ncon@noconroy.net>
2021-04-20 18:30:08 +10:00
src wg_noise: avoid handshake/keypair type confusion 2021-04-20 18:30:08 +10:00
tests Initial import 2021-03-17 09:35:54 -06:00
COPYING Initial import 2021-03-17 09:35:54 -06:00
MISSING.md compat: backport to FreeBSD 12.2 2021-03-18 09:00:52 -06:00
README.md README: separate build stage 2021-03-23 12:23:11 -06:00
TODO.md if_wg: replace wg_tag with wg_packet 2021-04-19 10:46:06 +10:00

README.md

WireGuard for FreeBSD

This is a kernel module for FreeBSD to support WireGuard. It is being developed here before its eventual submission to FreeBSD 13.1 or 14.

Installation instructions

First make sure you have the latest net/wireguard package installed, version ≥1.0.20210315.

Then, on FreeBSD 12 & 13:

# git clone https://git.zx2c4.com/wireguard-freebsd
# make -C wireguard-freebsd/src
# make -C wireguard-freebsd/src load install

After that, it should be possible to use wg(8) and wg-quick(8) like usual, but with the faster kernel implementation.