aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/manager (follow)
Commit message (Collapse)AuthorAgeFilesLines
* global: bump dateJason A. Donenfeld2022-01-068-8/+8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: interface{} -> anyJason A. Donenfeld2021-12-161-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: apply gofumptJason A. Donenfeld2021-12-095-13/+29
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: check for WeakHostSend/Forwarding in pitfallsJason A. Donenfeld2021-11-082-95/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: cleanup legacy wintunJason A. Donenfeld2021-10-291-0/+2
| | | | | | | | | | It's not good to leave cruft around from the upgrade case when people want to uninstall, so we remove wintun in the uninstaller manually (without the help of wintun.dll, which we no longer ship). But also, so that we can eventually drop that code, we also remove it opportunistically when the manager starts. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: use pre-seeded fastrandn instead of math.randJason A. Donenfeld2021-10-281-2/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: delay boottime updates and simplifyJason A. Donenfeld2021-10-271-11/+18
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: pitfalls: cap virtio check to min 40 for ParallelsJason A. Donenfeld2021-10-261-1/+2
| | | | | | | | It looks like Parallels forked NetKVM from Red Hat and changed the versioning scheme, but kept the same driver name. So we skip the warning for a floor of v40. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* services: use more reliable method of detecting boot-upJason A. Donenfeld2021-10-264-11/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* mod: bump for x/sys changesJason A. Donenfeld2021-10-211-59/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: warn about dnscache and old virtio driverJason A. Donenfeld2021-10-202-0/+138
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: remove wireguard-go/Wintun implementationJason A. Donenfeld2021-10-164-134/+18
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: remove legacy store supportJason A. Donenfeld2021-10-162-80/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: use newer wireguard-go APIsJason A. Donenfeld2021-10-123-66/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: use unsafe.Slice instead of unsafeSliceJason A. Donenfeld2021-10-111-6/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* driver: use new APIJason A. Donenfeld2021-10-054-38/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: reinitialize configuration after PnP flaps driver on <10Jason A. Donenfeld2021-09-141-2/+1
| | | | | | | | | | On older Windows, PnP will unload the driver and reload it. This makes multiple tunnels impossible, as we knew. But this also happens when various adapter settings change, like ICS, which is maybe a bigger issue. Solve this by reloading the configuration after these flaps. Reported-by: Harland Coles <harland.coles@energy-x.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: prefer WireGuardNT over wireguard-go/WintunJason A. Donenfeld2021-09-122-1/+7
| | | | | | Also remove Wintun driver on startup. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: disable multiple tunnels on pre-win10Jason A. Donenfeld2021-09-101-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: make multiple tunnels mode automaticJason A. Donenfeld2021-08-131-32/+37
| | | | | | | | | Rather than having to set a registry knob to enable multiple tunnels, it is now automatic. If an additional activated tunnel has the same route subnets or interface IP addresses as a previous tunnel, that previous one is stopped. But if there's no overlap, then they coexist. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: do both wgnt and wintun cleanupsJason A. Donenfeld2021-08-091-31/+28
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: track externally created tunnelsJason A. Donenfeld2021-08-092-29/+94
| | | | | Requested-by: Bruno UT1 <bandry@ut1.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* driver: break encapsulation and pass timestamp to ringloggerJason A. Donenfeld2021-08-081-1/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: show update tab but not alert for limited userJason A. Donenfeld2021-08-041-4/+1
| | | | | Suggested-by: Diab Neiroukh <lazerl0rd@thezest.dev> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* driver: introduce new module for talking with kernel driverJason A. Donenfeld2021-08-024-40/+155
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: list unencrypted conf filesJason A. Donenfeld2021-06-251-1/+1
| | | | | | | | By ignoring unencrypted ones, the tunnel tracker would miss running configurations at startup. Reported-by: Станислав Мацак <smatsak@mail.ru> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: do not terminate current process when intended target is childJason A. Donenfeld2021-06-221-1/+5
| | | | | | | If we've already collected this, handle is -1, which is current process. Catch this case. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: manually use CreateProcess for launching UI processJason A. Donenfeld2021-06-182-26/+108
| | | | | | | | | Go's standard library for this is buggy (PID races, handle races) and requires passing NUL, which we don't really care about for Windows. Simplify and speed up process creation by only passing exactly what we need. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: rewrite service arguments when migrating configsJason A. Donenfeld2021-06-183-54/+47
| | | | | | | | | | | If a service is installed already, it's a good idea to migrate its conf argument when migrating the file name, so that these don't get out of sync. We're already doing this when migrating from the legacy config store, so this is also an opportunity to clean up that code a bit and quit using regexes. Reported-by: Станислав Мацак <smatsak@mail.ru> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: use new DialConfig struct for pipeJason A. Donenfeld2021-03-051-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: use non-stuttering function nameJason A. Donenfeld2021-03-051-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: use CloseHandle rather than CloseJason A. Donenfeld2021-02-021-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: use stricter handle inheritabilityJason A. Donenfeld2021-02-022-83/+25
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: move away from ioutilJason A. Donenfeld2021-02-011-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: bump copyright dateJason A. Donenfeld2021-02-019-9/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: pipeline UAPI requestsJason A. Donenfeld2021-02-013-19/+88
| | | | | | This avoids the somewhat expensive pipe setup. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: do not raise error if manager service is already startingJason A. Donenfeld2020-12-171-0/+6
| | | | | | | | | | If the service is in StartPending state, then it means that we were *just* started by something else, so return success here, assuming the other program starting this does the right thing. This can happen when, e.g., the updater relaunches the manager service and then invokes wireguard.exe to raise the UI. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ringlogger: hook into global panic writerJason A. Donenfeld2020-12-095-23/+0
| | | | | | | | | | | This is a grotesque hack, and hopefully upstream Go will provide a nicer way of doing this, but already it seems quite adept at catching panics. See https://github.com/golang/go/issues/42888 for more info. This requires us to rewrite the ringlogger path to avoid all allocations. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: use service subscriptions on win 8+Jason A. Donenfeld2020-12-091-76/+164
| | | | | | | | Work in progress, but this should be more reliable than the older Win 7 code. It's still unclear what the role of checkForDisabled is to be for the Win 8+ path. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: do not respond to update state requests for non-elevatedJason A. Donenfeld2020-11-281-0/+3
| | | | | Reported-by: Simon Rozman <simon@rozman.si> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: separate out migration and print errorsJason A. Donenfeld2020-11-271-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: move legacy store from confJason A. Donenfeld2020-11-272-0/+131
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: rework migration flows around a single Save()Jason A. Donenfeld2020-11-271-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: do exponential back off for sharing violation in hotfolderJason A. Donenfeld2020-11-271-1/+1
| | | | | | | | | | | | | | | | | Windows gives us notifications about writes to files in a directory, but it does not give us notifications on when file handles are closed and when we can expect to be able to grab a handle to it; this would be racey at best. So, there always exists a race between the writer's last call to WriteFile() and its eventual CloseHandle(). Work around this by implementing a basic exponential back off of retrying the open call. While we're at it, clean up the "file already exists" logic to remove a basic toctou situation, and switch to using random temp file names in order to handle better the case of saving a new file from two different administrators at once. Reported-by: Jim Salter <jim@jrs-s.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: styleJason A. Donenfeld2020-11-231-1/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: cleanup pipes on failureJason A. Donenfeld2020-11-231-0/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: update headersJason A. Donenfeld2020-11-228-8/+8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: allow multiple tunnels if admin knob allows itJason A. Donenfeld2020-11-221-24/+27
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: move IPC notification to go routine per clientJason A. Donenfeld2020-11-221-2/+15
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: allow S-1-5-32-556 users to launch a limited UIJason A. Donenfeld2020-11-222-25/+77
| | | | | | | | | | | | | | | | | I still have serious security reservations about this, both conceptually -- should users be allowed to do this stuff? -- and pratically -- there are issues with this implementation that need some examination. TODO: - Is that registry key a secure path? Should we double check it? - Are we leaking handles to the unpriv'd process from the manager? Audit this too. - IPC notifications are blocking. Should we move this to a go routine to mitigate DoS potential? - Is GOB deserialization secure? Can an NCO user crash or RCE the manager? Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>