aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/wg-quick (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-12-12wg-quick: linux: try both iptables(8) and nft(8) on teardownJason A. Donenfeld1-1/+2
Daniel argues that technically a package manager could install nft(8) after previously having started wg-quick(8) using iptables(8). Suggested-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-12wg-quick: linux: support older nft(8)Jason A. Donenfeld1-5/+5
Older nft(8), such as that on Ubuntu, does not accept the - parameter to the -f argument and doesn't accept symbolic priority names. So instead use the canonical numeric priority forms and use <(echo) instead of -. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-12global: fix up spellingJosh Soref2-4/+4
Signed-off-by: Josh Soref <jsoref@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-12wg-quick: linux: add support for nft and prefer itJason A. Donenfeld1-20/+39
If nft(8) is installed, use it. These rules should be identical to the iptables-restore(8) ones, with the advantage that cleanup is easy because we use custom table names. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-06wg-quick: linux: ignore save warnings for iptables-nftJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-06wg-quick: linux: suppress more warnings on weird kernelsJason A. Donenfeld1-4/+4
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-05wg-quick: linux: some iptables don't like empty linesJason A. Donenfeld1-6/+6
Reported-by: Kenneth R. Crudup <kenny@panix.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-05wg-quick: linux: iptables-* -w is not widely supportedJason A. Donenfeld1-2/+2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-05ipc: make sure userspace communication frees wgdeviceJason A. Donenfeld2-11/+16
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-05wg-quick: linux: have remove_iptables return trueJason A. Donenfeld1-1/+1
Reported-by: Thomas Sattler <sattler@med.uni-frankfurt.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-05wg-quick: linux: ensure postdown hooks executeJason A. Donenfeld1-2/+2
Reported-by: Thomas Sattler <sattler@med.uni-frankfurt.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-11-27wg-quick: linux: suppress error when finding unused tableJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-11-27wg: add syncconf commandJason A. Donenfeld3-0/+97
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-11-27reresolve-dns: remove invalid anchors on regex matchJason A. Donenfeld1-1/+1
Reported-by: Conrad Meyer <cem@freebsd.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-11-27wg-quick: linux: filter bogus injected packets and don't disable rpfilterJason A. Donenfeld1-8/+29
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-11-26wg-quick: linux: only touch net.ipv4 for v4Jason A. Donenfeld1-3/+5
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-16wg-quick: android: check for null in binder cleanup functionsJason A. Donenfeld1-3/+6
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-12wg-quick: android: use Binder for setting DNS on Android 10Nicolas Douma1-7/+429
Signed-off-by: Nicolas Douma <nicolas@serveur.io> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-31wg: windows: enforce named pipe ownership and use protected prefixJason A. Donenfeld2-22/+40
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-27wg-quick: linux: don't fail down when using systemd-resolvedRonan Pigott1-1/+1
systemd-resolved has a compatibility interface for use with resolvconf scripts when resolvectl is called from a symlink from resolvconf. However, when tearing down the interface, cmd_down calls del_if and then unset_dns. In the case of systemd-resolved, deleting the interface also removes the systemd-resolved entry and causes resolvconf -d to fail when resolvconf really is a symlink to resolvectl. This causes `wg-quick down` and 'wg-quick@.service' to exit with failure. Instead we use the resolvconf '-f' flag to ignore non-existent interfaces, supported by both openresolv and sd-resolved resolvconf. Signed-off-by: Ronan Pigott <rpigott@berkeley.edu> [zx2c4: moved -f argument to end to remain compatible with Debian's resolvconf] Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-07wg-quick: openbsd: fix alternate routing table syntaxAnkur Kothari1-1/+1
route(8) has always used the `-T` option to specify the routing table; there is no `rdomain` option. Signed-off-by: Ankur Kothari <ankur@lipidity.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-07-08wg-quick: android: refactor and add incoming allow rulesJason A. Donenfeld1-65/+73
Suggested-by: Yağmur Oymak <yagmur.oymak@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-24wg-quick: darwin: support being called from launchdJason A. Donenfeld3-1/+53
This causes wg-quick up to wait for the monitor to exit before it exits, so that launchd can correctly wait on it. Reported-by: Cameron Palmer <cameron@promon.no> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-05-31wg: pass WG_ENDPOINT_RESOLUTION_RETRIES=infinity to systemd unitJason A. Donenfeld1-0/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-05-31wg: add wincompat layer to wg(8)Jason A. Donenfeld15-0/+321
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-05-29wg: allow setting WG_ENDPOINT_RESOLUTION_RETRIESJason A. Donenfeld2-4/+25
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-05-29wg-quick: specify protocol to ip(8), because of inconsistenciesJason A. Donenfeld1-3/+7
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-05-29wg-quick: look up existing routes properlyJason A. Donenfeld1-1/+1
This was never really correct, and then 5.1 broke it entirely. Reported-by: piraty1@inbox.ru Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-04-23wg-quick: make darwin and freebsd path search strict like linuxJason A. Donenfeld2-2/+4
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-04-23wg-quick: freebsd: workaround SIOCGIFSTATUS race in FreeBSD kernelJason A. Donenfeld1-9/+22
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-23wg: avoid unneccessary next_peer assignments in sort_peers()Luis Ressel1-2/+1
Signed-off-by: Luis Ressel <aranea@aixah.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-23wg-quick: add 'strip' subcommandLuis Ressel5-5/+50
`wg-quick strip` prints the config file to stdout after stripping it of all wg-quick-specific options. This enables tricks such as `wg addconf $DEV <(wg-quick strip $DEV)`. Signed-off-by: Luis Ressel <aranea@aixah.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-23wg: warn if an AllowedIP has a nonzero host partLuis Ressel1-0/+34
Signed-off-by: Luis Ressel <aranea@aixah.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-18wg-quick: freebsd: export TMPDIR when restoring and don't make emptyJason A. Donenfeld1-1/+2
Otherwise mktemp doesn't see it, and if it's empty we wind up in /. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-02-28wg: add support for HaikuAlexander von Gluck IV1-0/+3
Signed-off-by: Alexander von Gluck IV <kallisti5@unixzen.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-02-28wg: genkey: account for short reads of /dev/urandomJason A. Donenfeld2-18/+35
Apparently Haiku has a misbehaving /dev/urandom. While we're at it, simplify the function signature to completely succeed or completely fail and make sure the caller checks the result. Reported-by: Alexander von Gluck IV <kallisti5@unixzen.com> Nitpicked-by: Aaron Jones <aaronmdjones@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-02-28wg-quick: freebsd: rebreak interface loopback, while fixing localhostJason A. Donenfeld1-1/+1
The commit 7c833642 ("wg-quick: freebsd: allow loopback to work") was supposed to make things better, but actually it just started sending legitimate localhost traffic over the WireGuard interface, which is really quite bad. This reverts commit 7c833642dfa342218602ab18e7091e86408d2982. Reported-by: Matt Smith <matt.xtaz@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-02-08wg: c_acc doesn't need to be initializedJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-02-05wg: fight compiler slightly harderJason A. Donenfeld2-2/+2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-02-03noise: store clamped key instead of raw keyJason A. Donenfeld2-4/+2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-31highlighter: when subtracting char, cast to unsignedJason A. Donenfeld1-2/+2
Windows. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-30systemd: wg-quick should depend on nss-lookup.targetJason A. Donenfeld1-2/+2
Since wg-quick(8) calls wg(8) which does hostname lookups, we should probably only run this after we're allowed to look up hostnames. Reported-by: Anton Castelli <anton.c42@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-24wg: remove unused check phony declarationJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-24wg-quick: freebsd: allow loopback to workJason A. Donenfeld1-1/+1
FreeBSD adds a route for point-to-point destination addresses. We don't really want to specify any destination address, but unfortunately we have to. Before we tried to cheat by giving our own address as the destination, but this had the unfortunate effect of preventing loopback from working on our local ip address. We work around this with yet another kludge: we set the destination address to 127.0.0.1. Since 127.0.0.1 is already assigned to an interface, this has the same effect of not specifying a destination address, and therefore we accomplish the intended behavior. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-23netlink: use __kernel_timespec for handshake timeJason A. Donenfeld4-5/+17
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-23contrib: introduce simple highlighter libraryJason A. Donenfeld8-0/+904
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-23global: normalize -> clampJason A. Donenfeld5-9/+9
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-23keygen-html: bring back pure javascript implementationJason A. Donenfeld6-139/+186
This reverts commit 9d5baf7d1d14ca7eb0852b41566330259229d489. Benoît Viguier has proofs that values will stay well within 2^53. We also have an improved carry function that's much simpler. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-23Kconfig: IPsec isn't IPSecJason A. Donenfeld1-1/+1
Reported-by: Raf Czlonka <rczlonka@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-07global: update copyrightJason A. Donenfeld52-52/+52
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>