Commit Graph

1202 Commits

Author SHA1 Message Date
Andrej Mihajlov 92517bd21e WireGuardApp: Use Bundle.forInfoDictionaryKey to access Info.plist fields
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-15 15:56:22 +01:00
Andrej Mihajlov 761f635e16 WireGuardApp: Refactor indicator initialization
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-15 15:56:22 +01:00
Andrej Mihajlov 44704ba892 WireGuardApp: Fix window background color to default black
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-15 15:56:22 +01:00
Jason A. Donenfeld 9231c03513 global: support DNS search domains
This has been supported by Windows and Linux for quite some time. Add
support here for iOS and macOS.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-15 15:54:12 +01:00
Jason A. Donenfeld 27b32e60b2 WireGuardKitGo: update to latest wireguard-go tag
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-15 13:16:52 +01:00
Jason A. Donenfeld 9d5b376dcf Revert "[REVERT ME SOON] TunnelsManager: Workaround for macOS Catalina deleting tunnels arbitrarily"
This reverts commit 028e76eb3f.

It's been over a year. I really hope this is fixed by Apple.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-11 12:51:16 +01:00
Jason A. Donenfeld 8fd4883d7e WireGuardApp: modify xcodeproj when syncing translations
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-11 12:39:43 +01:00
Andrej Mihajlov d414cec9aa WireGuardKit: Let wireguard-go backend run in offline on macOS
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-11 11:56:05 +01:00
Jason A. Donenfeld 54e3333b72 WireGuardApp: add CrowdIn syncer and run it
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-11 11:34:19 +01:00
Andrej Mihajlov 9f8d0e24df WireGuardKit: Conditionally turn on/off wireguard-go
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-11 11:15:22 +01:00
Jason A. Donenfeld 3de7c99301 WireGuardGoKit: drop support for armv7
Apple and Go have both dropped it, so we do the same.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-09 15:56:35 +01:00
Jason A. Donenfeld d4fd17cd8f global: fix remaining swiftlint violations
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-09 14:35:21 +01:00
Jason A. Donenfeld d875266db5 WireGuardKitGo: get rid of missing -Wno-unused-command-line-argument flag
Recent toolchains error out on it, and it's no longer needed.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-09 14:25:22 +01:00
Jason A. Donenfeld d696e31b6e WireGuardKitGo: rebase boottime patch onto Go 1.15.6
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-09 14:08:45 +01:00
Jason A. Donenfeld 90acf2b220 global: bump year in header
A bit overdue, but better late than never.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-12-04 12:15:29 +01:00
Andrej Mihajlov 27ef0c6dba WireGuardApp: Update target membership to exclude sources that are only used in network extensions
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 11:50:44 +01:00
Andrej Mihajlov 8f67435d4a WireGuardKit: Delegate IPv*Address initialization to self.init
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 11:50:44 +01:00
Andrej Mihajlov b4ebe2440f WireGuardApp: Remove backend version call in Logger.swift & extract wireguard-go version script from network extension targets
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 11:50:44 +01:00
Andrej Mihajlov d440a91b0e WireGuardKit: Log XLAT resolution errors
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 11:50:43 +01:00
Andrej Mihajlov 9e909a3294 WireGuardApp: Disable SWIFT_PRECOMPILE_BRIDGING_HEADER
Clang automatically picks up module.modulemap files from WireGuardKit directories when precompiling bridging header file, which causes the compiler to fail with obscure error.

Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 09:39:09 +01:00
Andrej Mihajlov 75bcf97ab2 WireGuardApp: Update swift version from 4.2 to 5.0
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 09:39:09 +01:00
Andrej Mihajlov 0edde8b46f Update checkout path in README
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 09:39:09 +01:00
Andrej Mihajlov bcc34e0bb6 Keychain: Avoid roundtrip via items when accessing item label (stored in kSecAttrLabel)
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 09:39:09 +01:00
Andrej Mihajlov 90b41aed89 Keychain: Remove unnecessary cast to String in Keychain queries
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 09:39:09 +01:00
Andrej Mihajlov 7930b94981 WireGuardApp: Remove WireGuardKit.swift from Xcode source tree
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 09:39:09 +01:00
Andrej Mihajlov 54a89f6a0e WireGuadKit: Rename WireGuardAdapter.version -> .backendVersion & remove `var wireGuardVersion` with WireGuardKit.swift
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 09:39:09 +01:00
Andrej Mihajlov 8976a53b05 WireGuardApp: Add back the wireguard-go version extraction script and use WIREGUARD_GO_VERSION directly
Avoids linking against libwg-go.a in order to access the WireGuard backend version.

Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 09:39:05 +01:00
Andrej Mihajlov 9849dedf1d WireGuardApp: Include headers from WireGuardKitC
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-04 09:38:31 +01:00
Andrej Mihajlov 547077a808 WireGuardApp: integrate WireGuardKit sources directly
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:25 +01:00
Andrej Mihajlov 0b0898dc3c Remove Sources/ in project folder names
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:25 +01:00
Andrej Mihajlov 9f9d1ffed8 WireGuardKit: Rename WireGuardKitSwift -> WireGuardKit
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:25 +01:00
Andrej Mihajlov 5a044e4129 Linter: Fix all linter issues across the codebase
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:25 +01:00
Andrej Mihajlov 35f0ada8a9 WireGuardApp: Fix build working dir for go-bridge targets
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:25 +01:00
Andrej Mihajlov 39e7ee07ac WireGuardNetworkExtension: Remove wireguard.h from bridging header
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:25 +01:00
Andrej Mihajlov 5a1c9598f1 Fix paths pointing to xcconfigs
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:25 +01:00
Andrej Mihajlov 101a45b6f1 WireGuardKit: Add wireguard-go files to exclude list to eliminate SwiftPM warnings
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:25 +01:00
Andrej Mihajlov fd527f73e6 WireGuardKit: Set publicHeadersPath = "." to flatten public headers structure
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:24 +01:00
Andrej Mihajlov de6aa3eb58 WireGuardKit: Fix module map for WireGuardKitC
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:24 +01:00
Andrej Mihajlov c9eafd82ac WireGuardKit: Fix import statements
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:24 +01:00
Andrej Mihajlov ec57408570 Move all source files to `Sources/` and rename WireGuardKit targets
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:32:24 +01:00
Andrej Mihajlov 9c38a1b897 WireGuardKit: Assert that resolutionResults must not contain failures
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:22:52 +01:00
Andrej Mihajlov b34625f511 WireGuardKit: Only assign self.settingsGenerator upon success to set tunnel network settings to avoid inconsistent state
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:22:52 +01:00
Andrej Mihajlov 2e356d3d8f WireGuardKit: Remove handleLogLine from WireGuardAdapter
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:22:52 +01:00
Andrej Mihajlov 697d449dc8 WireGuardKit: Remove isStarted: bool from WireGuardAdapter
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:22:52 +01:00
Andrej Mihajlov 4f9f61f7a7 WireGuardKit: Fix docs for WireGuardAdapterError
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:22:52 +01:00
Andrej Mihajlov bceb0a827d WireGuardKit: Fix docs for WireGuardLogLevel
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:22:52 +01:00
Andrej Mihajlov 2329f712cf WireGuardKit: Pass logHandler via constructor
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:22:52 +01:00
Andrej Mihajlov d2c38702c8 Packet tunnel: Remove last error in the completion handler given to adapter.stop
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:22:52 +01:00
Andrej Mihajlov def921801f WireGuardKit: Rename cannotLocateSocketDescriptor -> cannotLocateTunnelFileDescriptor in WireGuardAdapterError
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:22:52 +01:00
Andrej Mihajlov 41e006a407 WireGuardApp: Switch WireGuardKit to master branch
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
2020-12-03 13:22:52 +01:00