aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tunnel (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tunnel: deduplicate addresses from configJason A. Donenfeld2020-01-241-0/+1
| | | | | | | Windows doesn't like it when passing these off to its config. Reported-by: Jonathan Tooker <jonathan.tooker@netprotect.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: use real on-link routesJason A. Donenfeld2019-12-161-21/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* firewall: add escape hatch for same-process adminsJason A. Donenfeld2019-12-111-0/+17
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* firewall: fix urlsJason A. Donenfeld2019-12-113-9/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: add wintun ordered unit testJason A. Donenfeld2019-12-111-0/+202
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: stop burst timer if we exceed 2 secondsJason A. Donenfeld2019-10-311-0/+1
| | | | | Reported-by: Odd Stranne <odd@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: blackhole sockets when there's going to be a sure routing loopJason A. Donenfeld2019-10-212-9/+49
| | | | | | | | This prevents against common mishaps when changing from a wifi network that supports v6 to one that doesn't. Reported-by: Jonathan Tooker <jonathan.tooker@netprotect.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* mod: bumpJason A. Donenfeld2019-10-171-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Revert "tunnel: check for endpoint interfaces and media connection state"Jason A. Donenfeld2019-10-091-3/+1
| | | | | | | | This reverts commit cf6f599a4a65e89929ffc12982346c8e9012552c. It broke people's setups. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: print wintun version in debug logJason A. Donenfeld2019-10-091-0/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* mod: bump versionsJason A. Donenfeld2019-10-042-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: check for endpoint interfaces and media connection stateJason A. Donenfeld2019-10-011-1/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: smooth bursts from windows network notifiersJason A. Donenfeld2019-10-011-5/+25
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: windows does not always add/remove routes with up/down interfaceJason A. Donenfeld2019-10-013-25/+45
| | | | | | | | | | | | | | | | On Linux, we're used to routes being added after an interface is up, and routes being removed as a consequence of an interface going down. On Windows, this isn't always the case, at least not from the perspective of the route notifiers. In order to work around this and make a multi-interface model coherent, we search for a new default route not only whenever the routing table changes but also whenever any interface link parameters change, such as up/down. The practical consequence is that now WireGuard connects properly when wifi is disconnected and then reconnected. Reported-by: Nenad Kozul <me@nenadkozul.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* winipcfg: make Unregister wait for callbacks to completeJason A. Donenfeld2019-09-274-31/+61
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* winipcfg: port more granular locking from route change to othersJason A. Donenfeld2019-09-272-22/+36
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* winipcfg: ensure we're passing copy to go routinesJason A. Donenfeld2019-09-273-3/+6
| | | | | | | The windows-allocated one gets freed. Reported-by: Odd Stranne <odd@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* mod: bump versionsJason A. Donenfeld2019-09-272-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: use SECURITY_DESCRIPTOR apis from x/sys/windowsJason A. Donenfeld2019-09-237-99/+62
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* firewall: remove unused wrappersJason A. Donenfeld2019-09-232-32/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: device->interfaceJason A. Donenfeld2019-09-131-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* winipcfg: launch callbacks in goroutines to prevent deadlockJason A. Donenfeld2019-09-013-3/+3
| | | | | | | | | | | | ret: setupLock interfaceChangeLock trigger: interfaceChangeLock setupLock Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* winipcfg: use upstream helper function for elevation testJason A. Donenfeld2019-08-301-16/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: fix nits in adapter cleanup logic and also handle ā€˜%sā€™ uniformlyJason A. Donenfeld2019-08-301-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: allow disabling deterministic GUIDs for external consumersJason A. Donenfeld2019-08-301-21/+31
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: do not query real interface nameJason A. Donenfeld2019-08-261-7/+0
| | | | | | | | | | | | We want to enforce the relation between the socket name and the service name, especially since the wintun adapter name might get a 1 or 2 appended depending on weird Nci duplication detection. So we just stick with the configuration-given name throughout. Also, the user can change the adapter name at runtime, which is all the more reason why maybe we shouldn't care about it so much. Reported-by: Nenad Kozul <me@nenadkozul.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* firewall: use RtlGetNtVersionNumbers for kernel compat checksJason A. Donenfeld2019-08-261-3/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: use upstream RtlGetVersionJason A. Donenfeld2019-08-241-7/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: move Run into own module to reduce file sizeJason A. Donenfeld2019-08-241-2/+14
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* elevate: move service/token into proper moduleJason A. Donenfeld2019-08-051-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: styleJason A. Donenfeld2019-08-031-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: extract owner of config file for pipe daclJason A. Donenfeld2019-07-192-0/+60
| | | | | | | | If the config file is unencrypted and its owner is not Local System, then we allow the runtime named pipe to be accessed by that owner, since generally the private key is already stored in the config file. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: wait for IP service to attach to wintunJason A. Donenfeld2019-06-186-125/+268
| | | | | | | | This helps fix startup races without needing to poll, as well as reconfiguring interfaces after wintun destroys and re-adds. It also deals gracefully with IPv6 being disabled. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* firewall: adjust loopback rule for better matchingOdd Stranne2019-06-132-17/+14
| | | | | Signed-off-by: Odd Stranne <odd@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: clearer GUID encoding schemeJason A. Donenfeld2019-06-131-24/+38
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* winipcfg: prefer own methods over direct API callsSimon Rozman2019-06-111-2/+2
| | | | Signed-off-by: Simon Rozman <simon@rozman.si>
* tunnel: generate GUIDs deterministicallyJason A. Donenfeld2019-06-102-1/+74
| | | | | | | | This allows NLA profiles to securely bind public keys to firewall profiles, a considerable improvement on the usual insecure Windows situation. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: SCM lock status is upstream nowJason A. Donenfeld2019-06-091-32/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: release SCM locks by faking an early start before wintun initJason A. Donenfeld2019-06-071-0/+35
| | | | | | | Otherwise creating the wintun service deadlocks the entire SCM on Windows 8.1. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* firewall: GUID generation is now upstreamJason A. Donenfeld2019-06-072-16/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: cleanup TODO comment spacingJason A. Donenfeld2019-06-075-6/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: perform full stop on shutdownSimon Rozman2019-06-071-2/+2
| | | | | | | | | | | The services which do not advertise they accept shutdown signal from SCM are killed on shutdown. This commit establishes a full tunnel cleanup (i.e. delete the adapter) on shutdown. Otherwise, the Wintun adapter is deleted on next boot as a part of the regular sanitation procedure. Signed-off-by: Simon Rozman <simon@rozman.si>
* tunnel: retain SeLoadDriverPrivilegeJason A. Donenfeld2019-06-071-2/+2
| | | | | | This is a big loss. We'll need to revisit this. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: don't fail on v6 family lookup unless using v6Jason A. Donenfeld2019-06-071-14/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* services: iterate through groups using helperJason A. Donenfeld2019-06-071-2/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: fix formattingJason A. Donenfeld2019-06-072-3/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: make tcp/ip waiting explicitJason A. Donenfeld2019-05-313-18/+27
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* firewall: use random GUIDsJason A. Donenfeld2019-05-312-20/+27
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: logical simplificationJason A. Donenfeld2019-05-291-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: allow for disabled ipv6Jason A. Donenfeld2019-05-291-14/+12
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>