aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/wg-quick/openbsd.bash (unfollow)
Commit message (Collapse)AuthorFilesLines
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>
2018-12-20wg: curve25519: handle unaligned loads/stores safelyJason A. Donenfeld2-5/+19
Reported-by: Chris Hewitt <chris@chrishewitt.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-18makefile: use immediate expansion and use correct template patternsJason A. Donenfeld2-0/+2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-18wg-quick: bring interface up while setting MTUAaron Jones1-9/+4
This avoids another ip(8) invocation for little benefit. Confirmed to work with iproute2 and busybox. Signed-off-by: Aaron Jones <aaronmdjones@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-07embeddable-wg-library: do not warn on unrecognized netlink attributesJason A. Donenfeld1-15/+1
This is a follow up of bcf8684c9ec90fe0d283a67d1654d05fb3eae019. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-13global: various formatting tweeksJason A. Donenfeld1-25/+25
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-11wg-quick: android: do not choke on empty allowed-ipsJason A. Donenfeld1-1/+4
Reported-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-06keygen-html: add missing glue macroJason A. Donenfeld1-0/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-19wg.8: AllowedIPs isn't actually requiredJason A. Donenfeld1-1/+1
An empty allowed IPs is totally valid, for folks wishing to move IP addresses between multiple peers atomically. Suggested-by: Comex <comexk@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-19wg.8: specify that wg(8) shows runtime info tooJason A. Donenfeld1-1/+1
Suggested-by: Comex <comexk@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-13wg-quick: wait for interface to disappear on freebsdJason A. Donenfeld1-0/+9
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-13wg: don't fail if a netlink interface dump is inconsistentJason A. Donenfeld2-4/+18
Netlink returns NLM_F_DUMP_INTR if the set of all tunnels changed during the dump. That's unfortunate, but is pretty common on busy systems that are adding and removing tunnels all the time. Rather than retrying, potentially indefinitely, we just work with the partial results. Reported-by: Robert Gerus <ar@is-a.cat> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-09wg: compile on gnu99Jason A. Donenfeld1-1/+1
We don't actually use any C11 features, so we can at least compile with ancient gcc. Reported-by: Aaron M. D. Jones <aaronmdjones@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-09wg: use libc's endianness macro if no compiler macroJason A. Donenfeld1-0/+10
This lets us be compiled with ancient gcc. Reported-by: Jeff Brandt <jeff@jeffcolo.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-08global: rename struct wireguard_ to struct wg_Jason A. Donenfeld1-5/+5
This required a bit of pruning of our christmas trees. Suggested-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-08netlink: do not stuff index into nla typeJason A. Donenfeld2-10/+8
It's not used for anything, and LKML doesn't like the type being used as an index value. Suggested-by: Eugene Syromiatnikov <esyr@redhat.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-07crypto: clean up remaining .h->.cJason A. Donenfeld2-3/+3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-05wg-quick.8: add policy routing exampleJason A. Donenfeld1-0/+26
Suggested-by: Toke Høiland-Jørgensen <toke@toke.dk> Suggested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-25crypto: make constant naming scheme consistentJason A. Donenfeld3-9/+9
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-20global: put SPDX identifier on its own lineJason A. Donenfeld32-64/+64
The kernel has very specific rules correlating file type with comment type, and also SPDX identifiers can't be merged with other comments. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-04global: prefer sizeof(*pointer) when possibleJason A. Donenfeld3-13/+13
Suggested-by: Sultan Alsawaf <sultanxda@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-03crypto: import zincJason A. Donenfeld2-3/+3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>