diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index df3f38cb87..81aeb0a5f0 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -1210,6 +1210,8 @@ 4B4D60E22A0C883A00BCD287 /* AppMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4D60E12A0C883A00BCD287 /* AppMain.swift */; }; 4B4D60E32A0C883A00BCD287 /* AppMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4D60E12A0C883A00BCD287 /* AppMain.swift */; }; 4B4F72EC266B2ED300814C60 /* CollectionExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4F72EB266B2ED300814C60 /* CollectionExtension.swift */; }; + 4B5235452C7BB14D00AFAF64 /* WireGuard in Frameworks */ = {isa = PBXBuildFile; productRef = 4B5235442C7BB14D00AFAF64 /* WireGuard */; }; + 4B5235472C7BB15700AFAF64 /* WireGuard in Frameworks */ = {isa = PBXBuildFile; productRef = 4B5235462C7BB15700AFAF64 /* WireGuard */; }; 4B59023E26B35F3600489384 /* ChromiumLoginReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B59023926B35F3600489384 /* ChromiumLoginReader.swift */; }; 4B59024026B35F3600489384 /* ChromiumDataImporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B59023B26B35F3600489384 /* ChromiumDataImporter.swift */; }; 4B59024826B3673600489384 /* ThirdPartyBrowser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B59024726B3673600489384 /* ThirdPartyBrowser.swift */; }; @@ -4441,6 +4443,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 4B5235452C7BB14D00AFAF64 /* WireGuard in Frameworks */, 37269F012B332FC8005E8E46 /* Common in Frameworks */, 9D9DE57B2C63AA1F00D20B15 /* AppKitExtensions in Frameworks */, EE7295E92A545BC4008C0991 /* NetworkProtection in Frameworks */, @@ -4505,6 +4508,7 @@ buildActionMask = 2147483647; files = ( F1DF95E52BD1807C0045E591 /* Subscription in Frameworks */, + 4B5235472C7BB15700AFAF64 /* WireGuard in Frameworks */, 37269EFF2B332FBB005E8E46 /* Common in Frameworks */, EE7295E72A545BBB008C0991 /* NetworkProtection in Frameworks */, F198C7162BD18A44000BF24D /* PixelKit in Frameworks */, @@ -8857,6 +8861,7 @@ 7B37C7A42BAA32A50062546A /* Subscription */, F198C7172BD18A4C000BF24D /* PixelKit */, 9D9DE57A2C63AA1F00D20B15 /* AppKitExtensions */, + 4B5235442C7BB14D00AFAF64 /* WireGuard */, ); productName = NetworkProtectionSystemExtension; productReference = 4B25375A2A11BE7300610219 /* com.duckduckgo.macos.vpn.network-extension.debug.systemextension */; @@ -8978,6 +8983,7 @@ F198C7152BD18A44000BF24D /* PixelKit */, 7B2366872C09FADA002D393F /* VPNAppLauncher */, 9D9DE5762C63AA1600D20B15 /* AppKitExtensions */, + 4B5235462C7BB15700AFAF64 /* WireGuard */, ); productName = NetworkProtectionAppExtension; productReference = 4B4D603D2A0B290200BCD287 /* NetworkProtectionAppExtension.appex */; @@ -9321,6 +9327,7 @@ B6F997B92B8F352500476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */, F1D43AF12B98E47800BAB743 /* XCRemoteSwiftPackageReference "BareBonesBrowser" */, 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */, + 4B5235432C7BB14D00AFAF64 /* XCRemoteSwiftPackageReference "wireguard-apple" */, ); productRefGroup = AA585D7F248FD31100E9A3E2 /* Products */; projectDirPath = ""; @@ -13532,12 +13539,20 @@ revision = c06709ba8a586f6a40190bacaaaaa96b2d55e540; }; }; + 4B5235432C7BB14D00AFAF64 /* XCRemoteSwiftPackageReference "wireguard-apple" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/duckduckgo/wireguard-apple"; + requirement = { + kind = exactVersion; + version = 1.1.3; + }; + }; 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 186.1.0; + version = 187.0.0; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { @@ -13814,6 +13829,16 @@ isa = XCSwiftPackageProductDependency; productName = NetworkProtectionUI; }; + 4B5235442C7BB14D00AFAF64 /* WireGuard */ = { + isa = XCSwiftPackageProductDependency; + package = 4B5235432C7BB14D00AFAF64 /* XCRemoteSwiftPackageReference "wireguard-apple" */; + productName = WireGuard; + }; + 4B5235462C7BB15700AFAF64 /* WireGuard */ = { + isa = XCSwiftPackageProductDependency; + package = 4B5235432C7BB14D00AFAF64 /* XCRemoteSwiftPackageReference "wireguard-apple" */; + productName = WireGuard; + }; 4B5F14FB2A15291D0060320F /* InputFilesChecker */ = { isa = XCSwiftPackageProductDependency; productName = "plugin:InputFilesChecker"; diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 2b8ba57fc4..3423380f00 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "606ccf9e86f5cad3ae83132f46241357feecf152", - "version" : "186.1.0" + "revision" : "db0a7b47918ccfea0946d88424415c104f67c37d", + "version" : "187.0.0" } }, { @@ -104,8 +104,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/privacy-dashboard", "state" : { - "revision" : "36dc07cba4bc1e7e0c1d1fb679c3cd077694a072", - "version" : "5.0.0" + "revision" : "665b23dc656c9f787494620494f8e56098a900b2", + "version" : "5.1.1" } }, { diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift index 46a84aeca7..0843f59a93 100644 --- a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift @@ -24,6 +24,7 @@ import NetworkExtension import Networking import PixelKit import Subscription +import WireGuard final class MacPacketTunnelProvider: PacketTunnelProvider { @@ -461,6 +462,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { tunnelHealthStore: tunnelHealthStore, controllerErrorStore: controllerErrorStore, snoozeTimingStore: NetworkProtectionSnoozeTimingStore(userDefaults: .netP), + wireGuardInterface: DefaultWireGuardInterface(), keychainType: Bundle.keychainType, tokenStore: tokenStore, debugEvents: debugEvents, @@ -626,3 +628,33 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { } } + +final class DefaultWireGuardInterface: WireGuardInterface { + func turnOn(settings: UnsafePointer, handle: Int32) -> Int32 { + wgTurnOn(settings, handle) + } + + func turnOff(handle: Int32) { + wgTurnOff(handle) + } + + func getConfig(handle: Int32) -> UnsafeMutablePointer? { + return wgGetConfig(handle) + } + + func setConfig(handle: Int32, config: String) -> Int64 { + return wgSetConfig(handle, config) + } + + func bumpSockets(handle: Int32) { + wgBumpSockets(handle) + } + + func disableSomeRoamingForBrokenMobileSemantics(handle: Int32) { + wgDisableSomeRoamingForBrokenMobileSemantics(handle) + } + + func setLogger(context: UnsafeMutableRawPointer?, logFunction: (@convention(c) (UnsafeMutableRawPointer?, Int32, UnsafePointer?) -> Void)?) { + wgSetLogger(context, logFunction) + } +} diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index c95a1baf87..3c05ff905c 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "186.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "187.0.0"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper"), ], diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index a77a119908..d34968d47d 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "186.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "187.0.0"), .package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"), .package(path: "../AppLauncher"), .package(path: "../UDSHelper"), diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index e488e81990..9169d430dd 100644 --- a/LocalPackages/SubscriptionUI/Package.swift +++ b/LocalPackages/SubscriptionUI/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["SubscriptionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "186.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "187.0.0"), .package(path: "../SwiftUIExtensions") ], targets: [