aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuardNetworkExtension (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move all source files to `Sources/` and rename WireGuardKit targetsAndrej Mihajlov2020-12-036-226/+0
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* WireGuardKit: Pass logHandler via constructorAndrej Mihajlov2020-12-031-6/+5
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* Packet tunnel: Remove last error in the completion handler given to adapter.stopAndrej Mihajlov2020-12-031-2/+2
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* WireGuardKit: Rename cannotLocateSocketDescriptor -> cannotLocateTunnelFileDescriptor in WireGuardAdapterErrorAndrej Mihajlov2020-12-031-2/+2
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* Packet tunnel: Implement packet tunnel provider using WireGuardAdapterAndrej Mihajlov2020-12-021-135/+76
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* iOS/macOS: Integrate WireGuardKitAndrej Mihajlov2020-12-022-4/+0
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* WireGuardKit: Move shared structs to WireGuardKitAndrej Mihajlov2020-12-022-316/+0
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* Change QoS to .utilityAndrej Mihajlov2020-06-251-1/+1
| | | | | | | | As per comment by eskimo: https://developer.apple.com/forums/thread/107904?answerId=328525022#328525022 Signed-off-by: Andrej Mihajlov <and@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Make sure that the tunnel and path monitor run on the same serial queueAndrej Mihajlov2020-06-251-75/+87
| | | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Fix retain cycle between NWPathMonitor and PacketTunnelProviderAndrej Mihajlov2020-06-251-1/+3
| | | | | | | See: https://www.marisibrothers.com/2017/04/memory-leak-in-swift-assigning-function.html Signed-off-by: Andrej Mihajlov <and@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Refactor interface name queryAndrej Mihajlov2020-06-251-7/+25
| | | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wireguard-go-bridge: use C string instead of gostring_tAndrej Mihajlov2020-02-071-11/+4
| | | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Revert "NetworkExtension: don't use exit(0) hack on Catalina"Jason A. Donenfeld2019-10-151-4/+1
| | | | | | | | This reverts commit 3619279a65d9a506fb13d7f24909b38a5202fa8f. Still broken! Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* NetworkExtension: don't use exit(0) hack on CatalinaJason A. Donenfeld2019-10-151-1/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelProvider: remove all clevernessJason A. Donenfeld2019-06-101-5/+1
| | | | | | | This will cause more socket flaps than necessary but hopefully will fix some bugs. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelProvider: store the entire NWPathJason A. Donenfeld2019-06-091-6/+3
| | | | | | | | Otherwise [utun0, en0] == [en0, utun0] before WiFi has connected, and we wind up not rebinding after WiFi does successfully connect, which means people have trouble when resuming from sleep. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* NetworkExtension: bump sockets on path changeJason A. Donenfeld2019-05-311-10/+12
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* NetworkExtension: apparently the extension process is scoped properly anywayJason A. Donenfeld2019-05-262-34/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* NetworkExtension: use excludedRoutes instead of binding on iOSJason A. Donenfeld2019-05-262-1/+25
| | | | | | | | The networking stack there is to flaky and the notifier doesn't always fire correctly. Hopefully excludedRoutes works well with XLAT; otherwise we're in trouble. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Swift 5 migration: Fix switch warningsRoopesh Chander2019-04-091-0/+2
| | | | | | | | | | We now get a warning when switching over enums from system frameworks even when we handle all public cases because there can be future cases that aren't handled. When such a future case is introduced, we'll get a warning. Signed-off-by: Roopesh Chander <roop@roopc.net>
* ringlogger: support mpsc for singlefileJason A. Donenfeld2019-03-171-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Global: fix swiftlint issuesJason A. Donenfeld2019-02-081-1/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Info.plist: Add missing key types0.0.20190207-1Jason A. Donenfeld2019-02-081-0/+2
| | | | | | | | I worry that LSMinimumSystemVersion in the extension's plist might be problematic, since that same plist runs on macOS and iOS. We _might_ need to bifurcate. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Key: Use C implementation insteadJason A. Donenfeld2019-02-081-0/+1
| | | | | | | Swift compiles so slowly and it's unclear all of the insane type punning was even correct. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Key: Constant time encodingJason A. Donenfeld2019-02-081-12/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* PacketTunnelProvider: proper fix for 32073323Jason A. Donenfeld2019-02-071-0/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Keychain: store configurations in keychain instead of providerConfigJason A. Donenfeld2019-02-061-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Tunnel: support getting runtime configurationJason A. Donenfeld2019-01-241-0/+18
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* macOS: remove mobile network tweeksJason A. Donenfeld2019-01-222-2/+15
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Better os() directivesRoopesh Chander2019-01-221-1/+3
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* macOS: Use tunnelOverheadBytes for automatic MTU in macOSRoopesh Chander2019-01-161-4/+8
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* macOS: NE: Add entitlements for making network connectionsRoopesh Chander2019-01-141-0/+4
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Make app groups work on both iOS and macOSRoopesh Chander2019-01-142-3/+9
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* iOS: Fix WireGuardNetworkExtensioniOS targetRoopesh Chander2019-01-141-0/+0
| | | | | | - Rename WireGuardNetworkExtension.entitlements to WireGuardNetworkExtension_iOS.entitlements Signed-off-by: Roopesh Chander <roop@roopc.net>
* macOS: Fix WireGuardNetworkExtensionmacOS targetRoopesh Chander2019-01-141-0/+12
| | | | | | | | | | | - Build using common network extension code - Add run scripts - Set Info.plist to common network extension's Info.plist - Move entitlements to common network extension folder - Remove Xcode-generated macOS network extension code - Set Swift-Obj-C bridging header Signed-off-by: Roopesh Chander <roop@roopc.net>
* xcconfig: Make app id platform-specificRoopesh Chander2019-01-142-2/+2
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* PacketTunnelSettingsGenerator: use 127.0.0.1 as dummy addressJason A. Donenfeld2019-01-081-3/+1
| | | | | | | It turns out that using 0.0.0.0 somehow conflicts with DNS lookups when CLAT is in use. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Avoid dynamic MTU calculations for nowJason A. Donenfeld2019-01-071-5/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Update copyrightJason A. Donenfeld2019-01-074-4/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Rework DNS and routes in network extensionJason A. Donenfeld2018-12-283-92/+77
| | | | | | | | | | | | | | | | | The DNS resolver prior had useless comments, awful nesting, converted bytes into strings and back into bytes, and generally made no sense. That's been rewritten now. But more fundumentally, this commit made the DNS resolver actually accomplish its objective, by passing AI_ALL to it. It turns out, though, that the Go library isn't actually using GAI in the way we need for parsing IP addresses, so we actually need to do another round, this time with hints flag as zero, so that we get the DNS64 address. Additionally, since we're now binding sockets to interfaces, we can entirely remove the excludedRoutes logic. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* NetworkExtension: rescope socket instead of tearing down socketJason A. Donenfeld2018-12-262-21/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Rely on availability of fd only after setting network settingsJason A. Donenfeld2018-12-221-29/+24
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Retain aggressive socket reestablishment for nowJason A. Donenfeld2018-12-221-1/+2
| | | | | | This can be reverted once we've done more testing. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* All models now EquatableEric Kuck2018-12-211-0/+4
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Do not crash if we can't get socket.fileDescriptorJason A. Donenfeld2018-12-221-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Removing a tunnel from iOS's settings is now immediately reflected in appEric Kuck2018-12-211-4/+0
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Localize remaining strings in network extensionJason A. Donenfeld2018-12-222-33/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Combine double log invocationsJason A. Donenfeld2018-12-221-3/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Move name from interface to tunnelJason A. Donenfeld2018-12-221-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Nuke trailing spacesJason A. Donenfeld2018-12-212-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>