]> git.ipfire.org Git - thirdparty/wireguard-tools.git/log
thirdparty/wireguard-tools.git
7 years agowg: no need to put this on the stack
Jason A. Donenfeld [Fri, 1 Dec 2017 18:42:46 +0000 (19:42 +0100)] 
wg: no need to put this on the stack

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: remove undocumented unused syntax
Jason A. Donenfeld [Fri, 1 Dec 2017 18:41:16 +0000 (19:41 +0100)] 
wg: remove undocumented unused syntax

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agocontrib: keygen-html for generating keys in the browser
Jason A. Donenfeld [Fri, 1 Dec 2017 12:31:33 +0000 (13:31 +0100)] 
contrib: keygen-html for generating keys in the browser

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: fix removing preshared keys
Jason A. Donenfeld [Thu, 23 Nov 2017 00:17:25 +0000 (01:17 +0100)] 
wg: fix removing preshared keys

Also clean up related logic quite a bit and add unit tests.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agoglobal: switch from timeval to timespec
Jason A. Donenfeld [Wed, 22 Nov 2017 15:49:56 +0000 (16:49 +0100)] 
global: switch from timeval to timespec

This gets us nanoseconds instead of microseconds, which is better, and
we can do this pretty much without freaking out existing userspace,
which doesn't actually make use of the nano/micro seconds field:

zx2c4@thinkpad ~ $ cat a.c
void main()
{
        puts(sizeof(struct timeval) == sizeof(struct timespec) ? "success" : "failure");
}
zx2c4@thinkpad ~ $ gcc a.c -m64 && ./a.out
success
zx2c4@thinkpad ~ $ gcc a.c -m32 && ./a.out
success

This doesn't solve y2038 problem, but timespec64 isn't yet a thing in
userspace.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: tighten up strtoul parsing
Jason A. Donenfeld [Fri, 17 Nov 2017 12:39:02 +0000 (13:39 +0100)] 
wg: tighten up strtoul parsing

Reported-by: Cedric Buxin <cedric.buxin@izri.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: document localhost exception and v6 rule
Jason A. Donenfeld [Sat, 11 Nov 2017 15:49:34 +0000 (00:49 +0900)] 
wg-quick: document localhost exception and v6 rule

Reported-by: Hermann Lienstromberg <nurtic-vibe@grmml.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: allow for NULL keys everywhere
Jason A. Donenfeld [Sat, 11 Nov 2017 03:30:21 +0000 (12:30 +0900)] 
wg: allow for NULL keys everywhere

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: remove ioctl cruft
Jason A. Donenfeld [Fri, 10 Nov 2017 08:30:24 +0000 (17:30 +0900)] 
wg: remove ioctl cruft

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: allow for tabs in keys
Jason A. Donenfeld [Thu, 9 Nov 2017 05:12:06 +0000 (14:12 +0900)] 
wg-quick: allow for tabs in keys

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: stat the correct enclosing folder of config file
Jason A. Donenfeld [Wed, 8 Nov 2017 09:40:07 +0000 (18:40 +0900)] 
wg-quick: stat the correct enclosing folder of config file

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: save all hooks on save
Jason A. Donenfeld [Tue, 31 Oct 2017 18:47:39 +0000 (19:47 +0100)] 
wg-quick: save all hooks on save

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: fsync the temporary file before renaming
Jason A. Donenfeld [Tue, 31 Oct 2017 17:13:31 +0000 (18:13 +0100)] 
wg-quick: fsync the temporary file before renaming

This ensures that on an unclean shutdown, we either see the old content
or the new content, but not empty content.

Suggested-by: Ka Ho Ng <ngkaho1234@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: allow for saving existing interface
Jason A. Donenfeld [Tue, 31 Oct 2017 16:51:38 +0000 (17:51 +0100)] 
wg-quick: allow for saving existing interface

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agocontrib: add reresolve-dns
Jason A. Donenfeld [Tue, 31 Oct 2017 15:15:19 +0000 (16:15 +0100)] 
contrib: add reresolve-dns

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: correct type for CTRL_ATTR_FAMILY_ID
Jason A. Donenfeld [Tue, 31 Oct 2017 13:55:17 +0000 (14:55 +0100)] 
wg: correct type for CTRL_ATTR_FAMILY_ID

