summaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
* version: bumpv1.0.20210424Jason A. Donenfeld2021-04-241-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: kill route monitor when loop terminatesJason A. Donenfeld2021-04-203-10/+16
| | | | | | | | | | If the route monitor doesn't attempt to write more to stdout, then this leaves a process hanging around. Kill it explicitly. We also switch to using exec in the process substitution, to reduce a bash process. Closes: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255286 Reported-by: Christos Chatzaras <chris@cretaforce.gr> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: freebsd: use ifconfig for determining if interface is upJason A. Donenfeld2021-04-181-16/+2
| | | | | | | | | We no longer need the arp hack, as these bugs have been fixed in the FreeBSD kernel. This partially reverts 090639ae90fb45ac05e3158e1e31e5bf15fd9559. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: freebsd: do not assume point-to-point interface flagJason A. Donenfeld2021-03-231-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: freebsd: check for socket using -S, not -fJason A. Donenfeld2021-03-211-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bumpv1.0.20210315Jason A. Donenfeld2021-03-151-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: freebsd: avoid writing private keys to /tmpJason A. Donenfeld2021-03-131-1/+1
| | | | | | | | FreeBSD's bash doesn't handle <(...) safely, creating a temporary file instead of using /proc/self/fd/N like on Linux. Work around this by using a simple pipeline with /dev/stdin. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ipc: uniformly ignore preshared keys that are zeroJason A. Donenfeld2021-03-112-2/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ipc: freebsd: add initial FreeBSD supportJason A. Donenfeld2021-03-114-0/+370
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: freebsd: add kernel supportJason A. Donenfeld2021-03-111-3/+17
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wireguard-tools: drag in headers for prototypesKyle Evans2021-03-102-0/+2
| | | | | | | ipc.c and terminal.c provide definitions for prototypes in their respective headers, drag those in. Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
* wireguard-tools: const correctnessKyle Evans2021-03-1010-19/+19
| | | | | | Fixes much of the noise from a FreeBSD WARNS=6 build of wg(8) Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
* Makefile: fix version indicatorFlorian Eckert2021-03-051-1/+1
| | | | | | | | | | | | | | If we execute `wg --version` we get a different version string that does not match with the version string in the openwrt makefile. Current version string: `wireguard-tools vreboot-13159-gac5caa2718 -https://git.zx2c4.com/wireguard-tools/` Corrected versions string: `wireguard-tools v1.0.20200319 -https://git.zx2c4.com/wireguard-tools/` Signed-off-by: Florian Eckert <fe@dev.tdt.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bumpv1.0.20210223Jason A. Donenfeld2021-02-231-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ipc: read trailing responses after set operationJason A. Donenfeld2021-01-271-5/+28
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* man: LOG_LEVEL variables changed naeJason A. Donenfeld2021-01-261-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ipc: do not use fscanf with trailing \nJason A. Donenfeld2021-01-251-1/+3
| | | | | | | If the stream is not closed, then this winds up hanging forever. So remove the trailing \n\n and check manually after. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* sticky-sockets: do not use SO_REUSEADDRJason A. Donenfeld2020-12-181-8/+0
| | | | | | This makes little sense for unicast UDP sockets. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* completion: add help and syncconf completionsJason A. Donenfeld2020-12-131-3/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wincompat: do not elevate by defaultJason A. Donenfeld2020-12-111-1/+1
| | | | | | | Elevation makes it detach from the console, which means the results are hidden. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wincompat: add resource and manifest and enable ltoJason A. Donenfeld2020-12-113-3/+70
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wincompat: recent mingw has inet_ntop/inet_ptonJason A. Donenfeld2020-11-092-38/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* embeddable-wg-library: sync latest from netlink.hJason A. Donenfeld2020-10-291-32/+35
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: openbsd: no use for userspace supportJason A. Donenfeld2020-10-191-41/+23
| | | | | | | | | | | With alignment between the kernel and userspace, along with userspace packages, we can now rely on the kernel in the future always having wg(4). This also simplifies the interface selection logic, and stores the wg-quick interface name as the description. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: android: do not free iterated pointerJason A. Donenfeld2020-09-151-7/+8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bumpv1.0.20200827Jason A. Donenfeld2020-08-271-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Revert "wg-quick: wait on process substitutions"Jason A. Donenfeld2020-08-274-49/+49
| | | | | | | | | | | | | | | | | | This reverts commit 26683f6c9ad18d9914b23312c221f27fd5ecab51, which means the old problem comes back. That's an issue. But waiting on process substitutions is not available with commonly used bash versions: # wg-quick up demo [#] ip link add demo type wireguard [#] wg setconf demo /dev/fd/63 /usr/bin/wg-quick: line 251: wait: pid 2955 is not a child of this shell [#] ip link delete dev demo This means we have to wait a few years before fixing this issue. IOW, bash limitation; can't fix. Reported-by: Theodore Mozzo <theodore.mozzo@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: android: use iproute2 to bring up interface instead of ndcJason A. Donenfeld2020-08-251-1/+1
| | | | | | | | | Android 11's ndc regresses even more, but it turns out that netd doesn't need to track up/down state via direct invocation, so just set the interface up by way of normal iproute2. Reported-by: Harsh Shandilya <me@msfjarvis.dev> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bumpv1.0.20200820Jason A. Donenfeld2020-08-201-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: wait on process substitutionsJason A. Donenfeld2020-08-064-49/+49
| | | | | | | | | Bash does not propagate error values, which is a bummer, but process substitutions are a useful feature. Introduce a new idiom to deal with this: either "; wait $!" after the line to propagate the error, or "|| true" to indicate explicitly that we don't care about the error. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ctype: use non-locale-specific ctype.hJason A. Donenfeld2020-08-065-14/+43
| | | | | | | | | | | | We also make these constant time, even though we're never distinguishing between bits of a secret using them. From that perspective, though, this is markedly better than the locale-specific table lookups in glibc, even though base64 characters span two cache lines and valid private keys must hit both. Co-authored-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Samuel Neves <sneves@dei.uc.pt>
* pubkey: isblank is a subset of isspaceJason A. Donenfeld2020-08-061-1/+1
| | | | | | Therefore, there's no need to test both. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* man: wg-quick: use syncconf instead of addconf for strip exampleJason A. Donenfeld2020-07-281-3/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* systemd: add reload target to systemd unitDomonkos P. Tomcsanyi2020-07-241-0/+1
| | | | | | | | | | | Users can now run `systemctl reload wg-quick@wgnet0`, as described in the wg-quick(8) man page. Note that this won't adjust Address=, DNS=, or the various other non-wg(8) fields. Signed-off-by: Domonkos P. Tomcsanyi <domi@tomcsanyi.net> [zx2c4: use exec for bash commands to reduce excess forks, and rewrite commit message] Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wincompat: fold random into genkeyJason A. Donenfeld2020-05-255-16/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ipc: split into separate files per-platformJason A. Donenfeld2020-05-256-1152/+1201
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bumpv1.0.20200513Jason A. Donenfeld2020-05-131-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ipc: openbsd: switch to array ioctl interfaceJason A. Donenfeld2020-05-132-89/+80
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Makefile: remember to install all systemd unitsJason A. Donenfeld2020-05-111-1/+1
| | | | | Reported-by: Unit 193 <unit193@unit193.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bumpv1.0.20200510Jason A. Donenfeld2020-05-101-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: cleanup openbsd supportJason A. Donenfeld2020-05-102-26/+35
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: add support for openbsd kernel implementationMatt Dunwoodie2020-05-101-4/+19
| | | | Signed-off-by: Matt Dunwoodie <ncon@noconroy.net>
* ipc: cleanup openbsd supportJason A. Donenfeld2020-05-105-94/+212
| | | | | | We also add a wg_if.h in the fallback include path. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ipc: add support for openbsd kernel implementationMatt Dunwoodie2020-05-101-3/+262
| | | | Signed-off-by: Matt Dunwoodie <ncon@noconroy.net>
* ipc: remove extra spaceJason A. Donenfeld2020-05-101-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: support dns search domainsJason A. Donenfeld2020-05-098-36/+88
| | | | | | | If DNS= has an IP in it, treat it as a DNS server. If DNS= has a non-IP in it, treat it as a DNS search domain. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* systemd: add wg-quick.targetMartin Hauke2020-05-012-0/+3
| | | | | | | | Add file wg-quick.target, which allows starting and stopping all wg-quick@.service instances at once. Signed-off-by: Martin Hauke <mardnh@gmx.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* terminal: specialize color_mode to stdout onlyJason A. Donenfeld2020-04-202-17/+7
| | | | | | By specializing this to stdout, we can cache the isatty result. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* git: add gitattributes so tarball doesn't have gitignore filesJason A. Donenfeld2020-04-081-0/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: android: support application whitelistJason A. Donenfeld2020-04-051-25/+48
| | | | | | | | | Prior we only supported a blacklist, but actually a whitelist is an easier algorithm because that's internally how netd considers it, so we don't need to find range spans. This commit adds an IncludedApplications key. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>