Suggested-by: Jörg Thalheim <joerg@thalheim.io>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: allow for the hatchet, but not by default
Jason A. Donenfeld [Tue, 31 Oct 2017 10:38:09 +0000 (11:38 +0100)] 
wg-quick: allow for the hatchet, but not by default

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: remember to rewind DNS settings on failure
Jason A. Donenfeld [Thu, 26 Oct 2017 20:49:46 +0000 (22:49 +0200)] 
wg-quick: remember to rewind DNS settings on failure

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: allow specifiying multiple hooks
Jason A. Donenfeld [Wed, 25 Oct 2017 19:55:17 +0000 (21:55 +0200)] 
wg-quick: allow specifiying multiple hooks

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agoglobal: style nits
Jason A. Donenfeld [Wed, 25 Oct 2017 15:56:08 +0000 (17:56 +0200)] 
global: style nits

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agoglobal: infuriating kernel iterator style
Jason A. Donenfeld [Wed, 25 Oct 2017 15:13:46 +0000 (17:13 +0200)] 
global: infuriating kernel iterator style

One types:

   for (i = 0 ...

So one should also type:

  for_each_obj (obj ...

But the upstream kernel style guidelines are insane, and so we must
instead do:

  for_each_obj(obj ...

Ugly, but one must choose his battles wisely.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: account for padding being in zero attribute
Jason A. Donenfeld [Tue, 17 Oct 2017 17:20:52 +0000 (19:20 +0200)] 
wg: account for padding being in zero attribute

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: newline after warning
Jason A. Donenfeld [Tue, 17 Oct 2017 16:48:41 +0000 (18:48 +0200)] 
wg: newline after warning

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: style
Jason A. Donenfeld [Mon, 16 Oct 2017 20:18:29 +0000 (22:18 +0200)] 
wg: style

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: add pass example to wg-quick man page
Jason A. Donenfeld [Mon, 16 Oct 2017 01:28:24 +0000 (03:28 +0200)] 
wg: add pass example to wg-quick man page

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: don't insist on having a private key
Jason A. Donenfeld [Mon, 16 Oct 2017 01:17:12 +0000 (03:17 +0200)] 
wg: don't insist on having a private key

This lets us do flexible things from wg-quick such as:

PostUp = wg set %i private-key <(pass WireGuard/private-keys/%i)

It also was never a very sensible policy to enforce.

Suggested-by: Luis Ressel <aranea@aixah.de>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: retry resolution except when fatal
Jason A. Donenfeld [Sun, 15 Oct 2017 20:52:38 +0000 (22:52 +0200)] 
wg: retry resolution except when fatal

The reference to this is <https://sourceware.org/glibc/wiki/NameResolver>,
which mentions:

"From the perspective of the application that calls getaddrinfo() it
perhaps doesn't matter that much since EAI_FAIL, EAI_NONAME and
EAI_NODATA are all permanent failure codes and the causes are all
permanent failures in the sense that there is no point in retrying
later."

This should cover more early-boot situations.

While we're at it, we clean up the logic a bit so that we don't have a
retry message on the final non-retrying attempt. We also peer into errno
when receiving EAI_SYSTEM, to report to the user what actually happened.

Also, fix the quoting back tick front tick mess.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: encoding: be more paranoid
Jason A. Donenfeld [Sun, 15 Oct 2017 19:29:01 +0000 (21:29 +0200)] 
wg: encoding: be more paranoid

Needless, but overkill can be fun.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agoMakefile: even prettier output
Jason A. Donenfeld [Sat, 14 Oct 2017 03:17:40 +0000 (05:17 +0200)] 
Makefile: even prettier output

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: man: include kill-switch documentation using fwmark
Jason A. Donenfeld [Tue, 10 Oct 2017 23:55:45 +0000 (01:55 +0200)] 
wg: man: include kill-switch documentation using fwmark

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: store tail pointer to make coalescing peers fast
Jason A. Donenfeld [Tue, 10 Oct 2017 15:17:43 +0000 (17:17 +0200)] 
wg: store tail pointer to make coalescing peers fast

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: warn once on unrecognized items
Jason A. Donenfeld [Mon, 9 Oct 2017 11:27:00 +0000 (13:27 +0200)] 
wg: warn once on unrecognized items

DaveM suggests we do in fact do this. Others on the same thread weren't
happy about the length of the proposed message, so we also give a bit of
a less dramatic warning.

This reverts commit a2cc976a3b572cf308cc2d97c080eacac60416fe.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: try again if dump is interrupted
Jason A. Donenfeld [Sun, 8 Oct 2017 14:24:37 +0000 (16:24 +0200)] 
wg: try again if dump is interrupted

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agoMakefile: clang now builds the kernel, so use scan-build
Jason A. Donenfeld [Thu, 5 Oct 2017 18:52:19 +0000 (20:52 +0200)] 
Makefile: clang now builds the kernel, so use scan-build

Also add little stub for coccinelle and clean up semicolon issue it
found.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agoMakefile: add non-verbose mode to tools
Jason A. Donenfeld [Tue, 3 Oct 2017 15:16:37 +0000 (17:16 +0200)] 
Makefile: add non-verbose mode to tools

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agoglobal: satisfy bitshift pedantry
Jason A. Donenfeld [Tue, 3 Oct 2017 04:18:45 +0000 (06:18 +0200)] 
global: satisfy bitshift pedantry

Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agocontrib: remove worthless build artifact
Jason A. Donenfeld [Mon, 2 Oct 2017 14:32:20 +0000 (16:32 +0200)] 
contrib: remove worthless build artifact

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: compile on non-Linux
Jason A. Donenfeld [Mon, 2 Oct 2017 11:05:35 +0000 (13:05 +0200)] 
wg: compile on non-Linux

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: simmer down silly compilers
Jason A. Donenfeld [Mon, 2 Oct 2017 01:44:06 +0000 (03:44 +0200)] 
wg: simmer down silly compilers

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: do not warn on unrecognized items
Jason A. Donenfeld [Mon, 2 Oct 2017 00:51:57 +0000 (02:51 +0200)] 
wg: do not warn on unrecognized items

Upstream advice is to simply be silent.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: check permissions of parent directory
Jason A. Donenfeld [Sun, 1 Oct 2017 20:05:19 +0000 (22:05 +0200)] 
wg-quick: check permissions of parent directory

Also prefix octal 0, in case these files are actually of modes that
don't start with 0 by accident (such as SUID or sticky bit).

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: verify wireguard interface in more clever way
Jason A. Donenfeld [Sun, 1 Oct 2017 19:42:32 +0000 (21:42 +0200)] 
wg-quick: verify wireguard interface in more clever way

This helps with old Debian which has ancient iproute2, as well as paving
the path toward this script supporting userspace implementations.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: anchor sysctl regex to start and end
Jason A. Donenfeld [Sun, 1 Oct 2017 19:37:53 +0000 (21:37 +0200)] 
wg-quick: anchor sysctl regex to start and end

This doesn't actually fix a real problem, but it is more correct than
not having it.

Suggested-by: Aaron Sigel <aaron@vtty.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agonetlink: switch from ioctl to netlink for configuration
Jason A. Donenfeld [Mon, 25 Sep 2017 02:22:09 +0000 (04:22 +0200)] 
netlink: switch from ioctl to netlink for configuration

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: uapi: only make sure socket file is socket
Jason A. Donenfeld [Tue, 26 Sep 2017 13:02:41 +0000 (15:02 +0200)] 
wg: uapi: only make sure socket file is socket

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: use key_is_zero for comparing to zeros
Jason A. Donenfeld [Fri, 22 Sep 2017 02:04:00 +0000 (04:04 +0200)] 
wg: use key_is_zero for comparing to zeros

Maybe an attacker on the system could use the infoleak in /proc to gauge
how long a wg(8) process takes to complete and determine the number of
leading zeros. This is somewhat ridiculous, but it's possible somebody
somewhere might at somepoint care in the future, so alright.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agocontrib: add sticky sockets example code
Jason A. Donenfeld [Tue, 19 Sep 2017 21:17:56 +0000 (23:17 +0200)] 
contrib: add sticky sockets example code

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg-quick: only bash complete existing interfaces for down
Jason A. Donenfeld [Wed, 6 Sep 2017 18:51:41 +0000 (20:51 +0200)] 
wg-quick: only bash complete existing interfaces for down

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agowg: fix removal of psk
Jason A. Donenfeld [Wed, 23 Aug 2017 18:51:52 +0000 (12:51 -0600)] 
wg: fix removal of psk

This is an attribute of the peer, not the device.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: stricter userspace ipc parsing
Jason A. Donenfeld [Wed, 2 Aug 2017 19:07:25 +0000 (21:07 +0200)] 
wg: stricter userspace ipc parsing

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agocontrib: move Android tools to wireguard-android repo
Jason A. Donenfeld [Mon, 31 Jul 2017 01:03:06 +0000 (03:03 +0200)] 
contrib: move Android tools to wireguard-android repo

https: //git.zx2c4.com/wireguard-android/
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoandroid: fix readme
Jason A. Donenfeld [Wed, 26 Jul 2017 02:10:33 +0000 (04:10 +0200)] 
android: fix readme

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: add explicit support for common DNS usage
Jason A. Donenfeld [Wed, 26 Jul 2017 01:09:48 +0000 (03:09 +0200)] 
wg-quick: add explicit support for common DNS usage

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: do not use grep
Jason A. Donenfeld [Mon, 24 Jul 2017 21:22:10 +0000 (23:22 +0200)] 
wg-quick: do not use grep

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: do not set explicit src route for v6 default route
Jason A. Donenfeld [Mon, 24 Jul 2017 14:08:42 +0000 (16:08 +0200)] 
wg-quick: do not set explicit src route for v6 default route

This was only required because clueless network operators were trying to
route fec0::/10 globally, when that range doesn't actually have global
scope. Now that we understand the cause was operator error, we revert
the change here, so that the routing table is kept consistent.

This reverts commit 64e47de870a2f0575b5564a70e5680b48ab83ff9.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoandroid: add port of wg-quick
Jason A. Donenfeld [Thu, 20 Jul 2017 04:07:48 +0000 (06:07 +0200)] 
android: add port of wg-quick

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: usage typos
Jason A. Donenfeld [Thu, 20 Jul 2017 04:29:14 +0000 (06:29 +0200)] 
wg-quick: usage typos

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoglobal: wireguard.io --> wireguard.com
Jason A. Donenfeld [Sun, 16 Jul 2017 14:12:20 +0000 (16:12 +0200)] 
global: wireguard.io --> wireguard.com

Due to concerns with the .io TLD, we are switching to using
wireguard.com instead.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agogitignore: ignore split DWARF debug info
Samuel Holland [Wed, 31 May 2017 16:30:59 +0000 (11:30 -0500)] 
gitignore: ignore split DWARF debug info

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: remove double include in ipc
Jason A. Donenfeld [Thu, 29 Jun 2017 12:34:27 +0000 (14:34 +0200)] 
wg: remove double include in ipc

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: use printf -v instead of namerefs for bash 4.2
Jason A. Donenfeld [Tue, 27 Jun 2017 20:18:13 +0000 (22:18 +0200)] 
wg-quick: use printf -v instead of namerefs for bash 4.2

I'm not happy about this.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: properly match IPv6 endpoint
Jason A. Donenfeld [Fri, 23 Jun 2017 12:48:03 +0000 (14:48 +0200)] 
wg-quick: properly match IPv6 endpoint

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agohaskell: re-add updated haskell example
Jason A. Donenfeld [Tue, 13 Jun 2017 21:35:27 +0000 (23:35 +0200)] 
haskell: re-add updated haskell example

Code-from: John Galt <jgalt@centromere.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: use proper __linux__ ifdef
Jason A. Donenfeld [Mon, 12 Jun 2017 15:01:23 +0000 (17:01 +0200)] 
wg: use proper __linux__ ifdef

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: match ipv6 default route more broadly
Jason A. Donenfeld [Sun, 11 Jun 2017 22:20:31 +0000 (00:20 +0200)] 
wg-quick: match ipv6 default route more broadly

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: make sure we have empty table for both v6 and v4
Jason A. Donenfeld [Sun, 11 Jun 2017 21:39:17 +0000 (23:39 +0200)] 
wg-quick: make sure we have empty table for both v6 and v4

Otherwise, we wind up not doing the right thing in the v6-only case, or
doing something totally borked when v4 and v6 are filled unevenly.

Reported-by: Roelf Wichertjes <contact@roelf.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoexternal-tests: trim the fat
Jason A. Donenfeld [Fri, 9 Jun 2017 00:56:08 +0000 (02:56 +0200)] 
external-tests: trim the fat

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agogo test: use x/crypto for blake2s now that we have 128-bit mac
Jason A. Donenfeld [Tue, 6 Jun 2017 14:50:20 +0000 (16:50 +0200)] 
go test: use x/crypto for blake2s now that we have 128-bit mac

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agogo test: correct tai64n and formatting
Jason A. Donenfeld [Thu, 1 Jun 2017 17:08:24 +0000 (19:08 +0200)] 
go test: correct tai64n and formatting

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoexternal-tests: add keepalive packet
Jason A. Donenfeld [Thu, 1 Jun 2017 16:45:20 +0000 (18:45 +0200)] 
external-tests: add keepalive packet

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agogo test: properly pad message
Jason A. Donenfeld [Thu, 1 Jun 2017 04:31:26 +0000 (06:31 +0200)] 
go test: properly pad message

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: allow creating device with no peers
Jason A. Donenfeld [Tue, 30 May 2017 03:14:53 +0000 (05:14 +0200)] 
wg: allow creating device with no peers

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agorust test: add icmp ping
Jason A. Donenfeld [Mon, 29 May 2017 14:58:10 +0000 (16:58 +0200)] 
rust test: add icmp ping

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agorust test: convert screech test to snow
Jake McGinty [Mon, 29 May 2017 05:47:26 +0000 (13:47 +0800)] 
rust test: convert screech test to snow

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoman: update wg-quick(8) to show Debian resolvconf braindamage
Jason A. Donenfeld [Mon, 22 May 2017 11:28:02 +0000 (13:28 +0200)] 
man: update wg-quick(8) to show Debian resolvconf braindamage

While OpenResolv supports explicit ordering directives such as `-m` and
exclusivity directives such as `-x`, Debian's own resolvconf supports
none of this, instead using a hard coded list of interface name
templates for determining ordering. While trying to emulate `-x` is
difficult [*], we can at least try to mostly emulate `-m 0` by
masquerading as a `tun*` interface to resolvconf. Ugly, but it works.

[*] One heavy handed way of emulating `-x` would be something like:

   # echo nameserver 8.8.8.8 > /etc/resolv.conf.wg0-exclusive
   # mount --bind -o ro /etc/resolv.conf.wg0-exclusive /etc/resolv.conf
   # rm -f /etc/resolv.conf.wg0-exclusive

This in practice works quite well, but is a bit heavy to put in a man
page. It also doesn't "stack" well. For example, if we simply run
`umount /etc/resolv.conf`, how do we know which resolv.conf entry we're
unmounting?

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: use src routing for default routes in v6
Jason A. Donenfeld [Thu, 18 May 2017 12:40:26 +0000 (14:40 +0200)] 
wg-quick: use src routing for default routes in v6

Otherwise, traffic is sent with the IP address of a different interface,
and then packets don't actually get delivered.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoman: fix psk mention in wg-quick man page
Jason A. Donenfeld [Thu, 18 May 2017 11:37:31 +0000 (13:37 +0200)] 
man: fix psk mention in wg-quick man page

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: opt-in globally to GNU-isms to keep the BSDs happy
Jason A. Donenfeld [Wed, 17 May 2017 16:34:23 +0000 (18:34 +0200)] 
wg: opt-in globally to GNU-isms to keep the BSDs happy

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: support text-based ipc
Jason A. Donenfeld [Mon, 15 May 2017 21:24:48 +0000 (23:24 +0200)] 
wg: support text-based ipc

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: check for proto error on set too
Jason A. Donenfeld [Sun, 14 May 2017 17:29:59 +0000 (19:29 +0200)] 
wg: check for proto error on set too

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: stricter key file reading
Jason A. Donenfeld [Fri, 12 May 2017 13:03:38 +0000 (15:03 +0200)] 
wg: stricter key file reading

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agonoise: redesign preshared key mode
Jason A. Donenfeld [Thu, 27 Apr 2017 09:10:50 +0000 (11:10 +0200)] 
noise: redesign preshared key mode

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: auto MTU discovery
Jason A. Donenfeld [Mon, 24 Apr 2017 03:01:16 +0000 (05:01 +0200)] 
wg-quick: auto MTU discovery

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: retry name resolution on temporary failure
Jason A. Donenfeld [Mon, 24 Apr 2017 01:45:40 +0000 (03:45 +0200)] 
wg: retry name resolution on temporary failure

This should solve many problems at init time.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: no hyphen in preshared, to keep uniformity
Jason A. Donenfeld [Thu, 20 Apr 2017 18:21:50 +0000 (20:21 +0200)] 
wg: no hyphen in preshared, to keep uniformity

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: argc is always 1
Jason A. Donenfeld [Wed, 19 Apr 2017 14:53:13 +0000 (16:53 +0200)] 
wg: argc is always 1

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: check for malloc failure
Jason A. Donenfeld [Wed, 19 Apr 2017 14:51:24 +0000 (16:51 +0200)] 
wg: check for malloc failure

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: side channel resistant base64
Jason A. Donenfeld [Sat, 15 Apr 2017 23:20:43 +0000 (01:20 +0200)] 
wg: side channel resistant base64

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: do not use addrconfig with port in gai
Jason A. Donenfeld [Tue, 28 Mar 2017 08:46:31 +0000 (10:46 +0200)] 
wg: do not use addrconfig with port in gai

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agouapi: add version magic
Jason A. Donenfeld [Fri, 24 Mar 2017 03:01:25 +0000 (04:01 +0100)] 
uapi: add version magic

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: various cleanups
Jason A. Donenfeld [Thu, 23 Mar 2017 14:44:10 +0000 (15:44 +0100)] 
wg-quick: various cleanups

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: document # comments in wg(8) man page
Jason A. Donenfeld [Wed, 22 Mar 2017 12:11:41 +0000 (13:11 +0100)] 
wg: document # comments in wg(8) man page

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: support old ip(8)
Pim van Pelt [Thu, 16 Mar 2017 22:57:55 +0000 (23:57 +0100)] 
wg-quick: support old ip(8)

Old versions of ip(8) do not accept arguments to `ip rule show.` This
patch works around that limitation.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agocontrib: add wg-json utility
Jason A. Donenfeld [Thu, 23 Feb 2017 14:50:05 +0000 (15:50 +0100)] 
contrib: add wg-json utility

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: fix bash completion spaces
Jason A. Donenfeld [Thu, 23 Feb 2017 03:39:06 +0000 (04:39 +0100)] 
wg: fix bash completion spaces

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: add wg show [interface] dump
Jason A. Donenfeld [Wed, 22 Feb 2017 20:53:55 +0000 (21:53 +0100)] 
wg: add wg show [interface] dump

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg: give "off" value for fwmark
Jason A. Donenfeld [Wed, 22 Feb 2017 20:45:03 +0000 (21:45 +0100)] 
wg: give "off" value for fwmark

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: allow config files without trailing newline
Jason A. Donenfeld [Wed, 22 Feb 2017 19:23:00 +0000 (20:23 +0100)] 
wg-quick: allow config files without trailing newline

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoextract-keys: respect compat directives
Jason A. Donenfeld [Mon, 20 Feb 2017 20:55:44 +0000 (21:55 +0100)] 
extract-keys: respect compat directives

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agowg-quick: unquote fwmark for bash 4.3
Jason A. Donenfeld [Tue, 14 Feb 2017 10:41:56 +0000 (11:41 +0100)] 
wg-quick: unquote fwmark for bash 4.3

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>