From 9445b825d01d5d78296f1bc733e493eb8d9709ba Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 23 May 2019 20:15:42 +0200 Subject: [PATCH 01/12] Make AppExtension generic - Make AppExtension a standalone util subspec - Move OpenVPN tunnel provider to OpenVPN subspec - Move Utils to Core subspec - Depend OpenVPN on Core + AppExtension --- TunnelKit.podspec | 20 ++-- TunnelKit.xcodeproj/project.pbxproj | 62 ++++++++--- .../Sources/AppExtension/GenericSocket.swift | 6 +- .../Sources/AppExtension/LinkProducer.swift | 30 +++++ ...NETCPInterface.swift => NETCPSocket.swift} | 76 +------------ ...NEUDPInterface.swift => NEUDPSocket.swift} | 57 +--------- .../{AppExtension => Core}/DNSResolver.swift | 0 .../{AppExtension => Core}/Utils.swift | 0 .../AppExtension/ConnectionStrategy.swift | 0 .../OpenVPN/AppExtension/NETCPLink.swift | 103 ++++++++++++++++++ .../OpenVPN/AppExtension/NEUDPLink.swift | 84 ++++++++++++++ .../TunnelKitProvider+Configuration.swift | 0 .../TunnelKitProvider+Interaction.swift | 0 .../AppExtension/TunnelKitProvider.swift | 6 +- 14 files changed, 278 insertions(+), 166 deletions(-) create mode 100644 TunnelKit/Sources/AppExtension/LinkProducer.swift rename TunnelKit/Sources/AppExtension/Transport/{NETCPInterface.swift => NETCPSocket.swift} (74%) rename TunnelKit/Sources/AppExtension/Transport/{NEUDPInterface.swift => NEUDPSocket.swift} (82%) rename TunnelKit/Sources/{AppExtension => Core}/DNSResolver.swift (100%) rename TunnelKit/Sources/{AppExtension => Core}/Utils.swift (100%) rename TunnelKit/Sources/{ => OpenVPN}/AppExtension/ConnectionStrategy.swift (100%) create mode 100644 TunnelKit/Sources/OpenVPN/AppExtension/NETCPLink.swift create mode 100644 TunnelKit/Sources/OpenVPN/AppExtension/NEUDPLink.swift rename TunnelKit/Sources/{ => OpenVPN}/AppExtension/TunnelKitProvider+Configuration.swift (100%) rename TunnelKit/Sources/{ => OpenVPN}/AppExtension/TunnelKitProvider+Interaction.swift (100%) rename TunnelKit/Sources/{ => OpenVPN}/AppExtension/TunnelKitProvider.swift (99%) diff --git a/TunnelKit.podspec b/TunnelKit.podspec index f6c2325..33319d5 100644 --- a/TunnelKit.podspec +++ b/TunnelKit.podspec @@ -12,7 +12,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = "11.0" s.osx.deployment_target = "10.11" - s.default_subspecs = "Core", "OpenVPN", "AppExtension" + s.default_subspecs = "OpenVPN" s.subspec "Core" do |p| p.source_files = "TunnelKit/Sources/Core/**/*.{h,m,swift}" @@ -25,6 +25,15 @@ Pod::Spec.new do |s| p.libraries = "resolv" end + s.subspec "AppExtension" do |p| + p.source_files = "TunnelKit/Sources/AppExtension/**/*.swift" + p.frameworks = "NetworkExtension" + p.pod_target_xcconfig = { "APPLICATION_EXTENSION_API_ONLY" => "YES" } + + p.dependency "SwiftyBeaver" + p.dependency "TunnelKit/Core" + end + s.subspec "OpenVPN" do |p| p.source_files = "TunnelKit/Sources/OpenVPN/**/*.{h,m,swift}" p.private_header_files = "TunnelKit/Sources/OpenVPN/**/*.h" @@ -34,14 +43,7 @@ Pod::Spec.new do |s| "APPLICATION_EXTENSION_API_ONLY" => "YES" } p.dependency "TunnelKit/Core" - end - - s.subspec "AppExtension" do |p| - p.source_files = "TunnelKit/Sources/AppExtension/**/*.swift" - p.frameworks = "NetworkExtension" - p.pod_target_xcconfig = { "APPLICATION_EXTENSION_API_ONLY" => "YES" } - - p.dependency "TunnelKit/OpenVPN" + p.dependency "TunnelKit/AppExtension" end s.subspec "LZO" do |p| diff --git a/TunnelKit.xcodeproj/project.pbxproj b/TunnelKit.xcodeproj/project.pbxproj index b366f03..1be6bf9 100644 --- a/TunnelKit.xcodeproj/project.pbxproj +++ b/TunnelKit.xcodeproj/project.pbxproj @@ -51,6 +51,12 @@ 0E12B2A921456C0200B4BAE9 /* ControlChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E12B2A721456C0200B4BAE9 /* ControlChannel.swift */; }; 0E12B2AB2145E01700B4BAE9 /* ControlChannelSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E12B2AA2145E01700B4BAE9 /* ControlChannelSerializer.swift */; }; 0E12B2AC2145E01700B4BAE9 /* ControlChannelSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E12B2AA2145E01700B4BAE9 /* ControlChannelSerializer.swift */; }; + 0E23B3D02297192900304C30 /* NETCPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3CF2297192900304C30 /* NETCPLink.swift */; }; + 0E23B3D12297192900304C30 /* NETCPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3CF2297192900304C30 /* NETCPLink.swift */; }; + 0E23B3D32297193000304C30 /* NEUDPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3D22297193000304C30 /* NEUDPLink.swift */; }; + 0E23B3D42297193000304C30 /* NEUDPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3D22297193000304C30 /* NEUDPLink.swift */; }; + 0E23B3DE229749C600304C30 /* LinkProducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3DD229749C600304C30 /* LinkProducer.swift */; }; + 0E23B3DF229749C600304C30 /* LinkProducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3DD229749C600304C30 /* LinkProducer.swift */; }; 0E245D6C2137F73600B012A2 /* CompressionFramingNative.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E245D6B2137F73600B012A2 /* CompressionFramingNative.h */; }; 0E39BCE8214B2AB60035E9DE /* ControlPacket.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */; }; 0E39BCE9214B2AB60035E9DE /* ControlPacket.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */; }; @@ -130,14 +136,14 @@ 0EE2F9AD2291853D00F56F49 /* Session.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9AB2291853D00F56F49 /* Session.swift */; }; 0EE2F9EE22918DA100F56F49 /* ConnectionStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9DE22918DA100F56F49 /* ConnectionStrategy.swift */; }; 0EE2F9EF22918DA100F56F49 /* ConnectionStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9DE22918DA100F56F49 /* ConnectionStrategy.swift */; }; - 0EE2F9F022918DA100F56F49 /* NETCPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E022918DA100F56F49 /* NETCPInterface.swift */; }; - 0EE2F9F122918DA100F56F49 /* NETCPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E022918DA100F56F49 /* NETCPInterface.swift */; }; + 0EE2F9F022918DA100F56F49 /* NETCPSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E022918DA100F56F49 /* NETCPSocket.swift */; }; + 0EE2F9F122918DA100F56F49 /* NETCPSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E022918DA100F56F49 /* NETCPSocket.swift */; }; 0EE2F9F222918DA100F56F49 /* NETunnelInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E122918DA100F56F49 /* NETunnelInterface.swift */; }; 0EE2F9F322918DA100F56F49 /* NETunnelInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E122918DA100F56F49 /* NETunnelInterface.swift */; }; 0EE2F9F422918DA100F56F49 /* NWTCPConnectionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E222918DA100F56F49 /* NWTCPConnectionState+Description.swift */; }; 0EE2F9F522918DA100F56F49 /* NWTCPConnectionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E222918DA100F56F49 /* NWTCPConnectionState+Description.swift */; }; - 0EE2F9F622918DA100F56F49 /* NEUDPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E322918DA100F56F49 /* NEUDPInterface.swift */; }; - 0EE2F9F722918DA100F56F49 /* NEUDPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E322918DA100F56F49 /* NEUDPInterface.swift */; }; + 0EE2F9F622918DA100F56F49 /* NEUDPSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E322918DA100F56F49 /* NEUDPSocket.swift */; }; + 0EE2F9F722918DA100F56F49 /* NEUDPSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E322918DA100F56F49 /* NEUDPSocket.swift */; }; 0EE2F9F822918DA100F56F49 /* NWUDPSessionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E422918DA100F56F49 /* NWUDPSessionState+Description.swift */; }; 0EE2F9F922918DA100F56F49 /* NWUDPSessionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E422918DA100F56F49 /* NWUDPSessionState+Description.swift */; }; 0EE2F9FA22918DA100F56F49 /* DNSResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E522918DA100F56F49 /* DNSResolver.swift */; }; @@ -330,6 +336,9 @@ 0E12B2A721456C0200B4BAE9 /* ControlChannel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlChannel.swift; sourceTree = ""; }; 0E12B2AA2145E01700B4BAE9 /* ControlChannelSerializer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlChannelSerializer.swift; sourceTree = ""; }; 0E17D7F91F730D9F009EE129 /* TunnelKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TunnelKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 0E23B3CF2297192900304C30 /* NETCPLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NETCPLink.swift; sourceTree = ""; }; + 0E23B3D22297193000304C30 /* NEUDPLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NEUDPLink.swift; sourceTree = ""; }; + 0E23B3DD229749C600304C30 /* LinkProducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkProducer.swift; sourceTree = ""; }; 0E245D6B2137F73600B012A2 /* CompressionFramingNative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompressionFramingNative.h; sourceTree = ""; }; 0E3251C51F95770D00C108D9 /* TunnelKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TunnelKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ControlPacket.h; sourceTree = ""; }; @@ -378,10 +387,10 @@ 0EE2F9792291817300F56F49 /* Errors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = ""; }; 0EE2F9AB2291853D00F56F49 /* Session.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Session.swift; sourceTree = ""; }; 0EE2F9DE22918DA100F56F49 /* ConnectionStrategy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionStrategy.swift; sourceTree = ""; }; - 0EE2F9E022918DA100F56F49 /* NETCPInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NETCPInterface.swift; sourceTree = ""; }; + 0EE2F9E022918DA100F56F49 /* NETCPSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NETCPSocket.swift; sourceTree = ""; }; 0EE2F9E122918DA100F56F49 /* NETunnelInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NETunnelInterface.swift; sourceTree = ""; }; 0EE2F9E222918DA100F56F49 /* NWTCPConnectionState+Description.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NWTCPConnectionState+Description.swift"; sourceTree = ""; }; - 0EE2F9E322918DA100F56F49 /* NEUDPInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NEUDPInterface.swift; sourceTree = ""; }; + 0EE2F9E322918DA100F56F49 /* NEUDPSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NEUDPSocket.swift; sourceTree = ""; }; 0EE2F9E422918DA100F56F49 /* NWUDPSessionState+Description.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NWUDPSessionState+Description.swift"; sourceTree = ""; }; 0EE2F9E522918DA100F56F49 /* DNSResolver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DNSResolver.swift; sourceTree = ""; }; 0EE2F9E622918DA100F56F49 /* TunnelKitProvider+Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TunnelKitProvider+Configuration.swift"; sourceTree = ""; }; @@ -602,6 +611,19 @@ path = Sources; sourceTree = ""; }; + 0E23B3CE2297190E00304C30 /* AppExtension */ = { + isa = PBXGroup; + children = ( + 0EE2F9DE22918DA100F56F49 /* ConnectionStrategy.swift */, + 0E23B3CF2297192900304C30 /* NETCPLink.swift */, + 0E23B3D22297193000304C30 /* NEUDPLink.swift */, + 0EE2F9EA22918DA100F56F49 /* TunnelKitProvider.swift */, + 0EE2F9E622918DA100F56F49 /* TunnelKitProvider+Configuration.swift */, + 0EE2F9EC22918DA100F56F49 /* TunnelKitProvider+Interaction.swift */, + ); + path = AppExtension; + sourceTree = ""; + }; 0E58BEDC2240521F006FB157 /* LZO */ = { isa = PBXGroup; children = ( @@ -657,6 +679,7 @@ 0EB03E0A2290A338006D03A0 /* OpenVPN */ = { isa = PBXGroup; children = ( + 0E23B3CE2297190E00304C30 /* AppExtension */, 0EFEB43A2006D3C800F81029 /* Authenticator.swift */, 0E58BF522240FAA6006FB157 /* CompressionAlgorithm.swift */, 0E58BF4F2240F98E006FB157 /* CompressionAlgorithmNative.h */, @@ -713,16 +736,11 @@ isa = PBXGroup; children = ( 0EE2F9DF22918DA100F56F49 /* Transport */, - 0EE2F9DE22918DA100F56F49 /* ConnectionStrategy.swift */, - 0EE2F9E522918DA100F56F49 /* DNSResolver.swift */, 0EE2F9E922918DA100F56F49 /* GenericSocket.swift */, 0EE2F9ED22918DA100F56F49 /* InterfaceObserver.swift */, 0EE2F9E722918DA100F56F49 /* Keychain.swift */, + 0E23B3DD229749C600304C30 /* LinkProducer.swift */, 0EE2F9E822918DA100F56F49 /* MemoryDestination.swift */, - 0EE2F9EA22918DA100F56F49 /* TunnelKitProvider.swift */, - 0EE2F9E622918DA100F56F49 /* TunnelKitProvider+Configuration.swift */, - 0EE2F9EC22918DA100F56F49 /* TunnelKitProvider+Interaction.swift */, - 0EE2F9EB22918DA100F56F49 /* Utils.swift */, ); path = AppExtension; sourceTree = ""; @@ -730,10 +748,10 @@ 0EE2F9DF22918DA100F56F49 /* Transport */ = { isa = PBXGroup; children = ( - 0EE2F9E022918DA100F56F49 /* NETCPInterface.swift */, + 0EE2F9E022918DA100F56F49 /* NETCPSocket.swift */, 0EE2F9E122918DA100F56F49 /* NETunnelInterface.swift */, + 0EE2F9E322918DA100F56F49 /* NEUDPSocket.swift */, 0EE2F9E222918DA100F56F49 /* NWTCPConnectionState+Description.swift */, - 0EE2F9E322918DA100F56F49 /* NEUDPInterface.swift */, 0EE2F9E422918DA100F56F49 /* NWUDPSessionState+Description.swift */, ); path = Transport; @@ -750,6 +768,7 @@ 0EFEB4432006D3C800F81029 /* Data+Manipulation.swift */, 0E411B992271F90700E0852C /* DNS.h */, 0E411B9A2271F90700E0852C /* DNS.m */, + 0EE2F9E522918DA100F56F49 /* DNSResolver.swift */, 0E011F7C2196D97200BA59EE /* EndpointProtocol.swift */, 0EFEB4362006D3C800F81029 /* Errors.h */, 0EFEB44B2006D3C800F81029 /* Errors.m */, @@ -771,6 +790,7 @@ 0EE2F9AB2291853D00F56F49 /* Session.swift */, 0E011F792196D93600BA59EE /* SocketType.swift */, 0EFEB42F2006D3C800F81029 /* TunnelInterface.swift */, + 0EE2F9EB22918DA100F56F49 /* Utils.swift */, 0EFEB4412006D3C800F81029 /* ZeroingData.h */, 0EFEB4312006D3C800F81029 /* ZeroingData.m */, 0EFEB43B2006D3C800F81029 /* ZeroingData.swift */, @@ -1273,12 +1293,14 @@ 0EE2F974229163C900F56F49 /* Proxy.swift in Sources */, 0EFEB4732006D3C800F81029 /* LinkInterface.swift in Sources */, 0EFEB4652006D3C800F81029 /* Authenticator.swift in Sources */, + 0E23B3DE229749C600304C30 /* LinkProducer.swift in Sources */, 0EE2F9F222918DA100F56F49 /* NETunnelInterface.swift in Sources */, 0EE2F9FE22918DA100F56F49 /* Keychain.swift in Sources */, 0EE7A79820F6296F00B42E6A /* PacketMacros.m in Sources */, 0EFEB4562006D3C800F81029 /* SessionKey.swift in Sources */, 0E0B20422278A85C007A3CB9 /* RoutingTableEntry.m in Sources */, 0E58BF5922411FEF006FB157 /* LZO.m in Sources */, + 0E23B3D32297193000304C30 /* NEUDPLink.swift in Sources */, 0E12B29E21449ADB00B4BAE9 /* NSRegularExpression+Shortcuts.swift in Sources */, 0EE2F9F822918DA100F56F49 /* NWUDPSessionState+Description.swift in Sources */, 0E749F5F2178885500BB2701 /* OpenVPNSession+PIA.swift in Sources */, @@ -1288,7 +1310,7 @@ 0EFEB45D2006D3C800F81029 /* CryptoBox.m in Sources */, 0E3B15C92152B05E00984B17 /* CryptoCTR.m in Sources */, 0E011F7D2196D97200BA59EE /* EndpointProtocol.swift in Sources */, - 0EE2F9F022918DA100F56F49 /* NETCPInterface.swift in Sources */, + 0EE2F9F022918DA100F56F49 /* NETCPSocket.swift in Sources */, 0E0C2125212ED29D008AB282 /* OpenVPNError.swift in Sources */, 0E12B2A821456C0200B4BAE9 /* ControlChannel.swift in Sources */, 0EFEB4552006D3C800F81029 /* EncryptionBridge.swift in Sources */, @@ -1309,11 +1331,12 @@ 0EE2FA0822918DA100F56F49 /* TunnelKitProvider+Interaction.swift in Sources */, 0EE2FA0422918DA100F56F49 /* TunnelKitProvider.swift in Sources */, 0EE2F9FA22918DA100F56F49 /* DNSResolver.swift in Sources */, - 0EE2F9F622918DA100F56F49 /* NEUDPInterface.swift in Sources */, + 0EE2F9F622918DA100F56F49 /* NEUDPSocket.swift in Sources */, 0E39BCEA214B2AB60035E9DE /* ControlPacket.m in Sources */, 0EE2F96E2291636B00F56F49 /* IPv4Settings.swift in Sources */, 0E12B2AB2145E01700B4BAE9 /* ControlChannelSerializer.swift in Sources */, 0EFEB4662006D3C800F81029 /* ZeroingData.swift in Sources */, + 0E23B3D02297192900304C30 /* NETCPLink.swift in Sources */, 0EFEB4682006D3C800F81029 /* MSS.m in Sources */, 0EE2FA0622918DA100F56F49 /* Utils.swift in Sources */, 0E48AC662271ADA9009B1A98 /* PacketStream.m in Sources */, @@ -1352,12 +1375,14 @@ 0EE2F975229163C900F56F49 /* Proxy.swift in Sources */, 0EFEB4A12006D7F300F81029 /* LinkInterface.swift in Sources */, 0EE7A79920F6296F00B42E6A /* PacketMacros.m in Sources */, + 0E23B3DF229749C600304C30 /* LinkProducer.swift in Sources */, 0EE2F9F322918DA100F56F49 /* NETunnelInterface.swift in Sources */, 0EE2F9FF22918DA100F56F49 /* Keychain.swift in Sources */, 0E0B20432278A85C007A3CB9 /* RoutingTableEntry.m in Sources */, 0E58BF5A22411FEF006FB157 /* LZO.m in Sources */, 0E12B29F21449ADB00B4BAE9 /* NSRegularExpression+Shortcuts.swift in Sources */, 0EFEB4A02006D7F300F81029 /* ReplayProtector.m in Sources */, + 0E23B3D42297193000304C30 /* NEUDPLink.swift in Sources */, 0E749F602178885500BB2701 /* OpenVPNSession+PIA.swift in Sources */, 0EE2F9F922918DA100F56F49 /* NWUDPSessionState+Description.swift in Sources */, 0EFEB4992006D7F300F81029 /* OpenVPNSession.swift in Sources */, @@ -1367,7 +1392,7 @@ 0E3B15CA2152B05E00984B17 /* CryptoCTR.m in Sources */, 0E011F7E2196D97200BA59EE /* EndpointProtocol.swift in Sources */, 0E0C2126212ED29D008AB282 /* OpenVPNError.swift in Sources */, - 0EE2F9F122918DA100F56F49 /* NETCPInterface.swift in Sources */, + 0EE2F9F122918DA100F56F49 /* NETCPSocket.swift in Sources */, 0E12B2A921456C0200B4BAE9 /* ControlChannel.swift in Sources */, 0EFEB4982006D7F300F81029 /* ZeroingData.swift in Sources */, 0EFEB4A32006D7F300F81029 /* Errors.m in Sources */, @@ -1388,11 +1413,12 @@ 0EE2FA0922918DA100F56F49 /* TunnelKitProvider+Interaction.swift in Sources */, 0EE2FA0522918DA100F56F49 /* TunnelKitProvider.swift in Sources */, 0EE2F9FB22918DA100F56F49 /* DNSResolver.swift in Sources */, - 0EE2F9F722918DA100F56F49 /* NEUDPInterface.swift in Sources */, + 0EE2F9F722918DA100F56F49 /* NEUDPSocket.swift in Sources */, 0E39BCEB214B2AB60035E9DE /* ControlPacket.m in Sources */, 0EE2F96F2291636B00F56F49 /* IPv4Settings.swift in Sources */, 0E12B2AC2145E01700B4BAE9 /* ControlChannelSerializer.swift in Sources */, 0E07598120F0060E00F38FD8 /* CryptoAEAD.m in Sources */, + 0E23B3D12297192900304C30 /* NETCPLink.swift in Sources */, 0EFEB49C2006D7F300F81029 /* Data+Manipulation.swift in Sources */, 0EE2FA0722918DA100F56F49 /* Utils.swift in Sources */, 0E48AC672271ADA9009B1A98 /* PacketStream.m in Sources */, diff --git a/TunnelKit/Sources/AppExtension/GenericSocket.swift b/TunnelKit/Sources/AppExtension/GenericSocket.swift index 03da712..c723a6d 100644 --- a/TunnelKit/Sources/AppExtension/GenericSocket.swift +++ b/TunnelKit/Sources/AppExtension/GenericSocket.swift @@ -36,10 +36,6 @@ import Foundation -protocol LinkProducer { - func link(withMTU mtu: Int) -> LinkInterface -} - protocol GenericSocketDelegate: class { func socketDidTimeout(_ socket: GenericSocket) @@ -50,7 +46,7 @@ protocol GenericSocketDelegate: class { func socketHasBetterPath(_ socket: GenericSocket) } -protocol GenericSocket: LinkProducer { +protocol GenericSocket { var remoteAddress: String? { get } var hasBetterPath: Bool { get } diff --git a/TunnelKit/Sources/AppExtension/LinkProducer.swift b/TunnelKit/Sources/AppExtension/LinkProducer.swift new file mode 100644 index 0000000..d9858e2 --- /dev/null +++ b/TunnelKit/Sources/AppExtension/LinkProducer.swift @@ -0,0 +1,30 @@ +// +// LinkProducer.swift +// TunnelKit +// +// Created by Davide De Rosa on 5/23/19. +// Copyright (c) 2019 Davide De Rosa. All rights reserved. +// +// https://github.com/passepartoutvpn +// +// This file is part of TunnelKit. +// +// TunnelKit is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// TunnelKit is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with TunnelKit. If not, see . +// + +import Foundation + +protocol LinkProducer { + func link(withMTU mtu: Int) -> LinkInterface +} diff --git a/TunnelKit/Sources/AppExtension/Transport/NETCPInterface.swift b/TunnelKit/Sources/AppExtension/Transport/NETCPSocket.swift similarity index 74% rename from TunnelKit/Sources/AppExtension/Transport/NETCPInterface.swift rename to TunnelKit/Sources/AppExtension/Transport/NETCPSocket.swift index 395f5f3..25e4ce2 100644 --- a/TunnelKit/Sources/AppExtension/Transport/NETCPInterface.swift +++ b/TunnelKit/Sources/AppExtension/Transport/NETCPSocket.swift @@ -37,14 +37,13 @@ import Foundation import NetworkExtension import SwiftyBeaver -import __TunnelKitOpenVPN private let log = SwiftyBeaver.self class NETCPSocket: NSObject, GenericSocket { private static var linkContext = 0 - private let impl: NWTCPConnection + let impl: NWTCPConnection init(impl: NWTCPConnection) { self.impl = impl @@ -104,10 +103,6 @@ class NETCPSocket: NSObject, GenericSocket { return NETCPSocket(impl: NWTCPConnection(upgradeFor: impl)) } - func link(withMTU mtu: Int) -> LinkInterface { - return NETCPLink(impl: impl, mtu: mtu) - } - // MARK: Connection KVO (any queue) override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { @@ -175,75 +170,6 @@ class NETCPSocket: NSObject, GenericSocket { } } -class NETCPLink: LinkInterface { - private let impl: NWTCPConnection - - private let maxPacketSize: Int - - init(impl: NWTCPConnection, mtu: Int, maxPacketSize: Int? = nil) { - self.impl = impl - self.mtu = mtu - self.maxPacketSize = maxPacketSize ?? (512 * 1024) - } - - // MARK: LinkInterface - - let isReliable: Bool = true - - var remoteAddress: String? { - return (impl.remoteAddress as? NWHostEndpoint)?.hostname - } - - let mtu: Int - - var packetBufferSize: Int { - return maxPacketSize - } - - func setReadHandler(queue: DispatchQueue, _ handler: @escaping ([Data]?, Error?) -> Void) { - loopReadPackets(queue, Data(), handler) - } - - private func loopReadPackets(_ queue: DispatchQueue, _ buffer: Data, _ handler: @escaping ([Data]?, Error?) -> Void) { - - // WARNING: runs in Network.framework queue - impl.readMinimumLength(2, maximumLength: packetBufferSize) { [weak self] (data, error) in - guard let _ = self else { - return - } - queue.sync { - guard (error == nil), let data = data else { - handler(nil, error) - return - } - - var newBuffer = buffer - newBuffer.append(contentsOf: data) - var until = 0 - let packets = PacketStream.packets(fromStream: newBuffer, until: &until) - newBuffer = newBuffer.subdata(in: until.. Void)?) { - let stream = PacketStream.stream(fromPacket: packet) - impl.write(stream) { (error) in - completionHandler?(error) - } - } - - func writePackets(_ packets: [Data], completionHandler: ((Error?) -> Void)?) { - let stream = PacketStream.stream(fromPackets: packets) - impl.write(stream) { (error) in - completionHandler?(error) - } - } -} - extension NETCPSocket { override var description: String { guard let hostEndpoint = impl.endpoint as? NWHostEndpoint else { diff --git a/TunnelKit/Sources/AppExtension/Transport/NEUDPInterface.swift b/TunnelKit/Sources/AppExtension/Transport/NEUDPSocket.swift similarity index 82% rename from TunnelKit/Sources/AppExtension/Transport/NEUDPInterface.swift rename to TunnelKit/Sources/AppExtension/Transport/NEUDPSocket.swift index 3e99f63..9c7d2b1 100644 --- a/TunnelKit/Sources/AppExtension/Transport/NEUDPInterface.swift +++ b/TunnelKit/Sources/AppExtension/Transport/NEUDPSocket.swift @@ -43,7 +43,7 @@ private let log = SwiftyBeaver.self class NEUDPSocket: NSObject, GenericSocket { private static var linkContext = 0 - private let impl: NWUDPSession + let impl: NWUDPSession init(impl: NWUDPSession) { self.impl = impl @@ -103,10 +103,6 @@ class NEUDPSocket: NSObject, GenericSocket { return NEUDPSocket(impl: NWUDPSession(upgradeFor: impl)) } - func link(withMTU mtu: Int) -> LinkInterface { - return NEUDPLink(impl: impl, mtu: mtu) - } - // MARK: Connection KVO (any queue) override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { @@ -177,57 +173,6 @@ class NEUDPSocket: NSObject, GenericSocket { } } -class NEUDPLink: LinkInterface { - private let impl: NWUDPSession - - private let maxDatagrams: Int - - init(impl: NWUDPSession, mtu: Int, maxDatagrams: Int? = nil) { - self.impl = impl - self.mtu = mtu - self.maxDatagrams = maxDatagrams ?? 200 - } - - // MARK: LinkInterface - - let isReliable: Bool = false - - var remoteAddress: String? { - return (impl.resolvedEndpoint as? NWHostEndpoint)?.hostname - } - - let mtu: Int - - var packetBufferSize: Int { - return maxDatagrams - } - - func setReadHandler(queue: DispatchQueue, _ handler: @escaping ([Data]?, Error?) -> Void) { - - // WARNING: runs in Network.framework queue - impl.setReadHandler({ [weak self] (packets, error) in - guard let _ = self else { - return - } - queue.sync { - handler(packets, error) - } - }, maxDatagrams: maxDatagrams) - } - - func writePacket(_ packet: Data, completionHandler: ((Error?) -> Void)?) { - impl.writeDatagram(packet) { (error) in - completionHandler?(error) - } - } - - func writePackets(_ packets: [Data], completionHandler: ((Error?) -> Void)?) { - impl.writeMultipleDatagrams(packets) { (error) in - completionHandler?(error) - } - } -} - extension NEUDPSocket { override var description: String { guard let hostEndpoint = impl.endpoint as? NWHostEndpoint else { diff --git a/TunnelKit/Sources/AppExtension/DNSResolver.swift b/TunnelKit/Sources/Core/DNSResolver.swift similarity index 100% rename from TunnelKit/Sources/AppExtension/DNSResolver.swift rename to TunnelKit/Sources/Core/DNSResolver.swift diff --git a/TunnelKit/Sources/AppExtension/Utils.swift b/TunnelKit/Sources/Core/Utils.swift similarity index 100% rename from TunnelKit/Sources/AppExtension/Utils.swift rename to TunnelKit/Sources/Core/Utils.swift diff --git a/TunnelKit/Sources/AppExtension/ConnectionStrategy.swift b/TunnelKit/Sources/OpenVPN/AppExtension/ConnectionStrategy.swift similarity index 100% rename from TunnelKit/Sources/AppExtension/ConnectionStrategy.swift rename to TunnelKit/Sources/OpenVPN/AppExtension/ConnectionStrategy.swift diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/NETCPLink.swift b/TunnelKit/Sources/OpenVPN/AppExtension/NETCPLink.swift new file mode 100644 index 0000000..532328c --- /dev/null +++ b/TunnelKit/Sources/OpenVPN/AppExtension/NETCPLink.swift @@ -0,0 +1,103 @@ +// +// NETCPLink.swift +// TunnelKit +// +// Created by Davide De Rosa on 5/23/19. +// Copyright (c) 2019 Davide De Rosa. All rights reserved. +// +// https://github.com/passepartoutvpn +// +// This file is part of TunnelKit. +// +// TunnelKit is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// TunnelKit is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with TunnelKit. If not, see . +// + +import Foundation +import NetworkExtension +import __TunnelKitOpenVPN + +class NETCPLink: LinkInterface { + private let impl: NWTCPConnection + + private let maxPacketSize: Int + + init(impl: NWTCPConnection, mtu: Int, maxPacketSize: Int? = nil) { + self.impl = impl + self.mtu = mtu + self.maxPacketSize = maxPacketSize ?? (512 * 1024) + } + + // MARK: LinkInterface + + let isReliable: Bool = true + + var remoteAddress: String? { + return (impl.remoteAddress as? NWHostEndpoint)?.hostname + } + + let mtu: Int + + var packetBufferSize: Int { + return maxPacketSize + } + + func setReadHandler(queue: DispatchQueue, _ handler: @escaping ([Data]?, Error?) -> Void) { + loopReadPackets(queue, Data(), handler) + } + + private func loopReadPackets(_ queue: DispatchQueue, _ buffer: Data, _ handler: @escaping ([Data]?, Error?) -> Void) { + + // WARNING: runs in Network.framework queue + impl.readMinimumLength(2, maximumLength: packetBufferSize) { [weak self] (data, error) in + guard let _ = self else { + return + } + queue.sync { + guard (error == nil), let data = data else { + handler(nil, error) + return + } + + var newBuffer = buffer + newBuffer.append(contentsOf: data) + var until = 0 + let packets = PacketStream.packets(fromStream: newBuffer, until: &until) + newBuffer = newBuffer.subdata(in: until.. Void)?) { + let stream = PacketStream.stream(fromPacket: packet) + impl.write(stream) { (error) in + completionHandler?(error) + } + } + + func writePackets(_ packets: [Data], completionHandler: ((Error?) -> Void)?) { + let stream = PacketStream.stream(fromPackets: packets) + impl.write(stream) { (error) in + completionHandler?(error) + } + } +} + +extension NETCPSocket: LinkProducer { + func link(withMTU mtu: Int) -> LinkInterface { + return NETCPLink(impl: impl, mtu: mtu) + } +} diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/NEUDPLink.swift b/TunnelKit/Sources/OpenVPN/AppExtension/NEUDPLink.swift new file mode 100644 index 0000000..9692d82 --- /dev/null +++ b/TunnelKit/Sources/OpenVPN/AppExtension/NEUDPLink.swift @@ -0,0 +1,84 @@ +// +// NEUDPLink.swift +// TunnelKit +// +// Created by Davide De Rosa on 5/23/19. +// Copyright (c) 2019 Davide De Rosa. All rights reserved. +// +// https://github.com/passepartoutvpn +// +// This file is part of TunnelKit. +// +// TunnelKit is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// TunnelKit is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with TunnelKit. If not, see . +// + +import Foundation +import NetworkExtension + +class NEUDPLink: LinkInterface { + private let impl: NWUDPSession + + private let maxDatagrams: Int + + init(impl: NWUDPSession, mtu: Int, maxDatagrams: Int? = nil) { + self.impl = impl + self.mtu = mtu + self.maxDatagrams = maxDatagrams ?? 200 + } + + // MARK: LinkInterface + + let isReliable: Bool = false + + var remoteAddress: String? { + return (impl.resolvedEndpoint as? NWHostEndpoint)?.hostname + } + + let mtu: Int + + var packetBufferSize: Int { + return maxDatagrams + } + + func setReadHandler(queue: DispatchQueue, _ handler: @escaping ([Data]?, Error?) -> Void) { + + // WARNING: runs in Network.framework queue + impl.setReadHandler({ [weak self] (packets, error) in + guard let _ = self else { + return + } + queue.sync { + handler(packets, error) + } + }, maxDatagrams: maxDatagrams) + } + + func writePacket(_ packet: Data, completionHandler: ((Error?) -> Void)?) { + impl.writeDatagram(packet) { (error) in + completionHandler?(error) + } + } + + func writePackets(_ packets: [Data], completionHandler: ((Error?) -> Void)?) { + impl.writeMultipleDatagrams(packets) { (error) in + completionHandler?(error) + } + } +} + +extension NEUDPSocket: LinkProducer { + func link(withMTU mtu: Int) -> LinkInterface { + return NEUDPLink(impl: impl, mtu: mtu) + } +} diff --git a/TunnelKit/Sources/AppExtension/TunnelKitProvider+Configuration.swift b/TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider+Configuration.swift similarity index 100% rename from TunnelKit/Sources/AppExtension/TunnelKitProvider+Configuration.swift rename to TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider+Configuration.swift diff --git a/TunnelKit/Sources/AppExtension/TunnelKitProvider+Interaction.swift b/TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider+Interaction.swift similarity index 100% rename from TunnelKit/Sources/AppExtension/TunnelKitProvider+Interaction.swift rename to TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider+Interaction.swift diff --git a/TunnelKit/Sources/AppExtension/TunnelKitProvider.swift b/TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider.swift similarity index 99% rename from TunnelKit/Sources/AppExtension/TunnelKitProvider.swift rename to TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider.swift index cacb1e5..23943c2 100644 --- a/TunnelKit/Sources/AppExtension/TunnelKitProvider.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider.swift @@ -401,14 +401,14 @@ extension TunnelKitProvider: GenericSocketDelegate { } func socketDidBecomeActive(_ socket: GenericSocket) { - guard let session = session else { + guard let session = session, let producer = socket as? LinkProducer else { return } if session.canRebindLink() { - session.rebindLink(socket.link(withMTU: cfg.mtu)) + session.rebindLink(producer.link(withMTU: cfg.mtu)) reasserting = false } else { - session.setLink(socket.link(withMTU: cfg.mtu)) + session.setLink(producer.link(withMTU: cfg.mtu)) } } From a85404e951f62566bd068e6a7a4643f942b24e50 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 23 May 2019 21:59:15 +0200 Subject: [PATCH 02/12] Rename provider class to OpenVPNTunnelProvider --- .jazzy.yaml | 2 +- TunnelKit.xcodeproj/project.pbxproj | 36 +++++++-------- .../AppExtension/ConnectionStrategy.swift | 6 +-- ...OpenVPNTunnelProvider+Configuration.swift} | 46 +++++++++---------- ...> OpenVPNTunnelProvider+Interaction.swift} | 8 ++-- ...ider.swift => OpenVPNTunnelProvider.swift} | 12 ++--- TunnelKitTests/AppExtensionTests.swift | 8 ++-- 7 files changed, 59 insertions(+), 59 deletions(-) rename TunnelKit/Sources/OpenVPN/AppExtension/{TunnelKitProvider+Configuration.swift => OpenVPNTunnelProvider+Configuration.swift} (93%) rename TunnelKit/Sources/OpenVPN/AppExtension/{TunnelKitProvider+Interaction.swift => OpenVPNTunnelProvider+Interaction.swift} (95%) rename TunnelKit/Sources/OpenVPN/AppExtension/{TunnelKitProvider.swift => OpenVPNTunnelProvider.swift} (98%) diff --git a/.jazzy.yaml b/.jazzy.yaml index d6d4b77..f41fd92 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -33,4 +33,4 @@ custom_categories: - OpenVPNSessionDelegate - name: AppExtension children: - - TunnelKitProvider + - OpenVPNTunnelProvider diff --git a/TunnelKit.xcodeproj/project.pbxproj b/TunnelKit.xcodeproj/project.pbxproj index 1be6bf9..cdbe503 100644 --- a/TunnelKit.xcodeproj/project.pbxproj +++ b/TunnelKit.xcodeproj/project.pbxproj @@ -148,20 +148,20 @@ 0EE2F9F922918DA100F56F49 /* NWUDPSessionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E422918DA100F56F49 /* NWUDPSessionState+Description.swift */; }; 0EE2F9FA22918DA100F56F49 /* DNSResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E522918DA100F56F49 /* DNSResolver.swift */; }; 0EE2F9FB22918DA100F56F49 /* DNSResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E522918DA100F56F49 /* DNSResolver.swift */; }; - 0EE2F9FC22918DA100F56F49 /* TunnelKitProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E622918DA100F56F49 /* TunnelKitProvider+Configuration.swift */; }; - 0EE2F9FD22918DA100F56F49 /* TunnelKitProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E622918DA100F56F49 /* TunnelKitProvider+Configuration.swift */; }; + 0EE2F9FC22918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E622918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift */; }; + 0EE2F9FD22918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E622918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift */; }; 0EE2F9FE22918DA100F56F49 /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E722918DA100F56F49 /* Keychain.swift */; }; 0EE2F9FF22918DA100F56F49 /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E722918DA100F56F49 /* Keychain.swift */; }; 0EE2FA0022918DA100F56F49 /* MemoryDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E822918DA100F56F49 /* MemoryDestination.swift */; }; 0EE2FA0122918DA100F56F49 /* MemoryDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E822918DA100F56F49 /* MemoryDestination.swift */; }; 0EE2FA0222918DA100F56F49 /* GenericSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E922918DA100F56F49 /* GenericSocket.swift */; }; 0EE2FA0322918DA100F56F49 /* GenericSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E922918DA100F56F49 /* GenericSocket.swift */; }; - 0EE2FA0422918DA100F56F49 /* TunnelKitProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EA22918DA100F56F49 /* TunnelKitProvider.swift */; }; - 0EE2FA0522918DA100F56F49 /* TunnelKitProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EA22918DA100F56F49 /* TunnelKitProvider.swift */; }; + 0EE2FA0422918DA100F56F49 /* OpenVPNTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EA22918DA100F56F49 /* OpenVPNTunnelProvider.swift */; }; + 0EE2FA0522918DA100F56F49 /* OpenVPNTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EA22918DA100F56F49 /* OpenVPNTunnelProvider.swift */; }; 0EE2FA0622918DA100F56F49 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EB22918DA100F56F49 /* Utils.swift */; }; 0EE2FA0722918DA100F56F49 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EB22918DA100F56F49 /* Utils.swift */; }; - 0EE2FA0822918DA100F56F49 /* TunnelKitProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EC22918DA100F56F49 /* TunnelKitProvider+Interaction.swift */; }; - 0EE2FA0922918DA100F56F49 /* TunnelKitProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EC22918DA100F56F49 /* TunnelKitProvider+Interaction.swift */; }; + 0EE2FA0822918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EC22918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift */; }; + 0EE2FA0922918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EC22918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift */; }; 0EE2FA0A22918DA100F56F49 /* InterfaceObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9ED22918DA100F56F49 /* InterfaceObserver.swift */; }; 0EE2FA0B22918DA100F56F49 /* InterfaceObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9ED22918DA100F56F49 /* InterfaceObserver.swift */; }; 0EE2FA422291954300F56F49 /* AppExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA0E2291953300F56F49 /* AppExtensionTests.swift */; }; @@ -393,13 +393,13 @@ 0EE2F9E322918DA100F56F49 /* NEUDPSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NEUDPSocket.swift; sourceTree = ""; }; 0EE2F9E422918DA100F56F49 /* NWUDPSessionState+Description.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NWUDPSessionState+Description.swift"; sourceTree = ""; }; 0EE2F9E522918DA100F56F49 /* DNSResolver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DNSResolver.swift; sourceTree = ""; }; - 0EE2F9E622918DA100F56F49 /* TunnelKitProvider+Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TunnelKitProvider+Configuration.swift"; sourceTree = ""; }; + 0EE2F9E622918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OpenVPNTunnelProvider+Configuration.swift"; sourceTree = ""; }; 0EE2F9E722918DA100F56F49 /* Keychain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Keychain.swift; sourceTree = ""; }; 0EE2F9E822918DA100F56F49 /* MemoryDestination.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MemoryDestination.swift; sourceTree = ""; }; 0EE2F9E922918DA100F56F49 /* GenericSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GenericSocket.swift; sourceTree = ""; }; - 0EE2F9EA22918DA100F56F49 /* TunnelKitProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TunnelKitProvider.swift; sourceTree = ""; }; + 0EE2F9EA22918DA100F56F49 /* OpenVPNTunnelProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenVPNTunnelProvider.swift; sourceTree = ""; }; 0EE2F9EB22918DA100F56F49 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; - 0EE2F9EC22918DA100F56F49 /* TunnelKitProvider+Interaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TunnelKitProvider+Interaction.swift"; sourceTree = ""; }; + 0EE2F9EC22918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OpenVPNTunnelProvider+Interaction.swift"; sourceTree = ""; }; 0EE2F9ED22918DA100F56F49 /* InterfaceObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InterfaceObserver.swift; sourceTree = ""; }; 0EE2FA0C2291953300F56F49 /* RawPerformanceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RawPerformanceTests.swift; sourceTree = ""; }; 0EE2FA0D2291953300F56F49 /* DataPathPerformanceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataPathPerformanceTests.swift; sourceTree = ""; }; @@ -617,9 +617,9 @@ 0EE2F9DE22918DA100F56F49 /* ConnectionStrategy.swift */, 0E23B3CF2297192900304C30 /* NETCPLink.swift */, 0E23B3D22297193000304C30 /* NEUDPLink.swift */, - 0EE2F9EA22918DA100F56F49 /* TunnelKitProvider.swift */, - 0EE2F9E622918DA100F56F49 /* TunnelKitProvider+Configuration.swift */, - 0EE2F9EC22918DA100F56F49 /* TunnelKitProvider+Interaction.swift */, + 0EE2F9EA22918DA100F56F49 /* OpenVPNTunnelProvider.swift */, + 0EE2F9E622918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift */, + 0EE2F9EC22918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift */, ); path = AppExtension; sourceTree = ""; @@ -1328,8 +1328,8 @@ 0E07598020F0060E00F38FD8 /* CryptoAEAD.m in Sources */, 0E011F882196E2AB00BA59EE /* ConfigurationParser.swift in Sources */, 0EE2FA0222918DA100F56F49 /* GenericSocket.swift in Sources */, - 0EE2FA0822918DA100F56F49 /* TunnelKitProvider+Interaction.swift in Sources */, - 0EE2FA0422918DA100F56F49 /* TunnelKitProvider.swift in Sources */, + 0EE2FA0822918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift in Sources */, + 0EE2FA0422918DA100F56F49 /* OpenVPNTunnelProvider.swift in Sources */, 0EE2F9FA22918DA100F56F49 /* DNSResolver.swift in Sources */, 0EE2F9F622918DA100F56F49 /* NEUDPSocket.swift in Sources */, 0E39BCEA214B2AB60035E9DE /* ControlPacket.m in Sources */, @@ -1344,7 +1344,7 @@ 0E411B9D2271F90700E0852C /* DNS.m in Sources */, 0EFEB45B2006D3C800F81029 /* TLSBox.m in Sources */, 0E58BF3922405410006FB157 /* minilzo.c in Sources */, - 0EE2F9FC22918DA100F56F49 /* TunnelKitProvider+Configuration.swift in Sources */, + 0EE2F9FC22918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift in Sources */, 0EFEB4702006D3C800F81029 /* Allocation.m in Sources */, 0E041D092152E6FE0025FE3C /* TLSWrap.swift in Sources */, 0EFEB4672006D3C800F81029 /* OpenVPNSession.swift in Sources */, @@ -1410,8 +1410,8 @@ 0EFEB4932006D7F300F81029 /* CryptoBox.m in Sources */, 0E011F892196E2AB00BA59EE /* ConfigurationParser.swift in Sources */, 0EE2FA0322918DA100F56F49 /* GenericSocket.swift in Sources */, - 0EE2FA0922918DA100F56F49 /* TunnelKitProvider+Interaction.swift in Sources */, - 0EE2FA0522918DA100F56F49 /* TunnelKitProvider.swift in Sources */, + 0EE2FA0922918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift in Sources */, + 0EE2FA0522918DA100F56F49 /* OpenVPNTunnelProvider.swift in Sources */, 0EE2F9FB22918DA100F56F49 /* DNSResolver.swift in Sources */, 0EE2F9F722918DA100F56F49 /* NEUDPSocket.swift in Sources */, 0E39BCEB214B2AB60035E9DE /* ControlPacket.m in Sources */, @@ -1426,7 +1426,7 @@ 0E411B9E2271F90700E0852C /* DNS.m in Sources */, 0EFEB4902006D7F300F81029 /* TunnelInterface.swift in Sources */, 0EFEB49E2006D7F300F81029 /* Allocation.m in Sources */, - 0EE2F9FD22918DA100F56F49 /* TunnelKitProvider+Configuration.swift in Sources */, + 0EE2F9FD22918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift in Sources */, 0E58BF3A22405410006FB157 /* minilzo.c in Sources */, 0E041D0A2152E6FE0025FE3C /* TLSWrap.swift in Sources */, 0EFEB48E2006D7F300F81029 /* SessionKey.swift in Sources */, diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/ConnectionStrategy.swift b/TunnelKit/Sources/OpenVPN/AppExtension/ConnectionStrategy.swift index 790e4e1..7992126 100644 --- a/TunnelKit/Sources/OpenVPN/AppExtension/ConnectionStrategy.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/ConnectionStrategy.swift @@ -51,7 +51,7 @@ class ConnectionStrategy { private var currentProtocolIndex = 0 - init(configuration: TunnelKitProvider.Configuration) { + init(configuration: OpenVPNTunnelProvider.Configuration) { hostname = configuration.sessionConfiguration.hostname prefersResolvedAddresses = (hostname == nil) || configuration.prefersResolvedAddresses resolvedAddresses = configuration.resolvedAddresses @@ -95,7 +95,7 @@ class ConnectionStrategy { // fall back to DNS guard let hostname = hostname else { log.error("DNS resolution unavailable: no hostname provided!") - completionHandler(nil, TunnelKitProvider.ProviderError.dnsFailure) + completionHandler(nil, OpenVPNTunnelProvider.ProviderError.dnsFailure) return } log.debug("DNS resolve hostname: \(hostname.maskedDescription)") @@ -112,7 +112,7 @@ class ConnectionStrategy { guard let targetAddress = self.resolvedAddress(from: addresses) else { log.error("No resolved or fallback address available") - completionHandler(nil, TunnelKitProvider.ProviderError.dnsFailure) + completionHandler(nil, OpenVPNTunnelProvider.ProviderError.dnsFailure) return } diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider+Configuration.swift b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift similarity index 93% rename from TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider+Configuration.swift rename to TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift index 86f0b1f..7278879 100644 --- a/TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider+Configuration.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift @@ -1,5 +1,5 @@ // -// TunnelKitProvider+Configuration.swift +// OpenVPNTunnelProvider+Configuration.swift // TunnelKit // // Created by Davide De Rosa on 10/23/17. @@ -40,11 +40,11 @@ import SwiftyBeaver private let log = SwiftyBeaver.self -extension TunnelKitProvider { +extension OpenVPNTunnelProvider { // MARK: Configuration - /// The way to create a `TunnelKitProvider.Configuration` object for the tunnel profile. + /// The way to create a `OpenVPNTunnelProvider.Configuration` object for the tunnel profile. public struct ConfigurationBuilder { /// :nodoc: @@ -198,9 +198,9 @@ extension TunnelKitProvider { } /** - Builds a `TunnelKitProvider.Configuration` object that will connect to the provided endpoint. + Builds a `OpenVPNTunnelProvider.Configuration` object that will connect to the provided endpoint. - - Returns: A `TunnelKitProvider.Configuration` object with this builder and the additional method parameters. + - Returns: A `OpenVPNTunnelProvider.Configuration` object with this builder and the additional method parameters. */ public func build() -> Configuration { return Configuration( @@ -216,7 +216,7 @@ extension TunnelKitProvider { } } - /// Offers a bridge between the abstract `TunnelKitProvider.ConfigurationBuilder` and a concrete `NETunnelProviderProtocol` profile. + /// Offers a bridge between the abstract `OpenVPNTunnelProvider.ConfigurationBuilder` and a concrete `NETunnelProviderProtocol` profile. public struct Configuration: Codable { struct Keys { static let appGroup = "AppGroup" @@ -280,29 +280,29 @@ extension TunnelKitProvider { static let masksPrivateData = "MasksPrivateData" } - /// - Seealso: `TunnelKitProvider.ConfigurationBuilder.prefersResolvedAddresses` + /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.prefersResolvedAddresses` public let prefersResolvedAddresses: Bool - /// - Seealso: `TunnelKitProvider.ConfigurationBuilder.resolvedAddresses` + /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.resolvedAddresses` public let resolvedAddresses: [String]? /// - Seealso: `OpenVPN.Configuration.endpointProtocols` @available(*, deprecated) public var endpointProtocols: [EndpointProtocol]? - /// - Seealso: `TunnelKitProvider.ConfigurationBuilder.mtu` + /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.mtu` public let mtu: Int - /// - Seealso: `TunnelKitProvider.ConfigurationBuilder.sessionConfiguration` + /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.sessionConfiguration` public let sessionConfiguration: OpenVPN.Configuration - /// - Seealso: `TunnelKitProvider.ConfigurationBuilder.shouldDebug` + /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.shouldDebug` public let shouldDebug: Bool - /// - Seealso: `TunnelKitProvider.ConfigurationBuilder.debugLogFormat` + /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.debugLogFormat` public let debugLogFormat: String? - /// - Seealso: `TunnelKitProvider.ConfigurationBuilder.masksPrivateData` + /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.masksPrivateData` public let masksPrivateData: Bool? // MARK: Shortcuts @@ -397,10 +397,10 @@ extension TunnelKitProvider { } /** - Parses a new `TunnelKitProvider.Configuration` object from a provider configuration map. + Parses a new `OpenVPNTunnelProvider.Configuration` object from a provider configuration map. - Parameter from: The map to parse. - - Returns: The parsed `TunnelKitProvider.Configuration` object. + - Returns: The parsed `OpenVPNTunnelProvider.Configuration` object. - Throws: `ProviderError.configuration` if `providerConfiguration` is incomplete. */ public static func parsed(from providerConfiguration: [String: Any]) throws -> Configuration { @@ -613,15 +613,15 @@ extension TunnelKitProvider { // MARK: Modification -extension TunnelKitProvider.Configuration { +extension OpenVPNTunnelProvider.Configuration { /** - Returns a `TunnelKitProvider.ConfigurationBuilder` to use this configuration as a starting point for a new one. + Returns a `OpenVPNTunnelProvider.ConfigurationBuilder` to use this configuration as a starting point for a new one. - - Returns: An editable `TunnelKitProvider.ConfigurationBuilder` initialized with this configuration. + - Returns: An editable `OpenVPNTunnelProvider.ConfigurationBuilder` initialized with this configuration. */ - public func builder() -> TunnelKitProvider.ConfigurationBuilder { - var builder = TunnelKitProvider.ConfigurationBuilder(sessionConfiguration: sessionConfiguration) + public func builder() -> OpenVPNTunnelProvider.ConfigurationBuilder { + var builder = OpenVPNTunnelProvider.ConfigurationBuilder(sessionConfiguration: sessionConfiguration) builder.prefersResolvedAddresses = prefersResolvedAddresses builder.resolvedAddresses = resolvedAddresses builder.mtu = mtu @@ -636,14 +636,14 @@ extension TunnelKitProvider.Configuration { public extension UserDefaults { @objc var dataCountArray: [Int]? { get { - return array(forKey: TunnelKitProvider.Configuration.dataCountKey) as? [Int] + return array(forKey: OpenVPNTunnelProvider.Configuration.dataCountKey) as? [Int] } set { - set(newValue, forKey: TunnelKitProvider.Configuration.dataCountKey) + set(newValue, forKey: OpenVPNTunnelProvider.Configuration.dataCountKey) } } func removeDataCountArray() { - removeObject(forKey: TunnelKitProvider.Configuration.dataCountKey) + removeObject(forKey: OpenVPNTunnelProvider.Configuration.dataCountKey) } } diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider+Interaction.swift b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Interaction.swift similarity index 95% rename from TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider+Interaction.swift rename to TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Interaction.swift index a3cdba0..6c6e36e 100644 --- a/TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider+Interaction.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Interaction.swift @@ -1,5 +1,5 @@ // -// TunnelKitProvider+Interaction.swift +// OpenVPNTunnelProvider+Interaction.swift // TunnelKit // // Created by Davide De Rosa on 9/24/17. @@ -36,11 +36,11 @@ import Foundation -extension TunnelKitProvider { +extension OpenVPNTunnelProvider { // MARK: Interaction - /// The messages accepted by `TunnelKitProvider`. + /// The messages accepted by `OpenVPNTunnelProvider`. public class Message: Equatable { /// Requests a snapshot of the latest debug log. Returns the log data decoded from UTF-8. @@ -73,7 +73,7 @@ extension TunnelKitProvider { // mostly programming errors by host app enum ProviderConfigurationError: Error { - /// A field in the `TunnelKitProvider.Configuration` provided is incorrect or incomplete. + /// A field in the `OpenVPNTunnelProvider.Configuration` provided is incorrect or incomplete. case parameter(name: String) /// Credentials are missing or inaccessible. diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider.swift b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift similarity index 98% rename from TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider.swift rename to TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift index 23943c2..a1c20fe 100644 --- a/TunnelKit/Sources/OpenVPN/AppExtension/TunnelKitProvider.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift @@ -1,5 +1,5 @@ // -// TunnelKitProvider.swift +// OpenVPNTunnelProvider.swift // TunnelKit // // Created by Davide De Rosa on 2/1/17. @@ -44,7 +44,7 @@ private let log = SwiftyBeaver.self Provides an all-in-one `NEPacketTunnelProvider` implementation for use in a Packet Tunnel Provider extension both on iOS and macOS. */ -open class TunnelKitProvider: NEPacketTunnelProvider { +open class OpenVPNTunnelProvider: NEPacketTunnelProvider { // MARK: Tweaks @@ -89,7 +89,7 @@ open class TunnelKitProvider: NEPacketTunnelProvider { private let observer = InterfaceObserver() - private let tunnelQueue = DispatchQueue(label: TunnelKitProvider.description()) + private let tunnelQueue = DispatchQueue(label: OpenVPNTunnelProvider.description()) private let prngSeedLength = 64 @@ -382,7 +382,7 @@ open class TunnelKitProvider: NEPacketTunnelProvider { } } -extension TunnelKitProvider: GenericSocketDelegate { +extension OpenVPNTunnelProvider: GenericSocketDelegate { // MARK: GenericSocketDelegate (tunnel queue) @@ -470,7 +470,7 @@ extension TunnelKitProvider: GenericSocketDelegate { } } -extension TunnelKitProvider: OpenVPNSessionDelegate { +extension OpenVPNTunnelProvider: OpenVPNSessionDelegate { // MARK: OpenVPNSessionDelegate (tunnel queue) @@ -721,7 +721,7 @@ extension TunnelKitProvider: OpenVPNSessionDelegate { } } -extension TunnelKitProvider { +extension OpenVPNTunnelProvider { private func tryNextProtocol() -> Bool { guard strategy.tryNextProtocol() else { disposeTunnel(error: ProviderError.exhaustedProtocols) diff --git a/TunnelKitTests/AppExtensionTests.swift b/TunnelKitTests/AppExtensionTests.swift index 3e95861..2efb374 100644 --- a/TunnelKitTests/AppExtensionTests.swift +++ b/TunnelKitTests/AppExtensionTests.swift @@ -51,8 +51,8 @@ class AppExtensionTests: XCTestCase { } func testConfiguration() { - var builder: TunnelKitProvider.ConfigurationBuilder! - var cfg: TunnelKitProvider.Configuration! + var builder: OpenVPNTunnelProvider.ConfigurationBuilder! + var cfg: OpenVPNTunnelProvider.Configuration! let identifier = "com.example.Provider" let appGroup = "group.com.algoritmico.TunnelKit" @@ -65,7 +65,7 @@ class AppExtensionTests: XCTestCase { sessionBuilder.digest = .sha256 sessionBuilder.hostname = hostname sessionBuilder.endpointProtocols = [] - builder = TunnelKitProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build()) + builder = OpenVPNTunnelProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build()) XCTAssertNotNil(builder) cfg = builder.build() @@ -82,7 +82,7 @@ class AppExtensionTests: XCTestCase { print("\(pc)") } - let K = TunnelKitProvider.Configuration.Keys.self + let K = OpenVPNTunnelProvider.Configuration.Keys.self XCTAssertEqual(proto?.providerConfiguration?[K.appGroup] as? String, appGroup) XCTAssertEqual(proto?.providerConfiguration?[K.cipherAlgorithm] as? String, cfg.sessionConfiguration.cipher?.rawValue) XCTAssertEqual(proto?.providerConfiguration?[K.digestAlgorithm] as? String, cfg.sessionConfiguration.digest?.rawValue) From 5561c7adc6ddb40b1ad40f6ca7dd1e5a91739e7b Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 23 May 2019 22:09:59 +0200 Subject: [PATCH 03/12] Group OpenVPN.Configuration funcs into extension - with (creation) - store (convert to dict) - print (log) --- .../OpenVPNTunnelProvider+Configuration.swift | 433 +++++++++--------- 1 file changed, 224 insertions(+), 209 deletions(-) diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift index 7278879..83a0cb0 100644 --- a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift @@ -107,85 +107,7 @@ extension OpenVPNTunnelProvider { prefersResolvedAddresses = providerConfiguration[S.prefersResolvedAddresses] as? Bool ?? ConfigurationBuilder.defaults.prefersResolvedAddresses resolvedAddresses = providerConfiguration[S.resolvedAddresses] as? [String] mtu = providerConfiguration[S.mtu] as? Int ?? ConfigurationBuilder.defaults.mtu - - // - - guard let caPEM = providerConfiguration[S.ca] as? String else { - throw ProviderConfigurationError.parameter(name: "protocolConfiguration.providerConfiguration[\(S.ca)]") - } - - var sessionConfigurationBuilder = OpenVPN.ConfigurationBuilder() - if let cipherAlgorithm = providerConfiguration[S.cipherAlgorithm] as? String { - sessionConfigurationBuilder.cipher = OpenVPN.Cipher(rawValue: cipherAlgorithm) - } - if let digestAlgorithm = providerConfiguration[S.digestAlgorithm] as? String { - sessionConfigurationBuilder.digest = OpenVPN.Digest(rawValue: digestAlgorithm) - } - if let compressionFramingValue = providerConfiguration[S.compressionFraming] as? Int, let compressionFraming = OpenVPN.CompressionFraming(rawValue: compressionFramingValue) { - sessionConfigurationBuilder.compressionFraming = compressionFraming - } else { - sessionConfigurationBuilder.compressionFraming = ConfigurationBuilder.defaults.sessionConfiguration.compressionFraming - } - if let compressionAlgorithmValue = providerConfiguration[S.compressionAlgorithm] as? Int, let compressionAlgorithm = OpenVPN.CompressionAlgorithm(rawValue: compressionAlgorithmValue) { - sessionConfigurationBuilder.compressionAlgorithm = compressionAlgorithm - } else { - sessionConfigurationBuilder.compressionAlgorithm = ConfigurationBuilder.defaults.sessionConfiguration.compressionAlgorithm - } - sessionConfigurationBuilder.ca = OpenVPN.CryptoContainer(pem: caPEM) - if let clientPEM = providerConfiguration[S.clientCertificate] as? String { - guard let keyPEM = providerConfiguration[S.clientKey] as? String else { - throw ProviderConfigurationError.parameter(name: "protocolConfiguration.providerConfiguration[\(S.clientKey)]") - } - sessionConfigurationBuilder.clientCertificate = OpenVPN.CryptoContainer(pem: clientPEM) - sessionConfigurationBuilder.clientKey = OpenVPN.CryptoContainer(pem: keyPEM) - } - if let tlsWrapData = providerConfiguration[S.tlsWrap] as? Data { - do { - sessionConfigurationBuilder.tlsWrap = try OpenVPN.TLSWrap.deserialized(tlsWrapData) - } catch { - throw ProviderConfigurationError.parameter(name: "protocolConfiguration.providerConfiguration[\(S.tlsWrap)]") - } - } - sessionConfigurationBuilder.tlsSecurityLevel = providerConfiguration[S.tlsSecurityLevel] as? Int ?? ConfigurationBuilder.defaults.sessionConfiguration.tlsSecurityLevel - sessionConfigurationBuilder.keepAliveInterval = providerConfiguration[S.keepAlive] as? TimeInterval ?? ConfigurationBuilder.defaults.sessionConfiguration.keepAliveInterval - sessionConfigurationBuilder.renegotiatesAfter = providerConfiguration[S.renegotiatesAfter] as? TimeInterval ?? ConfigurationBuilder.defaults.sessionConfiguration.renegotiatesAfter - guard let endpointProtocolsStrings = providerConfiguration[S.endpointProtocols] as? [String], !endpointProtocolsStrings.isEmpty else { - throw ProviderConfigurationError.parameter(name: "protocolConfiguration.providerConfiguration[\(S.endpointProtocols)] is nil or empty") - } - sessionConfigurationBuilder.endpointProtocols = try endpointProtocolsStrings.map { - guard let ep = EndpointProtocol(rawValue: $0) else { - throw ProviderConfigurationError.parameter(name: "protocolConfiguration.providerConfiguration[\(S.endpointProtocols)] has a badly formed element") - } - return ep - } - sessionConfigurationBuilder.checksEKU = providerConfiguration[S.checksEKU] as? Bool ?? ConfigurationBuilder.defaults.sessionConfiguration.checksEKU - sessionConfigurationBuilder.randomizeEndpoint = providerConfiguration[S.randomizeEndpoint] as? Bool ?? ConfigurationBuilder.defaults.sessionConfiguration.randomizeEndpoint - sessionConfigurationBuilder.usesPIAPatches = providerConfiguration[S.usesPIAPatches] as? Bool ?? ConfigurationBuilder.defaults.sessionConfiguration.usesPIAPatches - sessionConfigurationBuilder.dnsServers = providerConfiguration[S.dnsServers] as? [String] - sessionConfigurationBuilder.searchDomain = providerConfiguration[S.searchDomain] as? String - if let proxyString = providerConfiguration[S.httpProxy] as? String { - guard let proxy = Proxy(rawValue: proxyString) else { - throw ProviderConfigurationError.parameter(name: "protocolConfiguration.providerConfiguration[\(S.httpProxy)] has a badly formed element") - } - sessionConfigurationBuilder.httpProxy = proxy - } - if let proxyString = providerConfiguration[S.httpsProxy] as? String { - guard let proxy = Proxy(rawValue: proxyString) else { - throw ProviderConfigurationError.parameter(name: "protocolConfiguration.providerConfiguration[\(S.httpsProxy)] has a badly formed element") - } - sessionConfigurationBuilder.httpsProxy = proxy - } - sessionConfigurationBuilder.proxyBypassDomains = providerConfiguration[S.proxyBypassDomains] as? [String] - if let routingPoliciesStrings = providerConfiguration[S.routingPolicies] as? [String] { - sessionConfigurationBuilder.routingPolicies = try routingPoliciesStrings.map { - guard let policy = OpenVPN.RoutingPolicy(rawValue: $0) else { - throw ProviderConfigurationError.parameter(name: "protocolConfiguration.providerConfiguration[\(S.routingPolicies)] has a badly formed element") - } - return policy - } - } - sessionConfiguration = sessionConfigurationBuilder.build() - + sessionConfiguration = try OpenVPN.Configuration.with(providerConfiguration: providerConfiguration) shouldDebug = providerConfiguration[S.debug] as? Bool ?? ConfigurationBuilder.defaults.shouldDebug if shouldDebug { debugLogFormat = providerConfiguration[S.debugLogFormat] as? String @@ -432,64 +354,7 @@ extension OpenVPNTunnelProvider { S.mtu: mtu, S.debug: shouldDebug ] - if let cipher = sessionConfiguration.cipher { - dict[S.cipherAlgorithm] = cipher.rawValue - } - if let digest = sessionConfiguration.digest { - dict[S.digestAlgorithm] = digest.rawValue - } - if let compressionFraming = sessionConfiguration.compressionFraming { - dict[S.compressionFraming] = compressionFraming.rawValue - } - if let compressionAlgorithm = sessionConfiguration.compressionAlgorithm { - dict[S.compressionAlgorithm] = compressionAlgorithm.rawValue - } - if let clientCertificate = sessionConfiguration.clientCertificate { - dict[S.clientCertificate] = clientCertificate.pem - } - if let clientKey = sessionConfiguration.clientKey { - dict[S.clientKey] = clientKey.pem - } - if let tlsWrapData = sessionConfiguration.tlsWrap?.serialized() { - dict[S.tlsWrap] = tlsWrapData - } - if let tlsSecurityLevel = sessionConfiguration.tlsSecurityLevel { - dict[S.tlsSecurityLevel] = tlsSecurityLevel - } - if let keepAliveSeconds = sessionConfiguration.keepAliveInterval { - dict[S.keepAlive] = keepAliveSeconds - } - if let renegotiatesAfterSeconds = sessionConfiguration.renegotiatesAfter { - dict[S.renegotiatesAfter] = renegotiatesAfterSeconds - } - if let checksEKU = sessionConfiguration.checksEKU { - dict[S.checksEKU] = checksEKU - } - if let randomizeEndpoint = sessionConfiguration.randomizeEndpoint { - dict[S.randomizeEndpoint] = randomizeEndpoint - } - if let usesPIAPatches = sessionConfiguration.usesPIAPatches { - dict[S.usesPIAPatches] = usesPIAPatches - } - if let dnsServers = sessionConfiguration.dnsServers { - dict[S.dnsServers] = dnsServers - } - if let searchDomain = sessionConfiguration.searchDomain { - dict[S.searchDomain] = searchDomain - } - if let httpProxy = sessionConfiguration.httpProxy { - dict[S.httpProxy] = httpProxy.rawValue - } - if let httpsProxy = sessionConfiguration.httpsProxy { - dict[S.httpsProxy] = httpsProxy.rawValue - } - if let proxyBypassDomains = sessionConfiguration.proxyBypassDomains { - dict[S.proxyBypassDomains] = proxyBypassDomains - } - if let routingPolicies = sessionConfiguration.routingPolicies { - dict[S.routingPolicies] = routingPolicies.map { $0.rawValue } - } - // + sessionConfiguration.store(to: &dict) if let resolvedAddresses = resolvedAddresses { dict[S.resolvedAddresses] = resolvedAddresses } @@ -532,78 +397,10 @@ extension OpenVPNTunnelProvider { } func print(appVersion: String?) { - guard let endpointProtocols = sessionConfiguration.endpointProtocols else { - fatalError("No sessionConfiguration.endpointProtocols set") - } - if let appVersion = appVersion { log.info("App version: \(appVersion)") } - - log.info("\tProtocols: \(endpointProtocols)") - log.info("\tCipher: \(sessionConfiguration.fallbackCipher)") - log.info("\tDigest: \(sessionConfiguration.fallbackDigest)") - log.info("\tCompression framing: \(sessionConfiguration.fallbackCompressionFraming)") - if let compressionAlgorithm = sessionConfiguration.compressionAlgorithm, compressionAlgorithm != .disabled { - log.info("\tCompression algorithm: \(compressionAlgorithm)") - } else { - log.info("\tCompression algorithm: disabled") - } - if let _ = sessionConfiguration.clientCertificate { - log.info("\tClient verification: enabled") - } else { - log.info("\tClient verification: disabled") - } - if let tlsWrap = sessionConfiguration.tlsWrap { - log.info("\tTLS wrapping: \(tlsWrap.strategy)") - } else { - log.info("\tTLS wrapping: disabled") - } - if let tlsSecurityLevel = sessionConfiguration.tlsSecurityLevel { - log.info("\tTLS security level: \(tlsSecurityLevel)") - } else { - log.info("\tTLS security level: default") - } - if let keepAliveSeconds = sessionConfiguration.keepAliveInterval, keepAliveSeconds > 0 { - log.info("\tKeep-alive: \(keepAliveSeconds) seconds") - } else { - log.info("\tKeep-alive: never") - } - if let renegotiatesAfterSeconds = sessionConfiguration.renegotiatesAfter, renegotiatesAfterSeconds > 0 { - log.info("\tRenegotiation: \(renegotiatesAfterSeconds) seconds") - } else { - log.info("\tRenegotiation: never") - } - if sessionConfiguration.checksEKU ?? false { - log.info("\tServer EKU verification: enabled") - } else { - log.info("\tServer EKU verification: disabled") - } - if sessionConfiguration.randomizeEndpoint ?? false { - log.info("\tRandomize endpoint: true") - } - if let routingPolicies = sessionConfiguration.routingPolicies { - log.info("\tGateway: \(routingPolicies.map { $0.rawValue })") - } else { - log.info("\tGateway: not configured") - } - if let dnsServers = sessionConfiguration.dnsServers, !dnsServers.isEmpty { - log.info("\tDNS: \(dnsServers.maskedDescription)") - } else { - log.info("\tDNS: not configured") - } - if let searchDomain = sessionConfiguration.searchDomain, !searchDomain.isEmpty { - log.info("\tSearch domain: \(searchDomain.maskedDescription)") - } - if let httpProxy = sessionConfiguration.httpProxy { - log.info("\tHTTP proxy: \(httpProxy.maskedDescription)") - } - if let httpsProxy = sessionConfiguration.httpsProxy { - log.info("\tHTTPS proxy: \(httpsProxy.maskedDescription)") - } - if let proxyBypassDomains = sessionConfiguration.proxyBypassDomains { - log.info("\tProxy bypass domains: \(proxyBypassDomains.maskedDescription)") - } + sessionConfiguration.print() log.info("\tMTU: \(mtu)") log.info("\tDebug: \(shouldDebug)") log.info("\tMasks private data: \(masksPrivateData ?? true)") @@ -614,10 +411,10 @@ extension OpenVPNTunnelProvider { // MARK: Modification extension OpenVPNTunnelProvider.Configuration { - + /** Returns a `OpenVPNTunnelProvider.ConfigurationBuilder` to use this configuration as a starting point for a new one. - + - Returns: An editable `OpenVPNTunnelProvider.ConfigurationBuilder` initialized with this configuration. */ public func builder() -> OpenVPNTunnelProvider.ConfigurationBuilder { @@ -642,8 +439,226 @@ public extension UserDefaults { set(newValue, forKey: OpenVPNTunnelProvider.Configuration.dataCountKey) } } - + func removeDataCountArray() { removeObject(forKey: OpenVPNTunnelProvider.Configuration.dataCountKey) } } + +// MARK: OpenVPN configuration + +private extension OpenVPN.Configuration { + static func with(providerConfiguration: [String: Any]) throws -> OpenVPN.Configuration { + let S = OpenVPNTunnelProvider.Configuration.Keys.self + let E = OpenVPNTunnelProvider.ProviderConfigurationError.self + let D = OpenVPNTunnelProvider.ConfigurationBuilder.defaults.sessionConfiguration + + guard let caPEM = providerConfiguration[S.ca] as? String else { + throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.ca)]") + } + + var builder = D.builder() + if let cipherAlgorithm = providerConfiguration[S.cipherAlgorithm] as? String { + builder.cipher = OpenVPN.Cipher(rawValue: cipherAlgorithm) + } + if let digestAlgorithm = providerConfiguration[S.digestAlgorithm] as? String { + builder.digest = OpenVPN.Digest(rawValue: digestAlgorithm) + } + if let compressionFramingValue = providerConfiguration[S.compressionFraming] as? Int, let compressionFraming = OpenVPN.CompressionFraming(rawValue: compressionFramingValue) { + builder.compressionFraming = compressionFraming + } else { + builder.compressionFraming = D.compressionFraming + } + if let compressionAlgorithmValue = providerConfiguration[S.compressionAlgorithm] as? Int, let compressionAlgorithm = OpenVPN.CompressionAlgorithm(rawValue: compressionAlgorithmValue) { + builder.compressionAlgorithm = compressionAlgorithm + } else { + builder.compressionAlgorithm = D.compressionAlgorithm + } + builder.ca = OpenVPN.CryptoContainer(pem: caPEM) + if let clientPEM = providerConfiguration[S.clientCertificate] as? String { + guard let keyPEM = providerConfiguration[S.clientKey] as? String else { + throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.clientKey)]") + } + builder.clientCertificate = OpenVPN.CryptoContainer(pem: clientPEM) + builder.clientKey = OpenVPN.CryptoContainer(pem: keyPEM) + } + if let tlsWrapData = providerConfiguration[S.tlsWrap] as? Data { + do { + builder.tlsWrap = try OpenVPN.TLSWrap.deserialized(tlsWrapData) + } catch { + throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.tlsWrap)]") + } + } + builder.tlsSecurityLevel = providerConfiguration[S.tlsSecurityLevel] as? Int ?? D.tlsSecurityLevel + builder.keepAliveInterval = providerConfiguration[S.keepAlive] as? TimeInterval ?? D.keepAliveInterval + builder.renegotiatesAfter = providerConfiguration[S.renegotiatesAfter] as? TimeInterval ?? D.renegotiatesAfter + guard let endpointProtocolsStrings = providerConfiguration[S.endpointProtocols] as? [String], !endpointProtocolsStrings.isEmpty else { + throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.endpointProtocols)] is nil or empty") + } + builder.endpointProtocols = try endpointProtocolsStrings.map { + guard let ep = EndpointProtocol(rawValue: $0) else { + throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.endpointProtocols)] has a badly formed element") + } + return ep + } + builder.checksEKU = providerConfiguration[S.checksEKU] as? Bool ?? D.checksEKU + builder.randomizeEndpoint = providerConfiguration[S.randomizeEndpoint] as? Bool ?? D.randomizeEndpoint + builder.usesPIAPatches = providerConfiguration[S.usesPIAPatches] as? Bool ?? D.usesPIAPatches + builder.dnsServers = providerConfiguration[S.dnsServers] as? [String] + builder.searchDomain = providerConfiguration[S.searchDomain] as? String + if let proxyString = providerConfiguration[S.httpProxy] as? String { + guard let proxy = Proxy(rawValue: proxyString) else { + throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.httpProxy)] has a badly formed element") + } + builder.httpProxy = proxy + } + if let proxyString = providerConfiguration[S.httpsProxy] as? String { + guard let proxy = Proxy(rawValue: proxyString) else { + throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.httpsProxy)] has a badly formed element") + } + builder.httpsProxy = proxy + } + builder.proxyBypassDomains = providerConfiguration[S.proxyBypassDomains] as? [String] + if let routingPoliciesStrings = providerConfiguration[S.routingPolicies] as? [String] { + builder.routingPolicies = try routingPoliciesStrings.map { + guard let policy = OpenVPN.RoutingPolicy(rawValue: $0) else { + throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.routingPolicies)] has a badly formed element") + } + return policy + } + } + return builder.build() + } + + func store(to dict: inout [String: Any]) { + let S = OpenVPNTunnelProvider.Configuration.Keys.self + + if let cipher = cipher { + dict[S.cipherAlgorithm] = cipher.rawValue + } + if let digest = digest { + dict[S.digestAlgorithm] = digest.rawValue + } + if let compressionFraming = compressionFraming { + dict[S.compressionFraming] = compressionFraming.rawValue + } + if let compressionAlgorithm = compressionAlgorithm { + dict[S.compressionAlgorithm] = compressionAlgorithm.rawValue + } + if let clientCertificate = clientCertificate { + dict[S.clientCertificate] = clientCertificate.pem + } + if let clientKey = clientKey { + dict[S.clientKey] = clientKey.pem + } + if let tlsWrapData = tlsWrap?.serialized() { + dict[S.tlsWrap] = tlsWrapData + } + if let tlsSecurityLevel = tlsSecurityLevel { + dict[S.tlsSecurityLevel] = tlsSecurityLevel + } + if let keepAliveSeconds = keepAliveInterval { + dict[S.keepAlive] = keepAliveSeconds + } + if let renegotiatesAfterSeconds = renegotiatesAfter { + dict[S.renegotiatesAfter] = renegotiatesAfterSeconds + } + if let checksEKU = checksEKU { + dict[S.checksEKU] = checksEKU + } + if let randomizeEndpoint = randomizeEndpoint { + dict[S.randomizeEndpoint] = randomizeEndpoint + } + if let usesPIAPatches = usesPIAPatches { + dict[S.usesPIAPatches] = usesPIAPatches + } + if let dnsServers = dnsServers { + dict[S.dnsServers] = dnsServers + } + if let searchDomain = searchDomain { + dict[S.searchDomain] = searchDomain + } + if let httpProxy = httpProxy { + dict[S.httpProxy] = httpProxy.rawValue + } + if let httpsProxy = httpsProxy { + dict[S.httpsProxy] = httpsProxy.rawValue + } + if let proxyBypassDomains = proxyBypassDomains { + dict[S.proxyBypassDomains] = proxyBypassDomains + } + if let routingPolicies = routingPolicies { + dict[S.routingPolicies] = routingPolicies.map { $0.rawValue } + } + } + + func print() { + guard let endpointProtocols = endpointProtocols else { + fatalError("No sessionConfiguration.endpointProtocols set") + } + log.info("\tProtocols: \(endpointProtocols)") + log.info("\tCipher: \(fallbackCipher)") + log.info("\tDigest: \(fallbackDigest)") + log.info("\tCompression framing: \(fallbackCompressionFraming)") + if let compressionAlgorithm = compressionAlgorithm, compressionAlgorithm != .disabled { + log.info("\tCompression algorithm: \(compressionAlgorithm)") + } else { + log.info("\tCompression algorithm: disabled") + } + if let _ = clientCertificate { + log.info("\tClient verification: enabled") + } else { + log.info("\tClient verification: disabled") + } + if let tlsWrap = tlsWrap { + log.info("\tTLS wrapping: \(tlsWrap.strategy)") + } else { + log.info("\tTLS wrapping: disabled") + } + if let tlsSecurityLevel = tlsSecurityLevel { + log.info("\tTLS security level: \(tlsSecurityLevel)") + } else { + log.info("\tTLS security level: default") + } + if let keepAliveSeconds = keepAliveInterval, keepAliveSeconds > 0 { + log.info("\tKeep-alive: \(keepAliveSeconds) seconds") + } else { + log.info("\tKeep-alive: never") + } + if let renegotiatesAfterSeconds = renegotiatesAfter, renegotiatesAfterSeconds > 0 { + log.info("\tRenegotiation: \(renegotiatesAfterSeconds) seconds") + } else { + log.info("\tRenegotiation: never") + } + if checksEKU ?? false { + log.info("\tServer EKU verification: enabled") + } else { + log.info("\tServer EKU verification: disabled") + } + if randomizeEndpoint ?? false { + log.info("\tRandomize endpoint: true") + } + if let routingPolicies = routingPolicies { + log.info("\tGateway: \(routingPolicies.map { $0.rawValue })") + } else { + log.info("\tGateway: not configured") + } + if let dnsServers = dnsServers, !dnsServers.isEmpty { + log.info("\tDNS: \(dnsServers.maskedDescription)") + } else { + log.info("\tDNS: not configured") + } + if let searchDomain = searchDomain, !searchDomain.isEmpty { + log.info("\tSearch domain: \(searchDomain.maskedDescription)") + } + if let httpProxy = httpProxy { + log.info("\tHTTP proxy: \(httpProxy.maskedDescription)") + } + if let httpsProxy = httpsProxy { + log.info("\tHTTPS proxy: \(httpsProxy.maskedDescription)") + } + if let proxyBypassDomains = proxyBypassDomains { + log.info("\tProxy bypass domains: \(proxyBypassDomains.maskedDescription)") + } + } +} From 1f8c51c126a5ad8f4e3e7e3496e058a51c49f6ab Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 24 May 2019 10:59:04 +0200 Subject: [PATCH 04/12] Parse OpenVPN.Configuration from defaults --- .../OpenVPNTunnelProvider+Configuration.swift | 63 ++++++++++++------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift index 83a0cb0..f452c60 100644 --- a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift @@ -451,13 +451,24 @@ private extension OpenVPN.Configuration { static func with(providerConfiguration: [String: Any]) throws -> OpenVPN.Configuration { let S = OpenVPNTunnelProvider.Configuration.Keys.self let E = OpenVPNTunnelProvider.ProviderConfigurationError.self - let D = OpenVPNTunnelProvider.ConfigurationBuilder.defaults.sessionConfiguration guard let caPEM = providerConfiguration[S.ca] as? String else { throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.ca)]") } - - var builder = D.builder() + guard let endpointProtocolsStrings = providerConfiguration[S.endpointProtocols] as? [String], !endpointProtocolsStrings.isEmpty else { + throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.endpointProtocols)] is nil or empty") + } + + var builder = OpenVPNTunnelProvider.ConfigurationBuilder.defaults.sessionConfiguration.builder() + + builder.ca = OpenVPN.CryptoContainer(pem: caPEM) + builder.endpointProtocols = try endpointProtocolsStrings.map { + guard let ep = EndpointProtocol(rawValue: $0) else { + throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.endpointProtocols)] has a badly formed element") + } + return ep + } + if let cipherAlgorithm = providerConfiguration[S.cipherAlgorithm] as? String { builder.cipher = OpenVPN.Cipher(rawValue: cipherAlgorithm) } @@ -466,15 +477,10 @@ private extension OpenVPN.Configuration { } if let compressionFramingValue = providerConfiguration[S.compressionFraming] as? Int, let compressionFraming = OpenVPN.CompressionFraming(rawValue: compressionFramingValue) { builder.compressionFraming = compressionFraming - } else { - builder.compressionFraming = D.compressionFraming } if let compressionAlgorithmValue = providerConfiguration[S.compressionAlgorithm] as? Int, let compressionAlgorithm = OpenVPN.CompressionAlgorithm(rawValue: compressionAlgorithmValue) { builder.compressionAlgorithm = compressionAlgorithm - } else { - builder.compressionAlgorithm = D.compressionAlgorithm } - builder.ca = OpenVPN.CryptoContainer(pem: caPEM) if let clientPEM = providerConfiguration[S.clientCertificate] as? String { guard let keyPEM = providerConfiguration[S.clientKey] as? String else { throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.clientKey)]") @@ -489,23 +495,30 @@ private extension OpenVPN.Configuration { throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.tlsWrap)]") } } - builder.tlsSecurityLevel = providerConfiguration[S.tlsSecurityLevel] as? Int ?? D.tlsSecurityLevel - builder.keepAliveInterval = providerConfiguration[S.keepAlive] as? TimeInterval ?? D.keepAliveInterval - builder.renegotiatesAfter = providerConfiguration[S.renegotiatesAfter] as? TimeInterval ?? D.renegotiatesAfter - guard let endpointProtocolsStrings = providerConfiguration[S.endpointProtocols] as? [String], !endpointProtocolsStrings.isEmpty else { - throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.endpointProtocols)] is nil or empty") + if let tlsSecurityLevel = providerConfiguration[S.tlsSecurityLevel] as? Int { + builder.tlsSecurityLevel = tlsSecurityLevel } - builder.endpointProtocols = try endpointProtocolsStrings.map { - guard let ep = EndpointProtocol(rawValue: $0) else { - throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.endpointProtocols)] has a badly formed element") - } - return ep + if let keepAliveInterval = providerConfiguration[S.keepAlive] as? TimeInterval { + builder.keepAliveInterval = keepAliveInterval + } + if let renegotiatesAfter = providerConfiguration[S.renegotiatesAfter] as? TimeInterval { + builder.renegotiatesAfter = renegotiatesAfter + } + if let checksEKU = providerConfiguration[S.checksEKU] as? Bool { + builder.checksEKU = checksEKU + } + if let randomizeEndpoint = providerConfiguration[S.randomizeEndpoint] as? Bool { + builder.randomizeEndpoint = randomizeEndpoint + } + if let usesPIAPatches = providerConfiguration[S.usesPIAPatches] as? Bool { + builder.usesPIAPatches = usesPIAPatches + } + if let dnsServers = providerConfiguration[S.dnsServers] as? [String] { + builder.dnsServers = dnsServers + } + if let searchDomain = providerConfiguration[S.searchDomain] as? String { + builder.searchDomain = searchDomain } - builder.checksEKU = providerConfiguration[S.checksEKU] as? Bool ?? D.checksEKU - builder.randomizeEndpoint = providerConfiguration[S.randomizeEndpoint] as? Bool ?? D.randomizeEndpoint - builder.usesPIAPatches = providerConfiguration[S.usesPIAPatches] as? Bool ?? D.usesPIAPatches - builder.dnsServers = providerConfiguration[S.dnsServers] as? [String] - builder.searchDomain = providerConfiguration[S.searchDomain] as? String if let proxyString = providerConfiguration[S.httpProxy] as? String { guard let proxy = Proxy(rawValue: proxyString) else { throw E.parameter(name: "protocolConfiguration.providerConfiguration[\(S.httpProxy)] has a badly formed element") @@ -518,7 +531,9 @@ private extension OpenVPN.Configuration { } builder.httpsProxy = proxy } - builder.proxyBypassDomains = providerConfiguration[S.proxyBypassDomains] as? [String] + if let proxyBypassDomains = providerConfiguration[S.proxyBypassDomains] as? [String] { + builder.proxyBypassDomains = proxyBypassDomains + } if let routingPoliciesStrings = providerConfiguration[S.routingPolicies] as? [String] { builder.routingPolicies = try routingPoliciesStrings.map { guard let policy = OpenVPN.RoutingPolicy(rawValue: $0) else { From 185f0707cfb27f0f3eec3bc1c20e5ef5378d83fe Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 23 May 2019 22:14:20 +0200 Subject: [PATCH 05/12] Move OpenVPN configuration part on top --- .../OpenVPNTunnelProvider+Configuration.swift | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift index f452c60..b160f2b 100644 --- a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift @@ -49,16 +49,19 @@ extension OpenVPNTunnelProvider { /// :nodoc: public static let defaults = Configuration( + sessionConfiguration: OpenVPN.ConfigurationBuilder().build(), prefersResolvedAddresses: false, resolvedAddresses: nil, endpointProtocols: nil, mtu: 1250, - sessionConfiguration: OpenVPN.ConfigurationBuilder().build(), shouldDebug: false, debugLogFormat: nil, masksPrivateData: true ) + /// The session configuration. + public var sessionConfiguration: OpenVPN.Configuration + /// Prefers resolved addresses over DNS resolution. `resolvedAddresses` must be set and non-empty. Default is `false`. /// /// - Seealso: `fallbackServerAddresses` @@ -70,9 +73,6 @@ extension OpenVPNTunnelProvider { /// The MTU of the link. public var mtu: Int - /// The session configuration. - public var sessionConfiguration: OpenVPN.Configuration - // MARK: Debugging /// Enables debugging. @@ -92,10 +92,10 @@ extension OpenVPNTunnelProvider { - Parameter ca: The CA certificate. */ public init(sessionConfiguration: OpenVPN.Configuration) { + self.sessionConfiguration = sessionConfiguration prefersResolvedAddresses = ConfigurationBuilder.defaults.prefersResolvedAddresses resolvedAddresses = nil mtu = ConfigurationBuilder.defaults.mtu - self.sessionConfiguration = sessionConfiguration shouldDebug = ConfigurationBuilder.defaults.shouldDebug debugLogFormat = ConfigurationBuilder.defaults.debugLogFormat masksPrivateData = ConfigurationBuilder.defaults.masksPrivateData @@ -104,10 +104,10 @@ extension OpenVPNTunnelProvider { fileprivate init(providerConfiguration: [String: Any]) throws { let S = Configuration.Keys.self + sessionConfiguration = try OpenVPN.Configuration.with(providerConfiguration: providerConfiguration) prefersResolvedAddresses = providerConfiguration[S.prefersResolvedAddresses] as? Bool ?? ConfigurationBuilder.defaults.prefersResolvedAddresses resolvedAddresses = providerConfiguration[S.resolvedAddresses] as? [String] mtu = providerConfiguration[S.mtu] as? Int ?? ConfigurationBuilder.defaults.mtu - sessionConfiguration = try OpenVPN.Configuration.with(providerConfiguration: providerConfiguration) shouldDebug = providerConfiguration[S.debug] as? Bool ?? ConfigurationBuilder.defaults.shouldDebug if shouldDebug { debugLogFormat = providerConfiguration[S.debugLogFormat] as? String @@ -126,11 +126,11 @@ extension OpenVPNTunnelProvider { */ public func build() -> Configuration { return Configuration( + sessionConfiguration: sessionConfiguration, prefersResolvedAddresses: prefersResolvedAddresses, resolvedAddresses: resolvedAddresses, endpointProtocols: nil, mtu: mtu, - sessionConfiguration: sessionConfiguration, shouldDebug: shouldDebug, debugLogFormat: shouldDebug ? debugLogFormat : nil, masksPrivateData: masksPrivateData @@ -143,12 +143,6 @@ extension OpenVPNTunnelProvider { struct Keys { static let appGroup = "AppGroup" - static let prefersResolvedAddresses = "PrefersResolvedAddresses" - - static let resolvedAddresses = "ResolvedAddresses" - - static let mtu = "MTU" - // MARK: SessionConfiguration static let cipherAlgorithm = "CipherAlgorithm" @@ -193,6 +187,14 @@ extension OpenVPNTunnelProvider { static let routingPolicies = "RoutingPolicies" + // MARK: Customization + + static let prefersResolvedAddresses = "PrefersResolvedAddresses" + + static let resolvedAddresses = "ResolvedAddresses" + + static let mtu = "MTU" + // MARK: Debugging static let debug = "Debug" @@ -202,6 +204,9 @@ extension OpenVPNTunnelProvider { static let masksPrivateData = "MasksPrivateData" } + /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.sessionConfiguration` + public let sessionConfiguration: OpenVPN.Configuration + /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.prefersResolvedAddresses` public let prefersResolvedAddresses: Bool @@ -215,9 +220,6 @@ extension OpenVPNTunnelProvider { /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.mtu` public let mtu: Int - /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.sessionConfiguration` - public let sessionConfiguration: OpenVPN.Configuration - /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.shouldDebug` public let shouldDebug: Bool From 3edd00b2da9b23bc367e78a428783ddbeebe9aa4 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 23 May 2019 22:27:54 +0200 Subject: [PATCH 06/12] Drop deprecated endpointProtocols --- .../AppExtension/OpenVPNTunnelProvider+Configuration.swift | 6 ------ 1 file changed, 6 deletions(-) diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift index b160f2b..0f2e382 100644 --- a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift @@ -52,7 +52,6 @@ extension OpenVPNTunnelProvider { sessionConfiguration: OpenVPN.ConfigurationBuilder().build(), prefersResolvedAddresses: false, resolvedAddresses: nil, - endpointProtocols: nil, mtu: 1250, shouldDebug: false, debugLogFormat: nil, @@ -129,7 +128,6 @@ extension OpenVPNTunnelProvider { sessionConfiguration: sessionConfiguration, prefersResolvedAddresses: prefersResolvedAddresses, resolvedAddresses: resolvedAddresses, - endpointProtocols: nil, mtu: mtu, shouldDebug: shouldDebug, debugLogFormat: shouldDebug ? debugLogFormat : nil, @@ -213,10 +211,6 @@ extension OpenVPNTunnelProvider { /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.resolvedAddresses` public let resolvedAddresses: [String]? - /// - Seealso: `OpenVPN.Configuration.endpointProtocols` - @available(*, deprecated) - public var endpointProtocols: [EndpointProtocol]? - /// - Seealso: `OpenVPNTunnelProvider.ConfigurationBuilder.mtu` public let mtu: Int From 334613401b69a1d6ba74ac949a7b1d843384d119 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 24 May 2019 10:42:13 +0200 Subject: [PATCH 07/12] Organize tests by subspec Split TestUtils. --- TunnelKit.xcodeproj/project.pbxproj | 76 +++++++++++++------ TunnelKitTests/{ => Core}/DNSTests.swift | 0 .../{ => Core}/DataManipulationTests.swift | 0 TunnelKitTests/{ => Core}/RandomTests.swift | 0 .../{ => Core}/RawPerformanceTests.swift | 0 TunnelKitTests/{ => Core}/RoutingTests.swift | 0 TunnelKitTests/Core/TestUtils+Core.swift | 55 ++++++++++++++ .../{ => LZO}/CompressionTests.swift | 0 .../{ => OpenVPN}/AppExtensionTests.swift | 0 .../ConfigurationParserTests.swift | 0 .../{ => OpenVPN}/ControlChannelTests.swift | 0 .../DataPathEncryptionTests.swift | 0 .../DataPathPerformanceTests.swift | 0 .../EncryptionPerformanceTests.swift | 0 .../{ => OpenVPN}/EncryptionTests.swift | 0 TunnelKitTests/{ => OpenVPN}/LinkTests.swift | 0 .../{ => OpenVPN}/PacketTests.swift | 0 TunnelKitTests/{ => OpenVPN}/PushTests.swift | 0 .../{ => OpenVPN}/StaticKeyTests.swift | 0 .../TestUtils+OpenVPN.swift} | 19 +---- 20 files changed, 109 insertions(+), 41 deletions(-) rename TunnelKitTests/{ => Core}/DNSTests.swift (100%) rename TunnelKitTests/{ => Core}/DataManipulationTests.swift (100%) rename TunnelKitTests/{ => Core}/RandomTests.swift (100%) rename TunnelKitTests/{ => Core}/RawPerformanceTests.swift (100%) rename TunnelKitTests/{ => Core}/RoutingTests.swift (100%) create mode 100644 TunnelKitTests/Core/TestUtils+Core.swift rename TunnelKitTests/{ => LZO}/CompressionTests.swift (100%) rename TunnelKitTests/{ => OpenVPN}/AppExtensionTests.swift (100%) rename TunnelKitTests/{ => OpenVPN}/ConfigurationParserTests.swift (100%) rename TunnelKitTests/{ => OpenVPN}/ControlChannelTests.swift (100%) rename TunnelKitTests/{ => OpenVPN}/DataPathEncryptionTests.swift (100%) rename TunnelKitTests/{ => OpenVPN}/DataPathPerformanceTests.swift (100%) rename TunnelKitTests/{ => OpenVPN}/EncryptionPerformanceTests.swift (100%) rename TunnelKitTests/{ => OpenVPN}/EncryptionTests.swift (100%) rename TunnelKitTests/{ => OpenVPN}/LinkTests.swift (100%) rename TunnelKitTests/{ => OpenVPN}/PacketTests.swift (100%) rename TunnelKitTests/{ => OpenVPN}/PushTests.swift (100%) rename TunnelKitTests/{ => OpenVPN}/StaticKeyTests.swift (100%) rename TunnelKitTests/{TestUtils.swift => OpenVPN/TestUtils+OpenVPN.swift} (88%) diff --git a/TunnelKit.xcodeproj/project.pbxproj b/TunnelKit.xcodeproj/project.pbxproj index cdbe503..9c13e62 100644 --- a/TunnelKit.xcodeproj/project.pbxproj +++ b/TunnelKit.xcodeproj/project.pbxproj @@ -57,6 +57,8 @@ 0E23B3D42297193000304C30 /* NEUDPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3D22297193000304C30 /* NEUDPLink.swift */; }; 0E23B3DE229749C600304C30 /* LinkProducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3DD229749C600304C30 /* LinkProducer.swift */; }; 0E23B3DF229749C600304C30 /* LinkProducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3DD229749C600304C30 /* LinkProducer.swift */; }; + 0E23B3DB2297466600304C30 /* TestUtils+Core.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3D82297463200304C30 /* TestUtils+Core.swift */; }; + 0E23B3DC2297466700304C30 /* TestUtils+Core.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3D82297463200304C30 /* TestUtils+Core.swift */; }; 0E245D6C2137F73600B012A2 /* CompressionFramingNative.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E245D6B2137F73600B012A2 /* CompressionFramingNative.h */; }; 0E39BCE8214B2AB60035E9DE /* ControlPacket.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */; }; 0E39BCE9214B2AB60035E9DE /* ControlPacket.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */; }; @@ -181,7 +183,7 @@ 0EE2FA502291954300F56F49 /* RawPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA0C2291953300F56F49 /* RawPerformanceTests.swift */; }; 0EE2FA512291954300F56F49 /* RoutingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA132291953300F56F49 /* RoutingTests.swift */; }; 0EE2FA522291954300F56F49 /* StaticKeyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA142291953300F56F49 /* StaticKeyTests.swift */; }; - 0EE2FA532291954300F56F49 /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA152291953300F56F49 /* TestUtils.swift */; }; + 0EE2FA532291954300F56F49 /* TestUtils+OpenVPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA152291953300F56F49 /* TestUtils+OpenVPN.swift */; }; 0EE2FA542291954400F56F49 /* AppExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA0E2291953300F56F49 /* AppExtensionTests.swift */; }; 0EE2FA552291954400F56F49 /* CompressionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA1C2291953300F56F49 /* CompressionTests.swift */; }; 0EE2FA562291954400F56F49 /* ConfigurationParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA162291953300F56F49 /* ConfigurationParserTests.swift */; }; @@ -199,7 +201,7 @@ 0EE2FA622291954400F56F49 /* RawPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA0C2291953300F56F49 /* RawPerformanceTests.swift */; }; 0EE2FA632291954400F56F49 /* RoutingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA132291953300F56F49 /* RoutingTests.swift */; }; 0EE2FA642291954400F56F49 /* StaticKeyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA142291953300F56F49 /* StaticKeyTests.swift */; }; - 0EE2FA652291954400F56F49 /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA152291953300F56F49 /* TestUtils.swift */; }; + 0EE2FA652291954400F56F49 /* TestUtils+OpenVPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA152291953300F56F49 /* TestUtils+OpenVPN.swift */; }; 0EE3B3E421471C3A0027AB17 /* StaticKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE3B3E321471C3A0027AB17 /* StaticKey.swift */; }; 0EE3B3E521471C3A0027AB17 /* StaticKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE3B3E321471C3A0027AB17 /* StaticKey.swift */; }; 0EE7A79820F6296F00B42E6A /* PacketMacros.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE7A79720F6296F00B42E6A /* PacketMacros.m */; }; @@ -339,6 +341,7 @@ 0E23B3CF2297192900304C30 /* NETCPLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NETCPLink.swift; sourceTree = ""; }; 0E23B3D22297193000304C30 /* NEUDPLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NEUDPLink.swift; sourceTree = ""; }; 0E23B3DD229749C600304C30 /* LinkProducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkProducer.swift; sourceTree = ""; }; + 0E23B3D82297463200304C30 /* TestUtils+Core.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TestUtils+Core.swift"; sourceTree = ""; }; 0E245D6B2137F73600B012A2 /* CompressionFramingNative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompressionFramingNative.h; sourceTree = ""; }; 0E3251C51F95770D00C108D9 /* TunnelKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TunnelKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ControlPacket.h; sourceTree = ""; }; @@ -410,7 +413,7 @@ 0EE2FA122291953300F56F49 /* LinkTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinkTests.swift; sourceTree = ""; }; 0EE2FA132291953300F56F49 /* RoutingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RoutingTests.swift; sourceTree = ""; }; 0EE2FA142291953300F56F49 /* StaticKeyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StaticKeyTests.swift; sourceTree = ""; }; - 0EE2FA152291953300F56F49 /* TestUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestUtils.swift; sourceTree = ""; }; + 0EE2FA152291953300F56F49 /* TestUtils+OpenVPN.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TestUtils+OpenVPN.swift"; sourceTree = ""; }; 0EE2FA162291953300F56F49 /* ConfigurationParserTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigurationParserTests.swift; sourceTree = ""; }; 0EE2FA172291953300F56F49 /* EncryptionPerformanceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EncryptionPerformanceTests.swift; sourceTree = ""; }; 0EE2FA182291953300F56F49 /* PacketTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PacketTests.swift; sourceTree = ""; }; @@ -520,24 +523,9 @@ 0E11089B1F77B9E800A92462 /* TunnelKitTests */ = { isa = PBXGroup; children = ( - 0EE2FA0E2291953300F56F49 /* AppExtensionTests.swift */, - 0EE2FA1C2291953300F56F49 /* CompressionTests.swift */, - 0EE2FA162291953300F56F49 /* ConfigurationParserTests.swift */, - 0EE2FA1A2291953300F56F49 /* ControlChannelTests.swift */, - 0EE2FA192291953300F56F49 /* DataManipulationTests.swift */, - 0EE2FA1D2291953300F56F49 /* DataPathEncryptionTests.swift */, - 0EE2FA0D2291953300F56F49 /* DataPathPerformanceTests.swift */, - 0EE2FA112291953300F56F49 /* DNSTests.swift */, - 0EE2FA172291953300F56F49 /* EncryptionPerformanceTests.swift */, - 0EE2FA102291953300F56F49 /* EncryptionTests.swift */, - 0EE2FA122291953300F56F49 /* LinkTests.swift */, - 0EE2FA182291953300F56F49 /* PacketTests.swift */, - 0EE2FA1B2291953300F56F49 /* PushTests.swift */, - 0EE2FA0F2291953300F56F49 /* RandomTests.swift */, - 0EE2FA0C2291953300F56F49 /* RawPerformanceTests.swift */, - 0EE2FA132291953300F56F49 /* RoutingTests.swift */, - 0EE2FA142291953300F56F49 /* StaticKeyTests.swift */, - 0EE2FA152291953300F56F49 /* TestUtils.swift */, + 0E23B3D52297451700304C30 /* OpenVPN */, + 0E23B3D62297452B00304C30 /* LZO */, + 0E23B3D72297452E00304C30 /* Core */, 0E749F612178911C00BB2701 /* pia-2048.pem */, 0E011F832196E25400BA59EE /* pia-hungary.ovpn */, 0ECEB11A2252CDAD00E9E551 /* tunnelbear.crt */, @@ -624,6 +612,46 @@ path = AppExtension; sourceTree = ""; }; + 0E23B3D52297451700304C30 /* OpenVPN */ = { + isa = PBXGroup; + children = ( + 0EE2FA0E2291953300F56F49 /* AppExtensionTests.swift */, + 0EE2FA162291953300F56F49 /* ConfigurationParserTests.swift */, + 0EE2FA1A2291953300F56F49 /* ControlChannelTests.swift */, + 0EE2FA1D2291953300F56F49 /* DataPathEncryptionTests.swift */, + 0EE2FA0D2291953300F56F49 /* DataPathPerformanceTests.swift */, + 0EE2FA172291953300F56F49 /* EncryptionPerformanceTests.swift */, + 0EE2FA102291953300F56F49 /* EncryptionTests.swift */, + 0EE2FA122291953300F56F49 /* LinkTests.swift */, + 0EE2FA182291953300F56F49 /* PacketTests.swift */, + 0EE2FA1B2291953300F56F49 /* PushTests.swift */, + 0EE2FA142291953300F56F49 /* StaticKeyTests.swift */, + 0EE2FA152291953300F56F49 /* TestUtils+OpenVPN.swift */, + ); + path = OpenVPN; + sourceTree = ""; + }; + 0E23B3D62297452B00304C30 /* LZO */ = { + isa = PBXGroup; + children = ( + 0EE2FA1C2291953300F56F49 /* CompressionTests.swift */, + ); + path = LZO; + sourceTree = ""; + }; + 0E23B3D72297452E00304C30 /* Core */ = { + isa = PBXGroup; + children = ( + 0EE2FA192291953300F56F49 /* DataManipulationTests.swift */, + 0EE2FA112291953300F56F49 /* DNSTests.swift */, + 0EE2FA0F2291953300F56F49 /* RandomTests.swift */, + 0EE2FA0C2291953300F56F49 /* RawPerformanceTests.swift */, + 0EE2FA132291953300F56F49 /* RoutingTests.swift */, + 0E23B3D82297463200304C30 /* TestUtils+Core.swift */, + ); + path = Core; + sourceTree = ""; + }; 0E58BEDC2240521F006FB157 /* LZO */ = { isa = PBXGroup; children = ( @@ -1261,6 +1289,7 @@ 0EE2FA472291954300F56F49 /* DataPathEncryptionTests.swift in Sources */, 0EE2FA502291954300F56F49 /* RawPerformanceTests.swift in Sources */, 0EE2FA4D2291954300F56F49 /* PacketTests.swift in Sources */, + 0E23B3DB2297466600304C30 /* TestUtils+Core.swift in Sources */, 0EE2FA452291954300F56F49 /* ControlChannelTests.swift in Sources */, 0EE2FA4E2291954300F56F49 /* PushTests.swift in Sources */, 0EE2FA422291954300F56F49 /* AppExtensionTests.swift in Sources */, @@ -1268,7 +1297,7 @@ 0EE2FA4A2291954300F56F49 /* EncryptionPerformanceTests.swift in Sources */, 0EE2FA4F2291954300F56F49 /* RandomTests.swift in Sources */, 0EE2FA4B2291954300F56F49 /* EncryptionTests.swift in Sources */, - 0EE2FA532291954300F56F49 /* TestUtils.swift in Sources */, + 0EE2FA532291954300F56F49 /* TestUtils+OpenVPN.swift in Sources */, 0EE2FA462291954300F56F49 /* DataManipulationTests.swift in Sources */, 0EE2FA4C2291954300F56F49 /* LinkTests.swift in Sources */, 0EE2FA442291954300F56F49 /* ConfigurationParserTests.swift in Sources */, @@ -1459,6 +1488,7 @@ 0EE2FA592291954400F56F49 /* DataPathEncryptionTests.swift in Sources */, 0EE2FA622291954400F56F49 /* RawPerformanceTests.swift in Sources */, 0EE2FA5F2291954400F56F49 /* PacketTests.swift in Sources */, + 0E23B3DC2297466700304C30 /* TestUtils+Core.swift in Sources */, 0EE2FA572291954400F56F49 /* ControlChannelTests.swift in Sources */, 0EE2FA602291954400F56F49 /* PushTests.swift in Sources */, 0EE2FA542291954400F56F49 /* AppExtensionTests.swift in Sources */, @@ -1466,7 +1496,7 @@ 0EE2FA5C2291954400F56F49 /* EncryptionPerformanceTests.swift in Sources */, 0EE2FA612291954400F56F49 /* RandomTests.swift in Sources */, 0EE2FA5D2291954400F56F49 /* EncryptionTests.swift in Sources */, - 0EE2FA652291954400F56F49 /* TestUtils.swift in Sources */, + 0EE2FA652291954400F56F49 /* TestUtils+OpenVPN.swift in Sources */, 0EE2FA582291954400F56F49 /* DataManipulationTests.swift in Sources */, 0EE2FA5E2291954400F56F49 /* LinkTests.swift in Sources */, 0EE2FA562291954400F56F49 /* ConfigurationParserTests.swift in Sources */, diff --git a/TunnelKitTests/DNSTests.swift b/TunnelKitTests/Core/DNSTests.swift similarity index 100% rename from TunnelKitTests/DNSTests.swift rename to TunnelKitTests/Core/DNSTests.swift diff --git a/TunnelKitTests/DataManipulationTests.swift b/TunnelKitTests/Core/DataManipulationTests.swift similarity index 100% rename from TunnelKitTests/DataManipulationTests.swift rename to TunnelKitTests/Core/DataManipulationTests.swift diff --git a/TunnelKitTests/RandomTests.swift b/TunnelKitTests/Core/RandomTests.swift similarity index 100% rename from TunnelKitTests/RandomTests.swift rename to TunnelKitTests/Core/RandomTests.swift diff --git a/TunnelKitTests/RawPerformanceTests.swift b/TunnelKitTests/Core/RawPerformanceTests.swift similarity index 100% rename from TunnelKitTests/RawPerformanceTests.swift rename to TunnelKitTests/Core/RawPerformanceTests.swift diff --git a/TunnelKitTests/RoutingTests.swift b/TunnelKitTests/Core/RoutingTests.swift similarity index 100% rename from TunnelKitTests/RoutingTests.swift rename to TunnelKitTests/Core/RoutingTests.swift diff --git a/TunnelKitTests/Core/TestUtils+Core.swift b/TunnelKitTests/Core/TestUtils+Core.swift new file mode 100644 index 0000000..9e7fcc8 --- /dev/null +++ b/TunnelKitTests/Core/TestUtils+Core.swift @@ -0,0 +1,55 @@ +// +// TestUtils+Core.swift +// TunnelKitTests +// +// Created by Davide De Rosa on 7/7/18. +// Copyright (c) 2019 Davide De Rosa. All rights reserved. +// +// https://github.com/passepartoutvpn +// +// This file is part of TunnelKit. +// +// TunnelKit is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// TunnelKit is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with TunnelKit. If not, see . +// +// This file incorporates work covered by the following copyright and +// permission notice: +// +// Copyright (c) 2018-Present Private Internet Access +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +import Foundation +@testable import TunnelKit + +class TestUtils { + static func uniqArray(_ v: [Int]) -> [Int] { + return v.reduce([]){ $0.contains($1) ? $0 : $0 + [$1] } + } + + static func generateDataSuite(_ size: Int, _ count: Int) -> [Data] { + var suite = [Data]() + for _ in 0.. [Int] { - return v.reduce([]){ $0.contains($1) ? $0 : $0 + [$1] } - } - - static func generateDataSuite(_ size: Int, _ count: Int) -> [Data] { - var suite = [Data]() - for _ in 0..?) throws -> Data { let srcLength = data.count From 72ce14b6762a5d4885e4d7e63b4bf70363b16a05 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 23 May 2019 21:49:20 +0200 Subject: [PATCH 08/12] Make AppExtension entities public --- .../Sources/AppExtension/GenericSocket.swift | 4 +-- .../AppExtension/InterfaceObserver.swift | 8 +++--- TunnelKit/Sources/AppExtension/Keychain.swift | 2 -- .../Sources/AppExtension/LinkProducer.swift | 2 +- .../AppExtension/MemoryDestination.swift | 26 +++++++++--------- .../AppExtension/Transport/NETCPSocket.swift | 27 ++++++++++--------- .../Transport/NETunnelInterface.swift | 12 ++++----- .../AppExtension/Transport/NEUDPSocket.swift | 27 ++++++++++--------- TunnelKit/Sources/Core/DNSResolver.swift | 1 - .../OpenVPN/AppExtension/NETCPLink.swift | 3 ++- .../OpenVPN/AppExtension/NEUDPLink.swift | 3 ++- .../AppExtension/OpenVPNTunnelProvider.swift | 12 ++++++--- 12 files changed, 67 insertions(+), 60 deletions(-) diff --git a/TunnelKit/Sources/AppExtension/GenericSocket.swift b/TunnelKit/Sources/AppExtension/GenericSocket.swift index c723a6d..cf40b1f 100644 --- a/TunnelKit/Sources/AppExtension/GenericSocket.swift +++ b/TunnelKit/Sources/AppExtension/GenericSocket.swift @@ -36,7 +36,7 @@ import Foundation -protocol GenericSocketDelegate: class { +public protocol GenericSocketDelegate: class { func socketDidTimeout(_ socket: GenericSocket) func socketDidBecomeActive(_ socket: GenericSocket) @@ -46,7 +46,7 @@ protocol GenericSocketDelegate: class { func socketHasBetterPath(_ socket: GenericSocket) } -protocol GenericSocket { +public protocol GenericSocket { var remoteAddress: String? { get } var hasBetterPath: Bool { get } diff --git a/TunnelKit/Sources/AppExtension/InterfaceObserver.swift b/TunnelKit/Sources/AppExtension/InterfaceObserver.swift index 68102fd..1013c8e 100644 --- a/TunnelKit/Sources/AppExtension/InterfaceObserver.swift +++ b/TunnelKit/Sources/AppExtension/InterfaceObserver.swift @@ -44,14 +44,14 @@ extension NSNotification.Name { static let __InterfaceObserverDidDetectWifiChange = NSNotification.Name("__InterfaceObserverDidDetectWifiChange") } -class InterfaceObserver: NSObject { +public class InterfaceObserver: NSObject { private var queue: DispatchQueue? private var timer: DispatchSourceTimer? private var lastWifiName: String? - func start(queue: DispatchQueue) { + public func start(queue: DispatchQueue) { self.queue = queue let timer = DispatchSource.makeTimerSource(flags: DispatchSource.TimerFlags(rawValue: UInt(0)), queue: queue) @@ -64,7 +64,7 @@ class InterfaceObserver: NSObject { self.timer = timer } - func stop() { + public func stop() { timer?.cancel() timer = nil queue = nil @@ -87,7 +87,7 @@ class InterfaceObserver: NSObject { lastWifiName = currentWifiName } - func currentWifiNetworkName() -> String? { + public func currentWifiNetworkName() -> String? { #if os(iOS) guard let interfaceNames = CNCopySupportedInterfaces() as? [CFString] else { return nil diff --git a/TunnelKit/Sources/AppExtension/Keychain.swift b/TunnelKit/Sources/AppExtension/Keychain.swift index beadc3b..cd3a53c 100644 --- a/TunnelKit/Sources/AppExtension/Keychain.swift +++ b/TunnelKit/Sources/AppExtension/Keychain.swift @@ -36,7 +36,6 @@ import Foundation -/// :nodoc: public enum KeychainError: Error { case add @@ -45,7 +44,6 @@ public enum KeychainError: Error { case typeMismatch } -/// :nodoc: public class Keychain { private let service: String? diff --git a/TunnelKit/Sources/AppExtension/LinkProducer.swift b/TunnelKit/Sources/AppExtension/LinkProducer.swift index d9858e2..967cac6 100644 --- a/TunnelKit/Sources/AppExtension/LinkProducer.swift +++ b/TunnelKit/Sources/AppExtension/LinkProducer.swift @@ -25,6 +25,6 @@ import Foundation -protocol LinkProducer { +public protocol LinkProducer { func link(withMTU mtu: Int) -> LinkInterface } diff --git a/TunnelKit/Sources/AppExtension/MemoryDestination.swift b/TunnelKit/Sources/AppExtension/MemoryDestination.swift index 8e594c3..913603d 100644 --- a/TunnelKit/Sources/AppExtension/MemoryDestination.swift +++ b/TunnelKit/Sources/AppExtension/MemoryDestination.swift @@ -37,39 +37,33 @@ import Foundation import SwiftyBeaver -class MemoryDestination: BaseDestination, CustomStringConvertible { +public class MemoryDestination: BaseDestination, CustomStringConvertible { private var buffer: [String] = [] - var maxLines: Int? + public var maxLines: Int? - override init() { + public override init() { super.init() asynchronously = false } - func start(with existing: [String]) { + public func start(with existing: [String]) { execute(synchronously: true) { self.buffer = existing } } - func flush(to url: URL) { + public func flush(to url: URL) { execute(synchronously: true) { let content = self.buffer.joined(separator: "\n") try? content.write(to: url, atomically: true, encoding: .utf8) } } - var description: String { - return executeSynchronously { - return self.buffer.joined(separator: "\n") - } - } - // MARK: BaseDestination // XXX: executed in SwiftyBeaver queue. DO NOT invoke execute* here (sync in sync would crash otherwise) - override func send(_ level: SwiftyBeaver.Level, msg: String, thread: String, file: String, function: String, line: Int, context: Any?) -> String? { + public override func send(_ level: SwiftyBeaver.Level, msg: String, thread: String, file: String, function: String, line: Int, context: Any?) -> String? { guard let message = super.send(level, msg: msg, thread: thread, file: file, function: function, line: line) else { return nil } @@ -81,4 +75,12 @@ class MemoryDestination: BaseDestination, CustomStringConvertible { } return message } + + // MARK: CustomStringConvertible + + public var description: String { + return executeSynchronously { + return self.buffer.joined(separator: "\n") + } + } } diff --git a/TunnelKit/Sources/AppExtension/Transport/NETCPSocket.swift b/TunnelKit/Sources/AppExtension/Transport/NETCPSocket.swift index 25e4ce2..d023d0f 100644 --- a/TunnelKit/Sources/AppExtension/Transport/NETCPSocket.swift +++ b/TunnelKit/Sources/AppExtension/Transport/NETCPSocket.swift @@ -40,12 +40,12 @@ import SwiftyBeaver private let log = SwiftyBeaver.self -class NETCPSocket: NSObject, GenericSocket { +public class NETCPSocket: NSObject, GenericSocket { private static var linkContext = 0 - let impl: NWTCPConnection + public let impl: NWTCPConnection - init(impl: NWTCPConnection) { + public init(impl: NWTCPConnection) { self.impl = impl isActive = false isShutdown = false @@ -57,19 +57,19 @@ class NETCPSocket: NSObject, GenericSocket { private var isActive: Bool - private(set) var isShutdown: Bool + public private(set) var isShutdown: Bool - var remoteAddress: String? { + public var remoteAddress: String? { return (impl.remoteAddress as? NWHostEndpoint)?.hostname } - var hasBetterPath: Bool { + public var hasBetterPath: Bool { return impl.hasBetterPath } - weak var delegate: GenericSocketDelegate? + public weak var delegate: GenericSocketDelegate? - func observe(queue: DispatchQueue, activeTimeout: Int) { + public func observe(queue: DispatchQueue, activeTimeout: Int) { isActive = false self.queue = queue @@ -86,17 +86,17 @@ class NETCPSocket: NSObject, GenericSocket { impl.addObserver(self, forKeyPath: #keyPath(NWTCPConnection.hasBetterPath), options: .new, context: &NETCPSocket.linkContext) } - func unobserve() { + public func unobserve() { impl.removeObserver(self, forKeyPath: #keyPath(NWTCPConnection.state), context: &NETCPSocket.linkContext) impl.removeObserver(self, forKeyPath: #keyPath(NWTCPConnection.hasBetterPath), context: &NETCPSocket.linkContext) } - func shutdown() { + public func shutdown() { impl.writeClose() impl.cancel() } - func upgraded() -> GenericSocket? { + public func upgraded() -> GenericSocket? { guard impl.hasBetterPath else { return nil } @@ -105,7 +105,7 @@ class NETCPSocket: NSObject, GenericSocket { // MARK: Connection KVO (any queue) - override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { + public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { guard (context == &NETCPSocket.linkContext) else { super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context) return @@ -170,8 +170,9 @@ class NETCPSocket: NSObject, GenericSocket { } } +/// :nodoc: extension NETCPSocket { - override var description: String { + public override var description: String { guard let hostEndpoint = impl.endpoint as? NWHostEndpoint else { return impl.endpoint.maskedDescription } diff --git a/TunnelKit/Sources/AppExtension/Transport/NETunnelInterface.swift b/TunnelKit/Sources/AppExtension/Transport/NETunnelInterface.swift index 4971ee5..f6d353c 100644 --- a/TunnelKit/Sources/AppExtension/Transport/NETunnelInterface.swift +++ b/TunnelKit/Sources/AppExtension/Transport/NETunnelInterface.swift @@ -37,25 +37,25 @@ import Foundation import NetworkExtension -class NETunnelInterface: TunnelInterface { +public class NETunnelInterface: TunnelInterface { private weak var impl: NEPacketTunnelFlow? private let protocolNumber: NSNumber - init(impl: NEPacketTunnelFlow, isIPv6: Bool) { + public init(impl: NEPacketTunnelFlow, isIPv6: Bool) { self.impl = impl protocolNumber = (isIPv6 ? AF_INET6 : AF_INET) as NSNumber } // MARK: TunnelInterface - var isPersistent: Bool { + public var isPersistent: Bool { return false } // MARK: IOInterface - func setReadHandler(queue: DispatchQueue, _ handler: @escaping ([Data]?, Error?) -> Void) { + public func setReadHandler(queue: DispatchQueue, _ handler: @escaping ([Data]?, Error?) -> Void) { loopReadPackets(queue, handler) } @@ -70,12 +70,12 @@ class NETunnelInterface: TunnelInterface { } } - func writePacket(_ packet: Data, completionHandler: ((Error?) -> Void)?) { + public func writePacket(_ packet: Data, completionHandler: ((Error?) -> Void)?) { impl?.writePackets([packet], withProtocols: [protocolNumber]) completionHandler?(nil) } - func writePackets(_ packets: [Data], completionHandler: ((Error?) -> Void)?) { + public func writePackets(_ packets: [Data], completionHandler: ((Error?) -> Void)?) { let protocols = [NSNumber](repeating: protocolNumber, count: packets.count) impl?.writePackets(packets, withProtocols: protocols) completionHandler?(nil) diff --git a/TunnelKit/Sources/AppExtension/Transport/NEUDPSocket.swift b/TunnelKit/Sources/AppExtension/Transport/NEUDPSocket.swift index 9c7d2b1..6172af4 100644 --- a/TunnelKit/Sources/AppExtension/Transport/NEUDPSocket.swift +++ b/TunnelKit/Sources/AppExtension/Transport/NEUDPSocket.swift @@ -40,12 +40,12 @@ import SwiftyBeaver private let log = SwiftyBeaver.self -class NEUDPSocket: NSObject, GenericSocket { +public class NEUDPSocket: NSObject, GenericSocket { private static var linkContext = 0 - let impl: NWUDPSession + public let impl: NWUDPSession - init(impl: NWUDPSession) { + public init(impl: NWUDPSession) { self.impl = impl isActive = false @@ -58,19 +58,19 @@ class NEUDPSocket: NSObject, GenericSocket { private var isActive: Bool - private(set) var isShutdown: Bool + public private(set) var isShutdown: Bool - var remoteAddress: String? { + public var remoteAddress: String? { return (impl.resolvedEndpoint as? NWHostEndpoint)?.hostname } - var hasBetterPath: Bool { + public var hasBetterPath: Bool { return impl.hasBetterPath } - weak var delegate: GenericSocketDelegate? + public weak var delegate: GenericSocketDelegate? - func observe(queue: DispatchQueue, activeTimeout: Int) { + public func observe(queue: DispatchQueue, activeTimeout: Int) { isActive = false self.queue = queue @@ -87,16 +87,16 @@ class NEUDPSocket: NSObject, GenericSocket { impl.addObserver(self, forKeyPath: #keyPath(NWUDPSession.hasBetterPath), options: .new, context: &NEUDPSocket.linkContext) } - func unobserve() { + public func unobserve() { impl.removeObserver(self, forKeyPath: #keyPath(NWUDPSession.state), context: &NEUDPSocket.linkContext) impl.removeObserver(self, forKeyPath: #keyPath(NWUDPSession.hasBetterPath), context: &NEUDPSocket.linkContext) } - func shutdown() { + public func shutdown() { impl.cancel() } - func upgraded() -> GenericSocket? { + public func upgraded() -> GenericSocket? { guard impl.hasBetterPath else { return nil } @@ -105,7 +105,7 @@ class NEUDPSocket: NSObject, GenericSocket { // MARK: Connection KVO (any queue) - override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { + public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { guard (context == &NEUDPSocket.linkContext) else { super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context) return @@ -173,8 +173,9 @@ class NEUDPSocket: NSObject, GenericSocket { } } +/// :nodoc: extension NEUDPSocket { - override var description: String { + public override var description: String { guard let hostEndpoint = impl.endpoint as? NWHostEndpoint else { return impl.endpoint.maskedDescription } diff --git a/TunnelKit/Sources/Core/DNSResolver.swift b/TunnelKit/Sources/Core/DNSResolver.swift index 67e69b7..ca32701 100644 --- a/TunnelKit/Sources/Core/DNSResolver.swift +++ b/TunnelKit/Sources/Core/DNSResolver.swift @@ -36,7 +36,6 @@ import Foundation -/// :nodoc: public class DNSResolver { private static let queue = DispatchQueue(label: "DNSResolver") diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/NETCPLink.swift b/TunnelKit/Sources/OpenVPN/AppExtension/NETCPLink.swift index 532328c..7c6af63 100644 --- a/TunnelKit/Sources/OpenVPN/AppExtension/NETCPLink.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/NETCPLink.swift @@ -96,8 +96,9 @@ class NETCPLink: LinkInterface { } } +/// :nodoc: extension NETCPSocket: LinkProducer { - func link(withMTU mtu: Int) -> LinkInterface { + public func link(withMTU mtu: Int) -> LinkInterface { return NETCPLink(impl: impl, mtu: mtu) } } diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/NEUDPLink.swift b/TunnelKit/Sources/OpenVPN/AppExtension/NEUDPLink.swift index 9692d82..fedc25d 100644 --- a/TunnelKit/Sources/OpenVPN/AppExtension/NEUDPLink.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/NEUDPLink.swift @@ -77,8 +77,9 @@ class NEUDPLink: LinkInterface { } } +/// :nodoc: extension NEUDPSocket: LinkProducer { - func link(withMTU mtu: Int) -> LinkInterface { + public func link(withMTU mtu: Int) -> LinkInterface { return NEUDPLink(impl: impl, mtu: mtu) } } diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift index a1c20fe..ca5e7ae 100644 --- a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift +++ b/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift @@ -386,7 +386,8 @@ extension OpenVPNTunnelProvider: GenericSocketDelegate { // MARK: GenericSocketDelegate (tunnel queue) - func socketDidTimeout(_ socket: GenericSocket) { + /// :nodoc: + public func socketDidTimeout(_ socket: GenericSocket) { log.debug("Socket timed out waiting for activity, cancelling...") reasserting = true socket.shutdown() @@ -400,7 +401,8 @@ extension OpenVPNTunnelProvider: GenericSocketDelegate { } } - func socketDidBecomeActive(_ socket: GenericSocket) { + /// :nodoc: + public func socketDidBecomeActive(_ socket: GenericSocket) { guard let session = session, let producer = socket as? LinkProducer else { return } @@ -412,7 +414,8 @@ extension OpenVPNTunnelProvider: GenericSocketDelegate { } } - func socket(_ socket: GenericSocket, didShutdownWithFailure failure: Bool) { + /// :nodoc: + public func socket(_ socket: GenericSocket, didShutdownWithFailure failure: Bool) { guard let session = session else { return } @@ -463,7 +466,8 @@ extension OpenVPNTunnelProvider: GenericSocketDelegate { disposeTunnel(error: shutdownError) } - func socketHasBetterPath(_ socket: GenericSocket) { + /// :nodoc: + public func socketHasBetterPath(_ socket: GenericSocket) { log.debug("Stopping tunnel due to a new better path") logCurrentSSID() session?.reconnect(error: ProviderError.networkChanged) From 21eee24e7c6e6408abb61996236659ce6b0706a4 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 24 May 2019 14:58:25 +0200 Subject: [PATCH 09/12] Add missing documentation --- .../Sources/AppExtension/GenericSocket.swift | 41 +++++++++- .../AppExtension/InterfaceObserver.swift | 24 +++++- TunnelKit/Sources/AppExtension/Keychain.swift | 79 ++++++++++++++++++- .../Sources/AppExtension/LinkProducer.swift | 7 ++ .../AppExtension/MemoryDestination.swift | 23 +++++- .../AppExtension/Transport/NETCPSocket.swift | 12 +++ .../Transport/NETunnelInterface.swift | 8 +- .../AppExtension/Transport/NEUDPSocket.swift | 12 +++ TunnelKit/Sources/Core/DNSResolver.swift | 21 +++++ 9 files changed, 216 insertions(+), 11 deletions(-) diff --git a/TunnelKit/Sources/AppExtension/GenericSocket.swift b/TunnelKit/Sources/AppExtension/GenericSocket.swift index cf40b1f..a30156c 100644 --- a/TunnelKit/Sources/AppExtension/GenericSocket.swift +++ b/TunnelKit/Sources/AppExtension/GenericSocket.swift @@ -36,30 +36,69 @@ import Foundation +/// Receives events from a `GenericSocket`. public protocol GenericSocketDelegate: class { + + /** + The socket timed out. + **/ func socketDidTimeout(_ socket: GenericSocket) + /** + The socket became active. + **/ func socketDidBecomeActive(_ socket: GenericSocket) + /** + The socket shut down. + + - Parameter failure: `true` if the shutdown was caused by a failure. + **/ func socket(_ socket: GenericSocket, didShutdownWithFailure failure: Bool) + /** + The socket has a better path. + **/ func socketHasBetterPath(_ socket: GenericSocket) } +/// An opaque socket implementation. public protocol GenericSocket { + + /// The address of the remote endpoint. var remoteAddress: String? { get } + /// `true` if the socket has a better path. var hasBetterPath: Bool { get } + /// `true` if the socket was shut down. var isShutdown: Bool { get } + /// The optional delegate for events. var delegate: GenericSocketDelegate? { get set } + /** + Observes socket events. + + - Parameter queue: The queue to observe events in. + - Parameter activeTimeout: The timeout in milliseconds for socket activity. + **/ func observe(queue: DispatchQueue, activeTimeout: Int) + /** + Stops observing socket events. + **/ func unobserve() - + + /** + Shuts down the socket + **/ func shutdown() + /** + Returns an upgraded socket if available (e.g. when a better path exists). + + - Returns: An upgraded socket if any. + **/ func upgraded() -> GenericSocket? } diff --git a/TunnelKit/Sources/AppExtension/InterfaceObserver.swift b/TunnelKit/Sources/AppExtension/InterfaceObserver.swift index 1013c8e..3dc0629 100644 --- a/TunnelKit/Sources/AppExtension/InterfaceObserver.swift +++ b/TunnelKit/Sources/AppExtension/InterfaceObserver.swift @@ -41,16 +41,24 @@ import SwiftyBeaver private let log = SwiftyBeaver.self extension NSNotification.Name { - static let __InterfaceObserverDidDetectWifiChange = NSNotification.Name("__InterfaceObserverDidDetectWifiChange") + + /// A change in Wi-Fi state occurred. + public static let InterfaceObserverDidDetectWifiChange = NSNotification.Name("InterfaceObserverDidDetectWifiChange") } +/// Observes changes in the current Wi-Fi network. public class InterfaceObserver: NSObject { private var queue: DispatchQueue? private var timer: DispatchSourceTimer? private var lastWifiName: String? - + + /** + Starts observing Wi-Fi updates. + + - Parameter queue: The `DispatchQueue` to deliver notifications to. + **/ public func start(queue: DispatchQueue) { self.queue = queue @@ -63,7 +71,10 @@ public class InterfaceObserver: NSObject { self.timer = timer } - + + /** + Stops observing Wi-Fi updates. + **/ public func stop() { timer?.cancel() timer = nil @@ -77,7 +88,7 @@ public class InterfaceObserver: NSObject { log.debug("SSID is now '\(current.maskedDescription)'") if let last = lastWifiName, (current != last) { queue?.async { - NotificationCenter.default.post(name: .__InterfaceObserverDidDetectWifiChange, object: nil) + NotificationCenter.default.post(name: .InterfaceObserverDidDetectWifiChange, object: nil) } } } else { @@ -87,6 +98,11 @@ public class InterfaceObserver: NSObject { lastWifiName = currentWifiName } + /** + Returns the current Wi-Fi SSID if any. + + - Returns: The current Wi-Fi SSID if any. + **/ public func currentWifiNetworkName() -> String? { #if os(iOS) guard let interfaceNames = CNCopySupportedInterfaces() as? [CFString] else { diff --git a/TunnelKit/Sources/AppExtension/Keychain.swift b/TunnelKit/Sources/AppExtension/Keychain.swift index cd3a53c..03f97c7 100644 --- a/TunnelKit/Sources/AppExtension/Keychain.swift +++ b/TunnelKit/Sources/AppExtension/Keychain.swift @@ -36,29 +36,49 @@ import Foundation +/// Error raised by `Keychain` methods. public enum KeychainError: Error { + + /// Unable to add. case add + /// Item not found. case notFound - case typeMismatch +// /// Unexpected item type returned. +// case typeMismatch } +/// Wrapper for easy keychain access and modification. public class Keychain { private let service: String? private let accessGroup: String? + /// :nodoc: public init() { service = Bundle.main.bundleIdentifier accessGroup = nil } + /** + Creates a keychain in an App Group. + + - Parameter group: The App Group. + - Precondition: Proper App Group entitlements. + **/ public init(group: String) { service = nil accessGroup = group } + /** + Creates a keychain in an App Group and a Team ID prefix. + + - Parameter team: The Team ID prefix. + - Parameter group: The App Group. + - Precondition: Proper App Group entitlements. + **/ public init(team: String, group: String) { service = nil accessGroup = "\(team).\(group)" @@ -66,6 +86,14 @@ public class Keychain { // MARK: Password + /** + Sets a password. + + - Parameter password: The password to set. + - Parameter username: The username to set the password for. + - Parameter label: An optional label. + - Throws: `KeychainError.add` if unable to add the password to the keychain. + **/ public func set(password: String, for username: String, label: String? = nil) throws { do { let currentPassword = try self.password(for: username) @@ -94,6 +122,12 @@ public class Keychain { } } + /** + Removes a password. + + - Parameter username: The username to remove the password for. + - Returns: `true` if the password was successfully removed. + **/ @discardableResult public func removePassword(for username: String) -> Bool { var query = [String: Any]() setScope(query: &query) @@ -104,6 +138,13 @@ public class Keychain { return (status == errSecSuccess) } + /** + Gets a password. + + - Parameter username: The username to get the password for. + - Returns: The password for the input username. + - Throws: `KeychainError.notFound` if unable to find the password in the keychain. + **/ public func password(for username: String) throws -> String { var query = [String: Any]() setScope(query: &query) @@ -126,6 +167,13 @@ public class Keychain { return password } + /** + Gets a password reference. + + - Parameter username: The username to get the password for. + - Returns: The password reference for the input username. + - Throws: `KeychainError.notFound` if unable to find the password in the keychain. + **/ public func passwordReference(for username: String) throws -> Data { var query = [String: Any]() setScope(query: &query) @@ -145,6 +193,14 @@ public class Keychain { return data } + /** + Gets a password associated with a password reference. + + - Parameter username: The username to get the password for. + - Parameter reference: The password reference. + - Returns: The password for the input username and reference. + - Throws: `KeychainError.notFound` if unable to find the password in the keychain. + **/ public static func password(for username: String, reference: Data) throws -> String { var query = [String: Any]() query[kSecClass as String] = kSecClassGenericPassword @@ -170,6 +226,14 @@ public class Keychain { // https://forums.developer.apple.com/thread/13748 + /** + Adds a public key. + + - Parameter identifier: The unique identifier. + - Parameter data: The public key data. + - Returns: The `SecKey` object representing the public key. + - Throws: `KeychainError.add` if unable to add the public key to the keychain. + **/ public func add(publicKeyWithIdentifier identifier: String, data: Data) throws -> SecKey { var query = [String: Any]() query[kSecClass as String] = kSecClassKey @@ -188,6 +252,13 @@ public class Keychain { return try publicKey(withIdentifier: identifier) } + /** + Gets a public key. + + - Parameter identifier: The unique identifier. + - Returns: The `SecKey` object representing the public key. + - Throws: `KeychainError.notFound` if unable to find the public key in the keychain. + **/ public func publicKey(withIdentifier identifier: String) throws -> SecKey { var query = [String: Any]() query[kSecClass as String] = kSecClassKey @@ -211,6 +282,12 @@ public class Keychain { return result as! SecKey } + /** + Removes a public key. + + - Parameter identifier: The unique identifier. + - Returns: `true` if the public key was successfully removed. + **/ @discardableResult public func remove(publicKeyWithIdentifier identifier: String) -> Bool { var query = [String: Any]() query[kSecClass as String] = kSecClassKey diff --git a/TunnelKit/Sources/AppExtension/LinkProducer.swift b/TunnelKit/Sources/AppExtension/LinkProducer.swift index 967cac6..3ef4904 100644 --- a/TunnelKit/Sources/AppExtension/LinkProducer.swift +++ b/TunnelKit/Sources/AppExtension/LinkProducer.swift @@ -25,6 +25,13 @@ import Foundation +/// Entity able to produce a `LinkInterface`. public protocol LinkProducer { + + /** + Returns a `LinkInterface`. + + - Parameter mtu: The MTU value. + **/ func link(withMTU mtu: Int) -> LinkInterface } diff --git a/TunnelKit/Sources/AppExtension/MemoryDestination.swift b/TunnelKit/Sources/AppExtension/MemoryDestination.swift index 913603d..f38b77b 100644 --- a/TunnelKit/Sources/AppExtension/MemoryDestination.swift +++ b/TunnelKit/Sources/AppExtension/MemoryDestination.swift @@ -37,22 +37,35 @@ import Foundation import SwiftyBeaver +/// Implements a `SwiftyBeaver.BaseDestination` logging to a memory buffer. public class MemoryDestination: BaseDestination, CustomStringConvertible { private var buffer: [String] = [] - + + /// Max number of retained lines. public var maxLines: Int? - + + /// :nodoc: public override init() { super.init() asynchronously = false } - public func start(with existing: [String]) { + /** + Starts logging. Optionally prepend an array of lines. + + - Parameter existing: The optional lines to prepend (none by default). + **/ + public func start(with existing: [String] = []) { execute(synchronously: true) { self.buffer = existing } } - + + /** + Flushes the log content to an URL. + + - Parameter url: The URL to write the log content to. + **/ public func flush(to url: URL) { execute(synchronously: true) { let content = self.buffer.joined(separator: "\n") @@ -63,6 +76,7 @@ public class MemoryDestination: BaseDestination, CustomStringConvertible { // MARK: BaseDestination // XXX: executed in SwiftyBeaver queue. DO NOT invoke execute* here (sync in sync would crash otherwise) + /// :nodoc: public override func send(_ level: SwiftyBeaver.Level, msg: String, thread: String, file: String, function: String, line: Int, context: Any?) -> String? { guard let message = super.send(level, msg: msg, thread: thread, file: file, function: function, line: line) else { return nil @@ -78,6 +92,7 @@ public class MemoryDestination: BaseDestination, CustomStringConvertible { // MARK: CustomStringConvertible + /// :nodoc: public var description: String { return executeSynchronously { return self.buffer.joined(separator: "\n") diff --git a/TunnelKit/Sources/AppExtension/Transport/NETCPSocket.swift b/TunnelKit/Sources/AppExtension/Transport/NETCPSocket.swift index d023d0f..997ec8b 100644 --- a/TunnelKit/Sources/AppExtension/Transport/NETCPSocket.swift +++ b/TunnelKit/Sources/AppExtension/Transport/NETCPSocket.swift @@ -40,11 +40,14 @@ import SwiftyBeaver private let log = SwiftyBeaver.self +/// TCP implementation of a `GenericSocket` via NetworkExtension. public class NETCPSocket: NSObject, GenericSocket { private static var linkContext = 0 + /// :nodoc: public let impl: NWTCPConnection + /// :nodoc: public init(impl: NWTCPConnection) { self.impl = impl isActive = false @@ -57,18 +60,23 @@ public class NETCPSocket: NSObject, GenericSocket { private var isActive: Bool + /// :nodoc: public private(set) var isShutdown: Bool + /// :nodoc: public var remoteAddress: String? { return (impl.remoteAddress as? NWHostEndpoint)?.hostname } + /// :nodoc: public var hasBetterPath: Bool { return impl.hasBetterPath } + /// :nodoc: public weak var delegate: GenericSocketDelegate? + /// :nodoc: public func observe(queue: DispatchQueue, activeTimeout: Int) { isActive = false @@ -86,16 +94,19 @@ public class NETCPSocket: NSObject, GenericSocket { impl.addObserver(self, forKeyPath: #keyPath(NWTCPConnection.hasBetterPath), options: .new, context: &NETCPSocket.linkContext) } + /// :nodoc: public func unobserve() { impl.removeObserver(self, forKeyPath: #keyPath(NWTCPConnection.state), context: &NETCPSocket.linkContext) impl.removeObserver(self, forKeyPath: #keyPath(NWTCPConnection.hasBetterPath), context: &NETCPSocket.linkContext) } + /// :nodoc: public func shutdown() { impl.writeClose() impl.cancel() } + /// :nodoc: public func upgraded() -> GenericSocket? { guard impl.hasBetterPath else { return nil @@ -105,6 +116,7 @@ public class NETCPSocket: NSObject, GenericSocket { // MARK: Connection KVO (any queue) + /// :nodoc: public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { guard (context == &NETCPSocket.linkContext) else { super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context) diff --git a/TunnelKit/Sources/AppExtension/Transport/NETunnelInterface.swift b/TunnelKit/Sources/AppExtension/Transport/NETunnelInterface.swift index f6d353c..387175d 100644 --- a/TunnelKit/Sources/AppExtension/Transport/NETunnelInterface.swift +++ b/TunnelKit/Sources/AppExtension/Transport/NETunnelInterface.swift @@ -37,11 +37,13 @@ import Foundation import NetworkExtension +/// `TunnelInterface` implementation via NetworkExtension. public class NETunnelInterface: TunnelInterface { private weak var impl: NEPacketTunnelFlow? private let protocolNumber: NSNumber - + + /// :nodoc: public init(impl: NEPacketTunnelFlow, isIPv6: Bool) { self.impl = impl protocolNumber = (isIPv6 ? AF_INET6 : AF_INET) as NSNumber @@ -49,12 +51,14 @@ public class NETunnelInterface: TunnelInterface { // MARK: TunnelInterface + /// :nodoc: public var isPersistent: Bool { return false } // MARK: IOInterface + /// :nodoc: public func setReadHandler(queue: DispatchQueue, _ handler: @escaping ([Data]?, Error?) -> Void) { loopReadPackets(queue, handler) } @@ -70,11 +74,13 @@ public class NETunnelInterface: TunnelInterface { } } + /// :nodoc: public func writePacket(_ packet: Data, completionHandler: ((Error?) -> Void)?) { impl?.writePackets([packet], withProtocols: [protocolNumber]) completionHandler?(nil) } + /// :nodoc: public func writePackets(_ packets: [Data], completionHandler: ((Error?) -> Void)?) { let protocols = [NSNumber](repeating: protocolNumber, count: packets.count) impl?.writePackets(packets, withProtocols: protocols) diff --git a/TunnelKit/Sources/AppExtension/Transport/NEUDPSocket.swift b/TunnelKit/Sources/AppExtension/Transport/NEUDPSocket.swift index 6172af4..f22a485 100644 --- a/TunnelKit/Sources/AppExtension/Transport/NEUDPSocket.swift +++ b/TunnelKit/Sources/AppExtension/Transport/NEUDPSocket.swift @@ -40,11 +40,14 @@ import SwiftyBeaver private let log = SwiftyBeaver.self +/// UDP implementation of a `GenericSocket` via NetworkExtension. public class NEUDPSocket: NSObject, GenericSocket { private static var linkContext = 0 + /// :nodoc: public let impl: NWUDPSession + /// :nodoc: public init(impl: NWUDPSession) { self.impl = impl @@ -58,18 +61,23 @@ public class NEUDPSocket: NSObject, GenericSocket { private var isActive: Bool + /// :nodoc: public private(set) var isShutdown: Bool + /// :nodoc: public var remoteAddress: String? { return (impl.resolvedEndpoint as? NWHostEndpoint)?.hostname } + /// :nodoc: public var hasBetterPath: Bool { return impl.hasBetterPath } + /// :nodoc: public weak var delegate: GenericSocketDelegate? + /// :nodoc: public func observe(queue: DispatchQueue, activeTimeout: Int) { isActive = false @@ -87,15 +95,18 @@ public class NEUDPSocket: NSObject, GenericSocket { impl.addObserver(self, forKeyPath: #keyPath(NWUDPSession.hasBetterPath), options: .new, context: &NEUDPSocket.linkContext) } + /// :nodoc: public func unobserve() { impl.removeObserver(self, forKeyPath: #keyPath(NWUDPSession.state), context: &NEUDPSocket.linkContext) impl.removeObserver(self, forKeyPath: #keyPath(NWUDPSession.hasBetterPath), context: &NEUDPSocket.linkContext) } + /// :nodoc: public func shutdown() { impl.cancel() } + /// :nodoc: public func upgraded() -> GenericSocket? { guard impl.hasBetterPath else { return nil @@ -105,6 +116,7 @@ public class NEUDPSocket: NSObject, GenericSocket { // MARK: Connection KVO (any queue) + /// :nodoc: public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { guard (context == &NEUDPSocket.linkContext) else { super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context) diff --git a/TunnelKit/Sources/Core/DNSResolver.swift b/TunnelKit/Sources/Core/DNSResolver.swift index ca32701..8985ce3 100644 --- a/TunnelKit/Sources/Core/DNSResolver.swift +++ b/TunnelKit/Sources/Core/DNSResolver.swift @@ -36,9 +36,18 @@ import Foundation +/// Convenient methods for DNS resolution. public class DNSResolver { private static let queue = DispatchQueue(label: "DNSResolver") + /** + Resolves a hostname asynchronously. + + - Parameter hostname: The hostname to resolve. + - Parameter timeout: The timeout in milliseconds. + - Parameter queue: The queue to execute the `completionHandler` in. + - Parameter completionHandler: The completion handler with the resolved addresses and an optional error. + */ public static func resolve(_ hostname: String, timeout: Int, queue: DispatchQueue, completionHandler: @escaping ([String]?, Error?) -> Void) { var pendingHandler: (([String]?, Error?) -> Void)? = completionHandler let host = CFHostCreateWithName(nil, hostname as CFString).takeRetainedValue() @@ -94,6 +103,12 @@ public class DNSResolver { completionHandler(ipAddresses, nil) } + /** + Returns a `String` representation from a numeric IPv4 address. + + - Parameter ipv4: The IPv4 address as a 32-bit number. + - Returns: The string representation of `ipv4`. + */ public static func string(fromIPv4 ipv4: UInt32) -> String { var addr = in_addr(s_addr: CFSwapInt32HostToBig(ipv4)) var buf = Data(count: Int(INET_ADDRSTRLEN)) @@ -110,6 +125,12 @@ public class DNSResolver { return String(cString: result) } + /** + Returns a numeric representation from an IPv4 address. + + - Parameter string: The IPv4 address as a string. + - Returns: The numeric representation of `string`. + */ public static func ipv4(fromString string: String) -> UInt32? { var addr = in_addr() let result = string.withCString { From be1081aad68bd36d6251e2b49b8d95c73bb66d1b Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 24 May 2019 15:35:11 +0200 Subject: [PATCH 10/12] Nest subspecs by purpose - Protocols - Extra --- TunnelKit.podspec | 40 +- TunnelKit.xcodeproj/project.pbxproj | 758 +++++++++--------- .../Sources/{ => Extra}/LZO/StandardLZO.m | 0 TunnelKit/Sources/{ => Extra}/LZO/lib/COPYING | 0 .../Sources/{ => Extra}/LZO/lib/Makefile | 0 .../Sources/{ => Extra}/LZO/lib/README.LZO | 0 .../Sources/{ => Extra}/LZO/lib/lzoconf.h | 0 .../Sources/{ => Extra}/LZO/lib/lzodefs.h | 0 .../Sources/{ => Extra}/LZO/lib/minilzo.c | 0 .../Sources/{ => Extra}/LZO/lib/minilzo.h | 0 .../Sources/{ => Extra}/LZO/lib/testmini.c | 0 .../AppExtension/ConnectionStrategy.swift | 0 .../OpenVPN/AppExtension/NETCPLink.swift | 0 .../OpenVPN/AppExtension/NEUDPLink.swift | 0 .../OpenVPNTunnelProvider+Configuration.swift | 0 .../OpenVPNTunnelProvider+Interaction.swift | 0 .../AppExtension/OpenVPNTunnelProvider.swift | 0 .../OpenVPN/Authenticator.swift | 0 .../OpenVPN/CompressionAlgorithm.swift | 0 .../OpenVPN/CompressionAlgorithmNative.h | 0 .../OpenVPN/CompressionFraming.swift | 0 .../OpenVPN/CompressionFramingNative.h | 0 .../OpenVPN/Configuration.swift | 0 .../OpenVPN/ConfigurationParser.swift | 0 .../OpenVPN/ControlChannel.swift | 0 .../OpenVPN/ControlChannelSerializer.swift | 0 .../{ => Protocols}/OpenVPN/ControlPacket.h | 0 .../{ => Protocols}/OpenVPN/ControlPacket.m | 0 .../OpenVPN/CoreConfiguration+OpenVPN.swift | 0 .../Sources/{ => Protocols}/OpenVPN/Crypto.h | 0 .../{ => Protocols}/OpenVPN/CryptoAEAD.h | 0 .../{ => Protocols}/OpenVPN/CryptoAEAD.m | 0 .../{ => Protocols}/OpenVPN/CryptoBox.h | 0 .../{ => Protocols}/OpenVPN/CryptoBox.m | 0 .../{ => Protocols}/OpenVPN/CryptoCBC.h | 0 .../{ => Protocols}/OpenVPN/CryptoCBC.m | 0 .../{ => Protocols}/OpenVPN/CryptoCTR.h | 0 .../{ => Protocols}/OpenVPN/CryptoCTR.m | 0 .../OpenVPN/CryptoContainer.swift | 0 .../{ => Protocols}/OpenVPN/CryptoMacros.h | 0 .../{ => Protocols}/OpenVPN/DataPath.h | 0 .../{ => Protocols}/OpenVPN/DataPath.m | 0 .../{ => Protocols}/OpenVPN/DataPathCrypto.h | 0 .../OpenVPN/EncryptionBridge.swift | 0 .../Sources/{ => Protocols}/OpenVPN/MSS.h | 0 .../Sources/{ => Protocols}/OpenVPN/MSS.m | 0 .../{ => Protocols}/OpenVPN/OpenVPN.swift | 0 .../OpenVPN/OpenVPNError.swift | 0 .../OpenVPN/OpenVPNSession+PIA.swift | 0 .../OpenVPN/OpenVPNSession.swift | 0 .../{ => Protocols}/OpenVPN/Packet.swift | 0 .../{ => Protocols}/OpenVPN/PacketMacros.h | 0 .../{ => Protocols}/OpenVPN/PacketMacros.m | 0 .../{ => Protocols}/OpenVPN/PacketStream.h | 0 .../{ => Protocols}/OpenVPN/PacketStream.m | 0 .../OpenVPN/ProtocolMacros.swift | 0 .../{ => Protocols}/OpenVPN/PushReply.swift | 0 .../{ => Protocols}/OpenVPN/ReplayProtector.h | 0 .../{ => Protocols}/OpenVPN/ReplayProtector.m | 0 .../{ => Protocols}/OpenVPN/SessionKey.swift | 0 .../{ => Protocols}/OpenVPN/StaticKey.swift | 0 .../Sources/{ => Protocols}/OpenVPN/TLSBox.h | 0 .../Sources/{ => Protocols}/OpenVPN/TLSBox.m | 0 .../{ => Protocols}/OpenVPN/TLSWrap.swift | 0 .../{ => Protocols}/OpenVPN/module.modulemap | 0 65 files changed, 411 insertions(+), 387 deletions(-) rename TunnelKit/Sources/{ => Extra}/LZO/StandardLZO.m (100%) rename TunnelKit/Sources/{ => Extra}/LZO/lib/COPYING (100%) rename TunnelKit/Sources/{ => Extra}/LZO/lib/Makefile (100%) rename TunnelKit/Sources/{ => Extra}/LZO/lib/README.LZO (100%) rename TunnelKit/Sources/{ => Extra}/LZO/lib/lzoconf.h (100%) rename TunnelKit/Sources/{ => Extra}/LZO/lib/lzodefs.h (100%) rename TunnelKit/Sources/{ => Extra}/LZO/lib/minilzo.c (100%) rename TunnelKit/Sources/{ => Extra}/LZO/lib/minilzo.h (100%) rename TunnelKit/Sources/{ => Extra}/LZO/lib/testmini.c (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/AppExtension/ConnectionStrategy.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/AppExtension/NETCPLink.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/AppExtension/NEUDPLink.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/AppExtension/OpenVPNTunnelProvider+Interaction.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/Authenticator.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CompressionAlgorithm.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CompressionAlgorithmNative.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CompressionFraming.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CompressionFramingNative.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/Configuration.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/ConfigurationParser.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/ControlChannel.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/ControlChannelSerializer.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/ControlPacket.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/ControlPacket.m (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CoreConfiguration+OpenVPN.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/Crypto.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CryptoAEAD.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CryptoAEAD.m (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CryptoBox.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CryptoBox.m (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CryptoCBC.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CryptoCBC.m (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CryptoCTR.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CryptoCTR.m (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CryptoContainer.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/CryptoMacros.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/DataPath.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/DataPath.m (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/DataPathCrypto.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/EncryptionBridge.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/MSS.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/MSS.m (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/OpenVPN.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/OpenVPNError.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/OpenVPNSession+PIA.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/OpenVPNSession.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/Packet.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/PacketMacros.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/PacketMacros.m (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/PacketStream.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/PacketStream.m (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/ProtocolMacros.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/PushReply.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/ReplayProtector.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/ReplayProtector.m (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/SessionKey.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/StaticKey.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/TLSBox.h (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/TLSBox.m (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/TLSWrap.swift (100%) rename TunnelKit/Sources/{ => Protocols}/OpenVPN/module.modulemap (100%) diff --git a/TunnelKit.podspec b/TunnelKit.podspec index 33319d5..ad6267f 100644 --- a/TunnelKit.podspec +++ b/TunnelKit.podspec @@ -12,7 +12,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = "11.0" s.osx.deployment_target = "10.11" - s.default_subspecs = "OpenVPN" + s.default_subspecs = "Protocols/OpenVPN" s.subspec "Core" do |p| p.source_files = "TunnelKit/Sources/Core/**/*.{h,m,swift}" @@ -34,25 +34,29 @@ Pod::Spec.new do |s| p.dependency "TunnelKit/Core" end - s.subspec "OpenVPN" do |p| - p.source_files = "TunnelKit/Sources/OpenVPN/**/*.{h,m,swift}" - p.private_header_files = "TunnelKit/Sources/OpenVPN/**/*.h" - p.preserve_paths = "TunnelKit/Sources/OpenVPN/*.modulemap" - p.pod_target_xcconfig = { "OTHER_LDFLAGS" => "-framework openssl", - "SWIFT_INCLUDE_PATHS" => "${PODS_TARGET_SRCROOT}/TunnelKit/Sources/OpenVPN", - "APPLICATION_EXTENSION_API_ONLY" => "YES" } + s.subspec "Protocols" do |t| + t.subspec "OpenVPN" do |p| + p.source_files = "TunnelKit/Sources/Protocols/OpenVPN/**/*.{h,m,swift}" + p.private_header_files = "TunnelKit/Sources/Protocols/OpenVPN/**/*.h" + p.preserve_paths = "TunnelKit/Sources/Protocols/OpenVPN/*.modulemap" + p.pod_target_xcconfig = { "OTHER_LDFLAGS" => "-framework openssl", + "SWIFT_INCLUDE_PATHS" => "${PODS_TARGET_SRCROOT}/TunnelKit/Sources/Protocols/OpenVPN", + "APPLICATION_EXTENSION_API_ONLY" => "YES" } - p.dependency "TunnelKit/Core" - p.dependency "TunnelKit/AppExtension" + p.dependency "TunnelKit/Core" + p.dependency "TunnelKit/AppExtension" + end end - s.subspec "LZO" do |p| - p.source_files = "TunnelKit/Sources/Core/LZO.h", - "TunnelKit/Sources/Core/Errors.{h,m}", - "TunnelKit/Sources/LZO/lib/*lzo*.{h,m,c}" - p.private_header_files = "TunnelKit/Sources/Core/LZO.h", - "TunnelKit/Sources/Core/Errors.h", - "TunnelKit/Sources/LZO/lib/*lzo*.h" - p.pod_target_xcconfig = { "APPLICATION_EXTENSION_API_ONLY" => "YES" } + s.subspec "Extra" do |t| + t.subspec "LZO" do |p| + p.source_files = "TunnelKit/Sources/Core/LZO.h", + "TunnelKit/Sources/Core/Errors.{h,m}", + "TunnelKit/Sources/Extra/LZO/lib/*lzo*.{h,m,c}" + p.private_header_files = "TunnelKit/Sources/Core/LZO.h", + "TunnelKit/Sources/Core/Errors.h", + "TunnelKit/Sources/Extra/LZO/lib/*lzo*.h" + p.pod_target_xcconfig = { "APPLICATION_EXTENSION_API_ONLY" => "YES" } + end end end diff --git a/TunnelKit.xcodeproj/project.pbxproj b/TunnelKit.xcodeproj/project.pbxproj index 9c13e62..b046787 100644 --- a/TunnelKit.xcodeproj/project.pbxproj +++ b/TunnelKit.xcodeproj/project.pbxproj @@ -13,30 +13,10 @@ 0E011F7E2196D97200BA59EE /* EndpointProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E011F7C2196D97200BA59EE /* EndpointProtocol.swift */; }; 0E011F852196E25900BA59EE /* pia-hungary.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = 0E011F832196E25400BA59EE /* pia-hungary.ovpn */; }; 0E011F862196E25A00BA59EE /* pia-hungary.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = 0E011F832196E25400BA59EE /* pia-hungary.ovpn */; }; - 0E011F882196E2AB00BA59EE /* ConfigurationParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E011F872196E2AB00BA59EE /* ConfigurationParser.swift */; }; - 0E011F892196E2AB00BA59EE /* ConfigurationParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E011F872196E2AB00BA59EE /* ConfigurationParser.swift */; }; - 0E041D092152E6FE0025FE3C /* TLSWrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E041D082152E6FE0025FE3C /* TLSWrap.swift */; }; - 0E041D0A2152E6FE0025FE3C /* TLSWrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E041D082152E6FE0025FE3C /* TLSWrap.swift */; }; - 0E07595F20EF6D1400F38FD8 /* CryptoCBC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E07595C20EF6D1400F38FD8 /* CryptoCBC.m */; }; - 0E07596020EF6D1400F38FD8 /* CryptoCBC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E07595C20EF6D1400F38FD8 /* CryptoCBC.m */; }; - 0E07596320EF733F00F38FD8 /* CryptoMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E07596120EF733F00F38FD8 /* CryptoMacros.h */; }; - 0E07596420EF733F00F38FD8 /* CryptoMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E07596120EF733F00F38FD8 /* CryptoMacros.h */; }; - 0E07596B20EF79AB00F38FD8 /* Crypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E07596A20EF79AB00F38FD8 /* Crypto.h */; }; - 0E07596C20EF79AB00F38FD8 /* Crypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E07596A20EF79AB00F38FD8 /* Crypto.h */; }; - 0E07596E20EF79B400F38FD8 /* CryptoCBC.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E07596D20EF79B400F38FD8 /* CryptoCBC.h */; }; - 0E07596F20EF79B400F38FD8 /* CryptoCBC.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E07596D20EF79B400F38FD8 /* CryptoCBC.h */; }; - 0E07597E20F0060E00F38FD8 /* CryptoAEAD.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E07597C20F0060E00F38FD8 /* CryptoAEAD.h */; }; - 0E07597F20F0060E00F38FD8 /* CryptoAEAD.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E07597C20F0060E00F38FD8 /* CryptoAEAD.h */; }; - 0E07598020F0060E00F38FD8 /* CryptoAEAD.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E07597D20F0060E00F38FD8 /* CryptoAEAD.m */; }; - 0E07598120F0060E00F38FD8 /* CryptoAEAD.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E07597D20F0060E00F38FD8 /* CryptoAEAD.m */; }; 0E0B20402278A85C007A3CB9 /* RoutingTableEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E0B203E2278A85B007A3CB9 /* RoutingTableEntry.h */; }; 0E0B20412278A85C007A3CB9 /* RoutingTableEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E0B203E2278A85B007A3CB9 /* RoutingTableEntry.h */; }; 0E0B20422278A85C007A3CB9 /* RoutingTableEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E0B203F2278A85B007A3CB9 /* RoutingTableEntry.m */; }; 0E0B20432278A85C007A3CB9 /* RoutingTableEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E0B203F2278A85B007A3CB9 /* RoutingTableEntry.m */; }; - 0E0C2125212ED29D008AB282 /* OpenVPNError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E0C2123212ED29D008AB282 /* OpenVPNError.swift */; }; - 0E0C2126212ED29D008AB282 /* OpenVPNError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E0C2123212ED29D008AB282 /* OpenVPNError.swift */; }; - 0E0C2127212ED29D008AB282 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E0C2124212ED29D008AB282 /* Configuration.swift */; }; - 0E0C2128212ED29D008AB282 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E0C2124212ED29D008AB282 /* Configuration.swift */; }; 0E11089F1F77B9E800A92462 /* TunnelKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E17D7F91F730D9F009EE129 /* TunnelKit.framework */; }; 0E1108AC1F77B9F900A92462 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E1108AB1F77B9F900A92462 /* AppDelegate.swift */; }; 0E1108AE1F77B9F900A92462 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E1108AD1F77B9F900A92462 /* ViewController.swift */; }; @@ -47,97 +27,164 @@ 0E12B29F21449ADB00B4BAE9 /* NSRegularExpression+Shortcuts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E12B29D21449ADB00B4BAE9 /* NSRegularExpression+Shortcuts.swift */; }; 0E12B2A521454F7F00B4BAE9 /* BidirectionalState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E12B2A421454F7F00B4BAE9 /* BidirectionalState.swift */; }; 0E12B2A621454F7F00B4BAE9 /* BidirectionalState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E12B2A421454F7F00B4BAE9 /* BidirectionalState.swift */; }; - 0E12B2A821456C0200B4BAE9 /* ControlChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E12B2A721456C0200B4BAE9 /* ControlChannel.swift */; }; - 0E12B2A921456C0200B4BAE9 /* ControlChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E12B2A721456C0200B4BAE9 /* ControlChannel.swift */; }; - 0E12B2AB2145E01700B4BAE9 /* ControlChannelSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E12B2AA2145E01700B4BAE9 /* ControlChannelSerializer.swift */; }; - 0E12B2AC2145E01700B4BAE9 /* ControlChannelSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E12B2AA2145E01700B4BAE9 /* ControlChannelSerializer.swift */; }; - 0E23B3D02297192900304C30 /* NETCPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3CF2297192900304C30 /* NETCPLink.swift */; }; - 0E23B3D12297192900304C30 /* NETCPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3CF2297192900304C30 /* NETCPLink.swift */; }; - 0E23B3D32297193000304C30 /* NEUDPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3D22297193000304C30 /* NEUDPLink.swift */; }; - 0E23B3D42297193000304C30 /* NEUDPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3D22297193000304C30 /* NEUDPLink.swift */; }; - 0E23B3DE229749C600304C30 /* LinkProducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3DD229749C600304C30 /* LinkProducer.swift */; }; - 0E23B3DF229749C600304C30 /* LinkProducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3DD229749C600304C30 /* LinkProducer.swift */; }; 0E23B3DB2297466600304C30 /* TestUtils+Core.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3D82297463200304C30 /* TestUtils+Core.swift */; }; 0E23B3DC2297466700304C30 /* TestUtils+Core.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3D82297463200304C30 /* TestUtils+Core.swift */; }; - 0E245D6C2137F73600B012A2 /* CompressionFramingNative.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E245D6B2137F73600B012A2 /* CompressionFramingNative.h */; }; - 0E39BCE8214B2AB60035E9DE /* ControlPacket.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */; }; - 0E39BCE9214B2AB60035E9DE /* ControlPacket.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */; }; - 0E39BCEA214B2AB60035E9DE /* ControlPacket.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E39BCE7214B2AB60035E9DE /* ControlPacket.m */; }; - 0E39BCEB214B2AB60035E9DE /* ControlPacket.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E39BCE7214B2AB60035E9DE /* ControlPacket.m */; }; - 0E3B15C72152B05E00984B17 /* CryptoCTR.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E3B15C52152B05E00984B17 /* CryptoCTR.h */; }; - 0E3B15C82152B05E00984B17 /* CryptoCTR.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E3B15C52152B05E00984B17 /* CryptoCTR.h */; }; - 0E3B15C92152B05E00984B17 /* CryptoCTR.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E3B15C62152B05E00984B17 /* CryptoCTR.m */; }; - 0E3B15CA2152B05E00984B17 /* CryptoCTR.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E3B15C62152B05E00984B17 /* CryptoCTR.m */; }; + 0E23B3DE229749C600304C30 /* LinkProducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3DD229749C600304C30 /* LinkProducer.swift */; }; + 0E23B3DF229749C600304C30 /* LinkProducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3DD229749C600304C30 /* LinkProducer.swift */; }; + 0E23B42522982AF800304C30 /* CryptoCBC.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3E222982AF800304C30 /* CryptoCBC.h */; }; + 0E23B42622982AF800304C30 /* CryptoCBC.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3E222982AF800304C30 /* CryptoCBC.h */; }; + 0E23B42722982AF800304C30 /* CryptoAEAD.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3E322982AF800304C30 /* CryptoAEAD.m */; }; + 0E23B42822982AF800304C30 /* CryptoAEAD.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3E322982AF800304C30 /* CryptoAEAD.m */; }; + 0E23B42922982AF800304C30 /* CryptoCTR.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3E422982AF800304C30 /* CryptoCTR.h */; }; + 0E23B42A22982AF800304C30 /* CryptoCTR.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3E422982AF800304C30 /* CryptoCTR.h */; }; + 0E23B42B22982AF800304C30 /* SessionKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3E522982AF800304C30 /* SessionKey.swift */; }; + 0E23B42C22982AF800304C30 /* SessionKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3E522982AF800304C30 /* SessionKey.swift */; }; + 0E23B42D22982AF800304C30 /* ControlChannelSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3E622982AF800304C30 /* ControlChannelSerializer.swift */; }; + 0E23B42E22982AF800304C30 /* ControlChannelSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3E622982AF800304C30 /* ControlChannelSerializer.swift */; }; + 0E23B42F22982AF800304C30 /* MSS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3E722982AF800304C30 /* MSS.h */; }; + 0E23B43022982AF800304C30 /* MSS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3E722982AF800304C30 /* MSS.h */; }; + 0E23B43122982AF800304C30 /* PacketMacros.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3E822982AF800304C30 /* PacketMacros.m */; }; + 0E23B43222982AF800304C30 /* PacketMacros.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3E822982AF800304C30 /* PacketMacros.m */; }; + 0E23B43322982AF800304C30 /* ControlChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3E922982AF800304C30 /* ControlChannel.swift */; }; + 0E23B43422982AF800304C30 /* ControlChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3E922982AF800304C30 /* ControlChannel.swift */; }; + 0E23B43522982AF800304C30 /* CoreConfiguration+OpenVPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3EA22982AF800304C30 /* CoreConfiguration+OpenVPN.swift */; }; + 0E23B43622982AF800304C30 /* CoreConfiguration+OpenVPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3EA22982AF800304C30 /* CoreConfiguration+OpenVPN.swift */; }; + 0E23B43722982AF800304C30 /* TLSBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3EB22982AF800304C30 /* TLSBox.m */; }; + 0E23B43822982AF800304C30 /* TLSBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3EB22982AF800304C30 /* TLSBox.m */; }; + 0E23B43922982AF800304C30 /* OpenVPNError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3EC22982AF800304C30 /* OpenVPNError.swift */; }; + 0E23B43A22982AF800304C30 /* OpenVPNError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3EC22982AF800304C30 /* OpenVPNError.swift */; }; + 0E23B43B22982AF800304C30 /* ControlPacket.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3ED22982AF800304C30 /* ControlPacket.h */; }; + 0E23B43C22982AF800304C30 /* ControlPacket.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3ED22982AF800304C30 /* ControlPacket.h */; }; + 0E23B43D22982AF800304C30 /* CryptoBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3EE22982AF800304C30 /* CryptoBox.m */; }; + 0E23B43E22982AF800304C30 /* CryptoBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3EE22982AF800304C30 /* CryptoBox.m */; }; + 0E23B43F22982AF800304C30 /* OpenVPNSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3EF22982AF800304C30 /* OpenVPNSession.swift */; }; + 0E23B44022982AF800304C30 /* OpenVPNSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3EF22982AF800304C30 /* OpenVPNSession.swift */; }; + 0E23B44122982AF800304C30 /* OpenVPNSession+PIA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F022982AF800304C30 /* OpenVPNSession+PIA.swift */; }; + 0E23B44222982AF800304C30 /* OpenVPNSession+PIA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F022982AF800304C30 /* OpenVPNSession+PIA.swift */; }; + 0E23B44322982AF800304C30 /* CryptoContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F122982AF800304C30 /* CryptoContainer.swift */; }; + 0E23B44422982AF800304C30 /* CryptoContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F122982AF800304C30 /* CryptoContainer.swift */; }; + 0E23B44522982AF800304C30 /* DataPathCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3F222982AF800304C30 /* DataPathCrypto.h */; }; + 0E23B44622982AF800304C30 /* DataPathCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3F222982AF800304C30 /* DataPathCrypto.h */; }; + 0E23B44722982AF800304C30 /* OpenVPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F322982AF800304C30 /* OpenVPN.swift */; }; + 0E23B44822982AF800304C30 /* OpenVPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F322982AF800304C30 /* OpenVPN.swift */; }; + 0E23B44922982AF800304C30 /* CompressionAlgorithmNative.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3F422982AF800304C30 /* CompressionAlgorithmNative.h */; }; + 0E23B44A22982AF800304C30 /* CompressionAlgorithmNative.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3F422982AF800304C30 /* CompressionAlgorithmNative.h */; }; + 0E23B44B22982AF800304C30 /* TLSWrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F522982AF800304C30 /* TLSWrap.swift */; }; + 0E23B44C22982AF800304C30 /* TLSWrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F522982AF800304C30 /* TLSWrap.swift */; }; + 0E23B44D22982AF800304C30 /* DataPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3F622982AF800304C30 /* DataPath.h */; }; + 0E23B44E22982AF800304C30 /* DataPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3F622982AF800304C30 /* DataPath.h */; }; + 0E23B44F22982AF800304C30 /* OpenVPNTunnelProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F822982AF800304C30 /* OpenVPNTunnelProvider+Interaction.swift */; }; + 0E23B45022982AF800304C30 /* OpenVPNTunnelProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F822982AF800304C30 /* OpenVPNTunnelProvider+Interaction.swift */; }; + 0E23B45122982AF800304C30 /* NEUDPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F922982AF800304C30 /* NEUDPLink.swift */; }; + 0E23B45222982AF800304C30 /* NEUDPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3F922982AF800304C30 /* NEUDPLink.swift */; }; + 0E23B45322982AF800304C30 /* ConnectionStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3FA22982AF800304C30 /* ConnectionStrategy.swift */; }; + 0E23B45422982AF800304C30 /* ConnectionStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3FA22982AF800304C30 /* ConnectionStrategy.swift */; }; + 0E23B45522982AF800304C30 /* OpenVPNTunnelProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3FB22982AF800304C30 /* OpenVPNTunnelProvider+Configuration.swift */; }; + 0E23B45622982AF800304C30 /* OpenVPNTunnelProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3FB22982AF800304C30 /* OpenVPNTunnelProvider+Configuration.swift */; }; + 0E23B45722982AF800304C30 /* NETCPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3FC22982AF800304C30 /* NETCPLink.swift */; }; + 0E23B45822982AF800304C30 /* NETCPLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3FC22982AF800304C30 /* NETCPLink.swift */; }; + 0E23B45922982AF800304C30 /* OpenVPNTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3FD22982AF800304C30 /* OpenVPNTunnelProvider.swift */; }; + 0E23B45A22982AF800304C30 /* OpenVPNTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3FD22982AF800304C30 /* OpenVPNTunnelProvider.swift */; }; + 0E23B45B22982AF800304C30 /* PacketStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3FE22982AF800304C30 /* PacketStream.h */; }; + 0E23B45C22982AF800304C30 /* PacketStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B3FE22982AF800304C30 /* PacketStream.h */; }; + 0E23B45D22982AF800304C30 /* ProtocolMacros.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3FF22982AF800304C30 /* ProtocolMacros.swift */; }; + 0E23B45E22982AF800304C30 /* ProtocolMacros.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B3FF22982AF800304C30 /* ProtocolMacros.swift */; }; + 0E23B45F22982AF800304C30 /* ReplayProtector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B40022982AF800304C30 /* ReplayProtector.h */; }; + 0E23B46022982AF800304C30 /* ReplayProtector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B40022982AF800304C30 /* ReplayProtector.h */; }; + 0E23B46122982AF800304C30 /* Crypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B40122982AF800304C30 /* Crypto.h */; }; + 0E23B46222982AF800304C30 /* Crypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B40122982AF800304C30 /* Crypto.h */; }; + 0E23B46322982AF800304C30 /* CompressionAlgorithm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40222982AF800304C30 /* CompressionAlgorithm.swift */; }; + 0E23B46422982AF800304C30 /* CompressionAlgorithm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40222982AF800304C30 /* CompressionAlgorithm.swift */; }; + 0E23B46522982AF800304C30 /* EncryptionBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40322982AF800304C30 /* EncryptionBridge.swift */; }; + 0E23B46622982AF800304C30 /* EncryptionBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40322982AF800304C30 /* EncryptionBridge.swift */; }; + 0E23B46722982AF800304C30 /* Authenticator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40422982AF800304C30 /* Authenticator.swift */; }; + 0E23B46822982AF800304C30 /* Authenticator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40422982AF800304C30 /* Authenticator.swift */; }; + 0E23B46922982AF800304C30 /* CompressionFraming.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40522982AF800304C30 /* CompressionFraming.swift */; }; + 0E23B46A22982AF800304C30 /* CompressionFraming.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40522982AF800304C30 /* CompressionFraming.swift */; }; + 0E23B46B22982AF800304C30 /* CryptoCBC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40622982AF800304C30 /* CryptoCBC.m */; }; + 0E23B46C22982AF800304C30 /* CryptoCBC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40622982AF800304C30 /* CryptoCBC.m */; }; + 0E23B46D22982AF800304C30 /* StaticKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40722982AF800304C30 /* StaticKey.swift */; }; + 0E23B46E22982AF800304C30 /* StaticKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40722982AF800304C30 /* StaticKey.swift */; }; + 0E23B46F22982AF800304C30 /* PushReply.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40822982AF800304C30 /* PushReply.swift */; }; + 0E23B47022982AF800304C30 /* PushReply.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40822982AF800304C30 /* PushReply.swift */; }; + 0E23B47122982AF800304C30 /* PacketMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B40922982AF800304C30 /* PacketMacros.h */; }; + 0E23B47222982AF800304C30 /* PacketMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B40922982AF800304C30 /* PacketMacros.h */; }; + 0E23B47322982AF800304C30 /* MSS.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40A22982AF800304C30 /* MSS.m */; }; + 0E23B47422982AF800304C30 /* MSS.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40A22982AF800304C30 /* MSS.m */; }; + 0E23B47522982AF800304C30 /* CryptoCTR.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40B22982AF800304C30 /* CryptoCTR.m */; }; + 0E23B47622982AF800304C30 /* CryptoCTR.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40B22982AF800304C30 /* CryptoCTR.m */; }; + 0E23B47722982AF800304C30 /* CryptoAEAD.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B40C22982AF800304C30 /* CryptoAEAD.h */; }; + 0E23B47822982AF800304C30 /* CryptoAEAD.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B40C22982AF800304C30 /* CryptoAEAD.h */; }; + 0E23B47922982AF800304C30 /* CompressionFramingNative.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B40D22982AF800304C30 /* CompressionFramingNative.h */; }; + 0E23B47A22982AF800304C30 /* CompressionFramingNative.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B40D22982AF800304C30 /* CompressionFramingNative.h */; }; + 0E23B47B22982AF800304C30 /* ConfigurationParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40E22982AF800304C30 /* ConfigurationParser.swift */; }; + 0E23B47C22982AF800304C30 /* ConfigurationParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40E22982AF800304C30 /* ConfigurationParser.swift */; }; + 0E23B47D22982AF800304C30 /* Packet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40F22982AF800304C30 /* Packet.swift */; }; + 0E23B47E22982AF800304C30 /* Packet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B40F22982AF800304C30 /* Packet.swift */; }; + 0E23B47F22982AF800304C30 /* CryptoBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B41022982AF800304C30 /* CryptoBox.h */; }; + 0E23B48022982AF800304C30 /* CryptoBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B41022982AF800304C30 /* CryptoBox.h */; }; + 0E23B48122982AF800304C30 /* ControlPacket.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41122982AF800304C30 /* ControlPacket.m */; }; + 0E23B48222982AF800304C30 /* ControlPacket.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41122982AF800304C30 /* ControlPacket.m */; }; + 0E23B48322982AF800304C30 /* TLSBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B41322982AF800304C30 /* TLSBox.h */; }; + 0E23B48422982AF800304C30 /* TLSBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B41322982AF800304C30 /* TLSBox.h */; }; + 0E23B48522982AF800304C30 /* ReplayProtector.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41422982AF800304C30 /* ReplayProtector.m */; }; + 0E23B48622982AF800304C30 /* ReplayProtector.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41422982AF800304C30 /* ReplayProtector.m */; }; + 0E23B48722982AF800304C30 /* CryptoMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B41522982AF800304C30 /* CryptoMacros.h */; }; + 0E23B48822982AF800304C30 /* CryptoMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B41522982AF800304C30 /* CryptoMacros.h */; }; + 0E23B48922982AF800304C30 /* PacketStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41622982AF800304C30 /* PacketStream.m */; }; + 0E23B48A22982AF800304C30 /* PacketStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41622982AF800304C30 /* PacketStream.m */; }; + 0E23B48B22982AF800304C30 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41722982AF800304C30 /* Configuration.swift */; }; + 0E23B48C22982AF800304C30 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41722982AF800304C30 /* Configuration.swift */; }; + 0E23B48D22982AF800304C30 /* DataPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41822982AF800304C30 /* DataPath.m */; }; + 0E23B48E22982AF800304C30 /* DataPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41822982AF800304C30 /* DataPath.m */; }; + 0E23B48F22982AF800304C30 /* StandardLZO.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41B22982AF800304C30 /* StandardLZO.m */; }; + 0E23B49022982AF800304C30 /* StandardLZO.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B41B22982AF800304C30 /* StandardLZO.m */; }; + 0E23B49122982AF800304C30 /* lzodefs.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B41D22982AF800304C30 /* lzodefs.h */; }; + 0E23B49222982AF800304C30 /* lzodefs.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B41D22982AF800304C30 /* lzodefs.h */; }; + 0E23B49322982AF800304C30 /* lzoconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B41E22982AF800304C30 /* lzoconf.h */; }; + 0E23B49422982AF800304C30 /* lzoconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B41E22982AF800304C30 /* lzoconf.h */; }; + 0E23B49722982AF800304C30 /* minilzo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B42022982AF800304C30 /* minilzo.h */; }; + 0E23B49822982AF800304C30 /* minilzo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E23B42022982AF800304C30 /* minilzo.h */; }; + 0E23B49F22982AF800304C30 /* minilzo.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B42422982AF800304C30 /* minilzo.c */; }; + 0E23B4A022982AF800304C30 /* minilzo.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E23B42422982AF800304C30 /* minilzo.c */; }; 0E3B65742249253A00EFF4DA /* tunnelbear.enc.1.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = 0E3B656E224923EC00EFF4DA /* tunnelbear.enc.1.ovpn */; }; 0E3B65752249253B00EFF4DA /* tunnelbear.enc.1.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = 0E3B656E224923EC00EFF4DA /* tunnelbear.enc.1.ovpn */; }; 0E3B65762249253F00EFF4DA /* tunnelbear.key in Resources */ = {isa = PBXBuildFile; fileRef = 0E3B65712249247E00EFF4DA /* tunnelbear.key */; }; 0E3B65772249254000EFF4DA /* tunnelbear.key in Resources */ = {isa = PBXBuildFile; fileRef = 0E3B65712249247E00EFF4DA /* tunnelbear.key */; }; - 0E3E0F212108A8CC00B371C1 /* PushReply.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E3E0F202108A8CC00B371C1 /* PushReply.swift */; }; - 0E3E0F222108A8CC00B371C1 /* PushReply.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E3E0F202108A8CC00B371C1 /* PushReply.swift */; }; 0E411B9B2271F90700E0852C /* DNS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E411B992271F90700E0852C /* DNS.h */; }; 0E411B9C2271F90700E0852C /* DNS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E411B992271F90700E0852C /* DNS.h */; }; 0E411B9D2271F90700E0852C /* DNS.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E411B9A2271F90700E0852C /* DNS.m */; }; 0E411B9E2271F90700E0852C /* DNS.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E411B9A2271F90700E0852C /* DNS.m */; }; 0E411BA02271FA3300E0852C /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E411B9F2271FA3300E0852C /* libresolv.tbd */; }; 0E411BA22271FA3C00E0852C /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E411BA12271FA3C00E0852C /* libresolv.tbd */; }; - 0E48AC642271ADA9009B1A98 /* PacketStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E48AC622271ADA8009B1A98 /* PacketStream.h */; }; - 0E48AC652271ADA9009B1A98 /* PacketStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E48AC622271ADA8009B1A98 /* PacketStream.h */; }; - 0E48AC662271ADA9009B1A98 /* PacketStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E48AC632271ADA9009B1A98 /* PacketStream.m */; }; - 0E48AC672271ADA9009B1A98 /* PacketStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E48AC632271ADA9009B1A98 /* PacketStream.m */; }; 0E500EA622493B5B00CAE560 /* tunnelbear.enc.1.key in Resources */ = {isa = PBXBuildFile; fileRef = 0E500EA522493B5B00CAE560 /* tunnelbear.enc.1.key */; }; 0E500EA722493B5B00CAE560 /* tunnelbear.enc.1.key in Resources */ = {isa = PBXBuildFile; fileRef = 0E500EA522493B5B00CAE560 /* tunnelbear.enc.1.key */; }; - 0E58BF3322405410006FB157 /* lzoconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E58BF2F22405410006FB157 /* lzoconf.h */; }; - 0E58BF3422405410006FB157 /* lzoconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E58BF2F22405410006FB157 /* lzoconf.h */; }; - 0E58BF3522405410006FB157 /* lzodefs.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E58BF3022405410006FB157 /* lzodefs.h */; }; - 0E58BF3622405410006FB157 /* lzodefs.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E58BF3022405410006FB157 /* lzodefs.h */; }; - 0E58BF3722405410006FB157 /* minilzo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E58BF3122405410006FB157 /* minilzo.h */; }; - 0E58BF3822405410006FB157 /* minilzo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E58BF3122405410006FB157 /* minilzo.h */; }; - 0E58BF3922405410006FB157 /* minilzo.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E58BF3222405410006FB157 /* minilzo.c */; }; - 0E58BF3A22405410006FB157 /* minilzo.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E58BF3222405410006FB157 /* minilzo.c */; }; - 0E58BF4C22405C2F006FB157 /* StandardLZO.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E58BF4922405C2F006FB157 /* StandardLZO.m */; }; - 0E58BF4D22405C2F006FB157 /* StandardLZO.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E58BF4922405C2F006FB157 /* StandardLZO.m */; }; - 0E58BF502240F98F006FB157 /* CompressionAlgorithmNative.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E58BF4F2240F98E006FB157 /* CompressionAlgorithmNative.h */; }; - 0E58BF512240F98F006FB157 /* CompressionAlgorithmNative.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E58BF4F2240F98E006FB157 /* CompressionAlgorithmNative.h */; }; - 0E58BF532240FAA6006FB157 /* CompressionAlgorithm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E58BF522240FAA6006FB157 /* CompressionAlgorithm.swift */; }; - 0E58BF542240FAA6006FB157 /* CompressionAlgorithm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E58BF522240FAA6006FB157 /* CompressionAlgorithm.swift */; }; 0E58BF5622411F3D006FB157 /* LZO.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E58BF5522411F37006FB157 /* LZO.h */; }; 0E58BF5722411F3E006FB157 /* LZO.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E58BF5522411F37006FB157 /* LZO.h */; }; 0E58BF5922411FEF006FB157 /* LZO.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E58BF5822411FEF006FB157 /* LZO.m */; }; 0E58BF5A22411FEF006FB157 /* LZO.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E58BF5822411FEF006FB157 /* LZO.m */; }; - 0E749F5F2178885500BB2701 /* OpenVPNSession+PIA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E749F5E2178885500BB2701 /* OpenVPNSession+PIA.swift */; }; - 0E749F602178885500BB2701 /* OpenVPNSession+PIA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E749F5E2178885500BB2701 /* OpenVPNSession+PIA.swift */; }; 0E749F622178911D00BB2701 /* pia-2048.pem in Resources */ = {isa = PBXBuildFile; fileRef = 0E749F612178911C00BB2701 /* pia-2048.pem */; }; 0E9379C91F819A4300CE91B6 /* TunnelKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E17D7F91F730D9F009EE129 /* TunnelKit.framework */; }; 0EA82A282190B220007960EB /* TunnelKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E3251C51F95770D00C108D9 /* TunnelKit.framework */; }; 0EA82A3E2190B2BC007960EB /* pia-2048.pem in Resources */ = {isa = PBXBuildFile; fileRef = 0E749F612178911C00BB2701 /* pia-2048.pem */; }; - 0EB03E3F2290D310006D03A0 /* CoreConfiguration+OpenVPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E3E2290D310006D03A0 /* CoreConfiguration+OpenVPN.swift */; }; - 0EB03E402290D310006D03A0 /* CoreConfiguration+OpenVPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E3E2290D310006D03A0 /* CoreConfiguration+OpenVPN.swift */; }; 0ECC60D82254981A0020BEAC /* ConfigurationError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ECC60D72254981A0020BEAC /* ConfigurationError.swift */; }; 0ECC60D92254981A0020BEAC /* ConfigurationError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ECC60D72254981A0020BEAC /* ConfigurationError.swift */; }; - 0ECE3528212EB7770040F253 /* CryptoContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ECE3527212EB7770040F253 /* CryptoContainer.swift */; }; - 0ECE352A212EB88E0040F253 /* CryptoContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ECE3527212EB7770040F253 /* CryptoContainer.swift */; }; 0ECEB1152252C8E900E9E551 /* tunnelbear.enc.8.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = 0ECEB1132252C8E900E9E551 /* tunnelbear.enc.8.ovpn */; }; 0ECEB1162252C8E900E9E551 /* tunnelbear.enc.8.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = 0ECEB1132252C8E900E9E551 /* tunnelbear.enc.8.ovpn */; }; 0ECEB1172252C8E900E9E551 /* tunnelbear.enc.8.key in Resources */ = {isa = PBXBuildFile; fileRef = 0ECEB1142252C8E900E9E551 /* tunnelbear.enc.8.key */; }; 0ECEB1182252C8E900E9E551 /* tunnelbear.enc.8.key in Resources */ = {isa = PBXBuildFile; fileRef = 0ECEB1142252C8E900E9E551 /* tunnelbear.enc.8.key */; }; 0ECEB11B2252CDAD00E9E551 /* tunnelbear.crt in Resources */ = {isa = PBXBuildFile; fileRef = 0ECEB11A2252CDAD00E9E551 /* tunnelbear.crt */; }; 0ECEB11C2252CDAD00E9E551 /* tunnelbear.crt in Resources */ = {isa = PBXBuildFile; fileRef = 0ECEB11A2252CDAD00E9E551 /* tunnelbear.crt */; }; - 0ED9C8642138139000621BA3 /* CompressionFraming.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ED9C8632138139000621BA3 /* CompressionFraming.swift */; }; - 0ED9C8652138139000621BA3 /* CompressionFraming.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ED9C8632138139000621BA3 /* CompressionFraming.swift */; }; 0EE2F96E2291636B00F56F49 /* IPv4Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F96D2291636B00F56F49 /* IPv4Settings.swift */; }; 0EE2F96F2291636B00F56F49 /* IPv4Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F96D2291636B00F56F49 /* IPv4Settings.swift */; }; 0EE2F9712291638600F56F49 /* IPv6Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9702291638600F56F49 /* IPv6Settings.swift */; }; 0EE2F9722291638600F56F49 /* IPv6Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9702291638600F56F49 /* IPv6Settings.swift */; }; 0EE2F974229163C900F56F49 /* Proxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F973229163C900F56F49 /* Proxy.swift */; }; 0EE2F975229163C900F56F49 /* Proxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F973229163C900F56F49 /* Proxy.swift */; }; - 0EE2F97722916A5D00F56F49 /* OpenVPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F97622916A5D00F56F49 /* OpenVPN.swift */; }; - 0EE2F97822916A5D00F56F49 /* OpenVPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F97622916A5D00F56F49 /* OpenVPN.swift */; }; 0EE2F97A2291817300F56F49 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9792291817300F56F49 /* Errors.swift */; }; 0EE2F97B2291817300F56F49 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9792291817300F56F49 /* Errors.swift */; }; 0EE2F9AC2291853D00F56F49 /* Session.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9AB2291853D00F56F49 /* Session.swift */; }; 0EE2F9AD2291853D00F56F49 /* Session.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9AB2291853D00F56F49 /* Session.swift */; }; - 0EE2F9EE22918DA100F56F49 /* ConnectionStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9DE22918DA100F56F49 /* ConnectionStrategy.swift */; }; - 0EE2F9EF22918DA100F56F49 /* ConnectionStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9DE22918DA100F56F49 /* ConnectionStrategy.swift */; }; 0EE2F9F022918DA100F56F49 /* NETCPSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E022918DA100F56F49 /* NETCPSocket.swift */; }; 0EE2F9F122918DA100F56F49 /* NETCPSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E022918DA100F56F49 /* NETCPSocket.swift */; }; 0EE2F9F222918DA100F56F49 /* NETunnelInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E122918DA100F56F49 /* NETunnelInterface.swift */; }; @@ -150,20 +197,14 @@ 0EE2F9F922918DA100F56F49 /* NWUDPSessionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E422918DA100F56F49 /* NWUDPSessionState+Description.swift */; }; 0EE2F9FA22918DA100F56F49 /* DNSResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E522918DA100F56F49 /* DNSResolver.swift */; }; 0EE2F9FB22918DA100F56F49 /* DNSResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E522918DA100F56F49 /* DNSResolver.swift */; }; - 0EE2F9FC22918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E622918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift */; }; - 0EE2F9FD22918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E622918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift */; }; 0EE2F9FE22918DA100F56F49 /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E722918DA100F56F49 /* Keychain.swift */; }; 0EE2F9FF22918DA100F56F49 /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E722918DA100F56F49 /* Keychain.swift */; }; 0EE2FA0022918DA100F56F49 /* MemoryDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E822918DA100F56F49 /* MemoryDestination.swift */; }; 0EE2FA0122918DA100F56F49 /* MemoryDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E822918DA100F56F49 /* MemoryDestination.swift */; }; 0EE2FA0222918DA100F56F49 /* GenericSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E922918DA100F56F49 /* GenericSocket.swift */; }; 0EE2FA0322918DA100F56F49 /* GenericSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9E922918DA100F56F49 /* GenericSocket.swift */; }; - 0EE2FA0422918DA100F56F49 /* OpenVPNTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EA22918DA100F56F49 /* OpenVPNTunnelProvider.swift */; }; - 0EE2FA0522918DA100F56F49 /* OpenVPNTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EA22918DA100F56F49 /* OpenVPNTunnelProvider.swift */; }; 0EE2FA0622918DA100F56F49 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EB22918DA100F56F49 /* Utils.swift */; }; 0EE2FA0722918DA100F56F49 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EB22918DA100F56F49 /* Utils.swift */; }; - 0EE2FA0822918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EC22918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift */; }; - 0EE2FA0922918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9EC22918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift */; }; 0EE2FA0A22918DA100F56F49 /* InterfaceObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9ED22918DA100F56F49 /* InterfaceObserver.swift */; }; 0EE2FA0B22918DA100F56F49 /* InterfaceObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2F9ED22918DA100F56F49 /* InterfaceObserver.swift */; }; 0EE2FA422291954300F56F49 /* AppExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA0E2291953300F56F49 /* AppExtensionTests.swift */; }; @@ -202,75 +243,36 @@ 0EE2FA632291954400F56F49 /* RoutingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA132291953300F56F49 /* RoutingTests.swift */; }; 0EE2FA642291954400F56F49 /* StaticKeyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA142291953300F56F49 /* StaticKeyTests.swift */; }; 0EE2FA652291954400F56F49 /* TestUtils+OpenVPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE2FA152291953300F56F49 /* TestUtils+OpenVPN.swift */; }; - 0EE3B3E421471C3A0027AB17 /* StaticKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE3B3E321471C3A0027AB17 /* StaticKey.swift */; }; - 0EE3B3E521471C3A0027AB17 /* StaticKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE3B3E321471C3A0027AB17 /* StaticKey.swift */; }; - 0EE7A79820F6296F00B42E6A /* PacketMacros.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE7A79720F6296F00B42E6A /* PacketMacros.m */; }; - 0EE7A79920F6296F00B42E6A /* PacketMacros.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE7A79720F6296F00B42E6A /* PacketMacros.m */; }; 0EEC49E120B5F7EA008FEB91 /* Allocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB42E2006D3C800F81029 /* Allocation.h */; }; - 0EEC49E220B5F7F6008FEB91 /* CryptoBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4402006D3C800F81029 /* CryptoBox.h */; }; - 0EEC49E320B5F7F6008FEB91 /* DataPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4352006D3C800F81029 /* DataPath.h */; }; 0EEC49E520B5F7F6008FEB91 /* Errors.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4362006D3C800F81029 /* Errors.h */; }; - 0EEC49E620B5F7F6008FEB91 /* MSS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB42D2006D3C800F81029 /* MSS.h */; }; - 0EEC49E820B5F7F6008FEB91 /* ReplayProtector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4392006D3C800F81029 /* ReplayProtector.h */; }; - 0EEC49E920B5F7F6008FEB91 /* TLSBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4442006D3C800F81029 /* TLSBox.h */; }; 0EEC49EA20B5F7F6008FEB91 /* ZeroingData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4412006D3C800F81029 /* ZeroingData.h */; }; - 0EF5CF262141E142004FF1BD /* PacketMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EE7A79420F61EDC00B42E6A /* PacketMacros.h */; }; - 0EF5CF272141E15B004FF1BD /* PacketMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EE7A79420F61EDC00B42E6A /* PacketMacros.h */; }; - 0EF5CF282141E183004FF1BD /* CompressionFramingNative.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E245D6B2137F73600B012A2 /* CompressionFramingNative.h */; }; 0EFB902922788511006405E4 /* RoutingTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFB902722788511006405E4 /* RoutingTable.h */; }; 0EFB902A22788511006405E4 /* RoutingTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFB902722788511006405E4 /* RoutingTable.h */; }; 0EFB902B22788512006405E4 /* RoutingTable.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFB902822788511006405E4 /* RoutingTable.m */; }; 0EFB902C22788512006405E4 /* RoutingTable.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFB902822788511006405E4 /* RoutingTable.m */; }; - 0EFEB4552006D3C800F81029 /* EncryptionBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB42A2006D3C800F81029 /* EncryptionBridge.swift */; }; - 0EFEB4562006D3C800F81029 /* SessionKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB42B2006D3C800F81029 /* SessionKey.swift */; }; - 0EFEB4582006D3C800F81029 /* MSS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB42D2006D3C800F81029 /* MSS.h */; }; 0EFEB4592006D3C800F81029 /* Allocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB42E2006D3C800F81029 /* Allocation.h */; }; 0EFEB45A2006D3C800F81029 /* TunnelInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB42F2006D3C800F81029 /* TunnelInterface.swift */; }; - 0EFEB45B2006D3C800F81029 /* TLSBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4302006D3C800F81029 /* TLSBox.m */; }; 0EFEB45C2006D3C800F81029 /* ZeroingData.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4312006D3C800F81029 /* ZeroingData.m */; }; - 0EFEB45D2006D3C800F81029 /* CryptoBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4322006D3C800F81029 /* CryptoBox.m */; }; - 0EFEB4602006D3C800F81029 /* DataPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4352006D3C800F81029 /* DataPath.h */; }; 0EFEB4612006D3C800F81029 /* Errors.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4362006D3C800F81029 /* Errors.h */; }; 0EFEB4622006D3C800F81029 /* SecureRandom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4372006D3C800F81029 /* SecureRandom.swift */; }; - 0EFEB4632006D3C800F81029 /* ProtocolMacros.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4382006D3C800F81029 /* ProtocolMacros.swift */; }; - 0EFEB4642006D3C800F81029 /* ReplayProtector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4392006D3C800F81029 /* ReplayProtector.h */; }; - 0EFEB4652006D3C800F81029 /* Authenticator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB43A2006D3C800F81029 /* Authenticator.swift */; }; 0EFEB4662006D3C800F81029 /* ZeroingData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB43B2006D3C800F81029 /* ZeroingData.swift */; }; - 0EFEB4672006D3C800F81029 /* OpenVPNSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB43C2006D3C800F81029 /* OpenVPNSession.swift */; }; - 0EFEB4682006D3C800F81029 /* MSS.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB43D2006D3C800F81029 /* MSS.m */; }; - 0EFEB4692006D3C800F81029 /* Packet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB43E2006D3C800F81029 /* Packet.swift */; }; - 0EFEB46B2006D3C800F81029 /* CryptoBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4402006D3C800F81029 /* CryptoBox.h */; }; 0EFEB46C2006D3C800F81029 /* ZeroingData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4412006D3C800F81029 /* ZeroingData.h */; }; 0EFEB46D2006D3C800F81029 /* Data+Manipulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4432006D3C800F81029 /* Data+Manipulation.swift */; }; - 0EFEB46E2006D3C800F81029 /* TLSBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EFEB4442006D3C800F81029 /* TLSBox.h */; }; 0EFEB46F2006D3C800F81029 /* IOInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4452006D3C800F81029 /* IOInterface.swift */; }; 0EFEB4702006D3C800F81029 /* Allocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4462006D3C800F81029 /* Allocation.m */; }; - 0EFEB4722006D3C800F81029 /* ReplayProtector.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4482006D3C800F81029 /* ReplayProtector.m */; }; 0EFEB4732006D3C800F81029 /* LinkInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4492006D3C800F81029 /* LinkInterface.swift */; }; 0EFEB4742006D3C800F81029 /* CoreConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB44A2006D3C800F81029 /* CoreConfiguration.swift */; }; 0EFEB4752006D3C800F81029 /* Errors.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB44B2006D3C800F81029 /* Errors.m */; }; - 0EFEB4762006D3C800F81029 /* DataPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB44C2006D3C800F81029 /* DataPath.m */; }; - 0EFEB48D2006D7F300F81029 /* EncryptionBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB42A2006D3C800F81029 /* EncryptionBridge.swift */; }; - 0EFEB48E2006D7F300F81029 /* SessionKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB42B2006D3C800F81029 /* SessionKey.swift */; }; 0EFEB4902006D7F300F81029 /* TunnelInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB42F2006D3C800F81029 /* TunnelInterface.swift */; }; - 0EFEB4912006D7F300F81029 /* TLSBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4302006D3C800F81029 /* TLSBox.m */; }; 0EFEB4922006D7F300F81029 /* ZeroingData.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4312006D3C800F81029 /* ZeroingData.m */; }; - 0EFEB4932006D7F300F81029 /* CryptoBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4322006D3C800F81029 /* CryptoBox.m */; }; 0EFEB4952006D7F300F81029 /* SecureRandom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4372006D3C800F81029 /* SecureRandom.swift */; }; - 0EFEB4962006D7F300F81029 /* ProtocolMacros.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4382006D3C800F81029 /* ProtocolMacros.swift */; }; - 0EFEB4972006D7F300F81029 /* Authenticator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB43A2006D3C800F81029 /* Authenticator.swift */; }; 0EFEB4982006D7F300F81029 /* ZeroingData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB43B2006D3C800F81029 /* ZeroingData.swift */; }; - 0EFEB4992006D7F300F81029 /* OpenVPNSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB43C2006D3C800F81029 /* OpenVPNSession.swift */; }; - 0EFEB49A2006D7F300F81029 /* MSS.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB43D2006D3C800F81029 /* MSS.m */; }; - 0EFEB49B2006D7F300F81029 /* Packet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB43E2006D3C800F81029 /* Packet.swift */; }; 0EFEB49C2006D7F300F81029 /* Data+Manipulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4432006D3C800F81029 /* Data+Manipulation.swift */; }; 0EFEB49D2006D7F300F81029 /* IOInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4452006D3C800F81029 /* IOInterface.swift */; }; 0EFEB49E2006D7F300F81029 /* Allocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4462006D3C800F81029 /* Allocation.m */; }; - 0EFEB4A02006D7F300F81029 /* ReplayProtector.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4482006D3C800F81029 /* ReplayProtector.m */; }; 0EFEB4A12006D7F300F81029 /* LinkInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4492006D3C800F81029 /* LinkInterface.swift */; }; 0EFEB4A22006D7F300F81029 /* CoreConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB44A2006D3C800F81029 /* CoreConfiguration.swift */; }; 0EFEB4A32006D7F300F81029 /* Errors.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB44B2006D3C800F81029 /* Errors.m */; }; - 0EFEB4A42006D7F300F81029 /* DataPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB44C2006D3C800F81029 /* DataPath.m */; }; 83B2AD687B4E13994EABABCB /* Pods_TunnelKit_TunnelKitTests_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3832A0057760E6C8900714B /* Pods_TunnelKit_TunnelKitTests_macOS.framework */; }; B4C2A996F52241B77E7762BD /* Pods_TunnelKit_TunnelKit_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 276657B3FED3840178C53D6B /* Pods_TunnelKit_TunnelKit_iOS.framework */; }; B94D5E2579FB6292E2EC7AF1 /* Pods_TunnelKit_TunnelKitHost.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF76B5FEAAFD5056FFCC5DA2 /* Pods_TunnelKit_TunnelKitHost.framework */; }; @@ -312,18 +314,8 @@ 0E011F792196D93600BA59EE /* SocketType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketType.swift; sourceTree = ""; }; 0E011F7C2196D97200BA59EE /* EndpointProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EndpointProtocol.swift; sourceTree = ""; }; 0E011F832196E25400BA59EE /* pia-hungary.ovpn */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pia-hungary.ovpn"; sourceTree = ""; }; - 0E011F872196E2AB00BA59EE /* ConfigurationParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigurationParser.swift; sourceTree = ""; }; - 0E041D082152E6FE0025FE3C /* TLSWrap.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLSWrap.swift; sourceTree = ""; }; - 0E07595C20EF6D1400F38FD8 /* CryptoCBC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CryptoCBC.m; sourceTree = ""; }; - 0E07596120EF733F00F38FD8 /* CryptoMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoMacros.h; sourceTree = ""; }; - 0E07596A20EF79AB00F38FD8 /* Crypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crypto.h; sourceTree = ""; }; - 0E07596D20EF79B400F38FD8 /* CryptoCBC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoCBC.h; sourceTree = ""; }; - 0E07597C20F0060E00F38FD8 /* CryptoAEAD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAEAD.h; sourceTree = ""; }; - 0E07597D20F0060E00F38FD8 /* CryptoAEAD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CryptoAEAD.m; sourceTree = ""; }; 0E0B203E2278A85B007A3CB9 /* RoutingTableEntry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoutingTableEntry.h; sourceTree = ""; }; 0E0B203F2278A85B007A3CB9 /* RoutingTableEntry.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoutingTableEntry.m; sourceTree = ""; }; - 0E0C2123212ED29D008AB282 /* OpenVPNError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenVPNError.swift; sourceTree = ""; }; - 0E0C2124212ED29D008AB282 /* Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; 0E11089A1F77B9E800A92462 /* TunnelKitTests-iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "TunnelKitTests-iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 0E11089E1F77B9E800A92462 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0E1108A91F77B9F900A92462 /* TunnelKitHost.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TunnelKitHost.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -335,74 +327,104 @@ 0E1108B71F77B9F900A92462 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0E12B29D21449ADB00B4BAE9 /* NSRegularExpression+Shortcuts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSRegularExpression+Shortcuts.swift"; sourceTree = ""; }; 0E12B2A421454F7F00B4BAE9 /* BidirectionalState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BidirectionalState.swift; sourceTree = ""; }; - 0E12B2A721456C0200B4BAE9 /* ControlChannel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlChannel.swift; sourceTree = ""; }; - 0E12B2AA2145E01700B4BAE9 /* ControlChannelSerializer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlChannelSerializer.swift; sourceTree = ""; }; 0E17D7F91F730D9F009EE129 /* TunnelKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TunnelKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0E23B3CF2297192900304C30 /* NETCPLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NETCPLink.swift; sourceTree = ""; }; - 0E23B3D22297193000304C30 /* NEUDPLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NEUDPLink.swift; sourceTree = ""; }; - 0E23B3DD229749C600304C30 /* LinkProducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkProducer.swift; sourceTree = ""; }; 0E23B3D82297463200304C30 /* TestUtils+Core.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TestUtils+Core.swift"; sourceTree = ""; }; - 0E245D6B2137F73600B012A2 /* CompressionFramingNative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompressionFramingNative.h; sourceTree = ""; }; + 0E23B3DD229749C600304C30 /* LinkProducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkProducer.swift; sourceTree = ""; }; + 0E23B3E222982AF800304C30 /* CryptoCBC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoCBC.h; sourceTree = ""; }; + 0E23B3E322982AF800304C30 /* CryptoAEAD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CryptoAEAD.m; sourceTree = ""; }; + 0E23B3E422982AF800304C30 /* CryptoCTR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoCTR.h; sourceTree = ""; }; + 0E23B3E522982AF800304C30 /* SessionKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionKey.swift; sourceTree = ""; }; + 0E23B3E622982AF800304C30 /* ControlChannelSerializer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ControlChannelSerializer.swift; sourceTree = ""; }; + 0E23B3E722982AF800304C30 /* MSS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSS.h; sourceTree = ""; }; + 0E23B3E822982AF800304C30 /* PacketMacros.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PacketMacros.m; sourceTree = ""; }; + 0E23B3E922982AF800304C30 /* ControlChannel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ControlChannel.swift; sourceTree = ""; }; + 0E23B3EA22982AF800304C30 /* CoreConfiguration+OpenVPN.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CoreConfiguration+OpenVPN.swift"; sourceTree = ""; }; + 0E23B3EB22982AF800304C30 /* TLSBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TLSBox.m; sourceTree = ""; }; + 0E23B3EC22982AF800304C30 /* OpenVPNError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenVPNError.swift; sourceTree = ""; }; + 0E23B3ED22982AF800304C30 /* ControlPacket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlPacket.h; sourceTree = ""; }; + 0E23B3EE22982AF800304C30 /* CryptoBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CryptoBox.m; sourceTree = ""; }; + 0E23B3EF22982AF800304C30 /* OpenVPNSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenVPNSession.swift; sourceTree = ""; }; + 0E23B3F022982AF800304C30 /* OpenVPNSession+PIA.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OpenVPNSession+PIA.swift"; sourceTree = ""; }; + 0E23B3F122982AF800304C30 /* CryptoContainer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CryptoContainer.swift; sourceTree = ""; }; + 0E23B3F222982AF800304C30 /* DataPathCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataPathCrypto.h; sourceTree = ""; }; + 0E23B3F322982AF800304C30 /* OpenVPN.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenVPN.swift; sourceTree = ""; }; + 0E23B3F422982AF800304C30 /* CompressionAlgorithmNative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompressionAlgorithmNative.h; sourceTree = ""; }; + 0E23B3F522982AF800304C30 /* TLSWrap.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLSWrap.swift; sourceTree = ""; }; + 0E23B3F622982AF800304C30 /* DataPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataPath.h; sourceTree = ""; }; + 0E23B3F822982AF800304C30 /* OpenVPNTunnelProvider+Interaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OpenVPNTunnelProvider+Interaction.swift"; sourceTree = ""; }; + 0E23B3F922982AF800304C30 /* NEUDPLink.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NEUDPLink.swift; sourceTree = ""; }; + 0E23B3FA22982AF800304C30 /* ConnectionStrategy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionStrategy.swift; sourceTree = ""; }; + 0E23B3FB22982AF800304C30 /* OpenVPNTunnelProvider+Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OpenVPNTunnelProvider+Configuration.swift"; sourceTree = ""; }; + 0E23B3FC22982AF800304C30 /* NETCPLink.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NETCPLink.swift; sourceTree = ""; }; + 0E23B3FD22982AF800304C30 /* OpenVPNTunnelProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenVPNTunnelProvider.swift; sourceTree = ""; }; + 0E23B3FE22982AF800304C30 /* PacketStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PacketStream.h; sourceTree = ""; }; + 0E23B3FF22982AF800304C30 /* ProtocolMacros.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProtocolMacros.swift; sourceTree = ""; }; + 0E23B40022982AF800304C30 /* ReplayProtector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplayProtector.h; sourceTree = ""; }; + 0E23B40122982AF800304C30 /* Crypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crypto.h; sourceTree = ""; }; + 0E23B40222982AF800304C30 /* CompressionAlgorithm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompressionAlgorithm.swift; sourceTree = ""; }; + 0E23B40322982AF800304C30 /* EncryptionBridge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EncryptionBridge.swift; sourceTree = ""; }; + 0E23B40422982AF800304C30 /* Authenticator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Authenticator.swift; sourceTree = ""; }; + 0E23B40522982AF800304C30 /* CompressionFraming.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompressionFraming.swift; sourceTree = ""; }; + 0E23B40622982AF800304C30 /* CryptoCBC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CryptoCBC.m; sourceTree = ""; }; + 0E23B40722982AF800304C30 /* StaticKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StaticKey.swift; sourceTree = ""; }; + 0E23B40822982AF800304C30 /* PushReply.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PushReply.swift; sourceTree = ""; }; + 0E23B40922982AF800304C30 /* PacketMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PacketMacros.h; sourceTree = ""; }; + 0E23B40A22982AF800304C30 /* MSS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSS.m; sourceTree = ""; }; + 0E23B40B22982AF800304C30 /* CryptoCTR.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CryptoCTR.m; sourceTree = ""; }; + 0E23B40C22982AF800304C30 /* CryptoAEAD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAEAD.h; sourceTree = ""; }; + 0E23B40D22982AF800304C30 /* CompressionFramingNative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompressionFramingNative.h; sourceTree = ""; }; + 0E23B40E22982AF800304C30 /* ConfigurationParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigurationParser.swift; sourceTree = ""; }; + 0E23B40F22982AF800304C30 /* Packet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Packet.swift; sourceTree = ""; }; + 0E23B41022982AF800304C30 /* CryptoBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoBox.h; sourceTree = ""; }; + 0E23B41122982AF800304C30 /* ControlPacket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ControlPacket.m; sourceTree = ""; }; + 0E23B41222982AF800304C30 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; + 0E23B41322982AF800304C30 /* TLSBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TLSBox.h; sourceTree = ""; }; + 0E23B41422982AF800304C30 /* ReplayProtector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReplayProtector.m; sourceTree = ""; }; + 0E23B41522982AF800304C30 /* CryptoMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoMacros.h; sourceTree = ""; }; + 0E23B41622982AF800304C30 /* PacketStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PacketStream.m; sourceTree = ""; }; + 0E23B41722982AF800304C30 /* Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; + 0E23B41822982AF800304C30 /* DataPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DataPath.m; sourceTree = ""; }; + 0E23B41B22982AF800304C30 /* StandardLZO.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StandardLZO.m; sourceTree = ""; }; + 0E23B41D22982AF800304C30 /* lzodefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lzodefs.h; sourceTree = ""; }; + 0E23B41E22982AF800304C30 /* lzoconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lzoconf.h; sourceTree = ""; }; + 0E23B42022982AF800304C30 /* minilzo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = minilzo.h; sourceTree = ""; }; + 0E23B42422982AF800304C30 /* minilzo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = minilzo.c; sourceTree = ""; }; 0E3251C51F95770D00C108D9 /* TunnelKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TunnelKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ControlPacket.h; sourceTree = ""; }; - 0E39BCE7214B2AB60035E9DE /* ControlPacket.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ControlPacket.m; sourceTree = ""; }; - 0E3B15C52152B05E00984B17 /* CryptoCTR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoCTR.h; sourceTree = ""; }; - 0E3B15C62152B05E00984B17 /* CryptoCTR.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CryptoCTR.m; sourceTree = ""; }; 0E3B656E224923EC00EFF4DA /* tunnelbear.enc.1.ovpn */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tunnelbear.enc.1.ovpn; sourceTree = ""; }; 0E3B65712249247E00EFF4DA /* tunnelbear.key */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tunnelbear.key; sourceTree = ""; }; - 0E3E0F202108A8CC00B371C1 /* PushReply.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushReply.swift; sourceTree = ""; }; 0E411B992271F90700E0852C /* DNS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DNS.h; sourceTree = ""; }; 0E411B9A2271F90700E0852C /* DNS.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DNS.m; sourceTree = ""; }; 0E411B9F2271FA3300E0852C /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libresolv.tbd; sourceTree = DEVELOPER_DIR; }; 0E411BA12271FA3C00E0852C /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; - 0E48AC622271ADA8009B1A98 /* PacketStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PacketStream.h; sourceTree = ""; }; - 0E48AC632271ADA9009B1A98 /* PacketStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PacketStream.m; sourceTree = ""; }; 0E500EA522493B5B00CAE560 /* tunnelbear.enc.1.key */ = {isa = PBXFileReference; lastKnownFileType = text; path = tunnelbear.enc.1.key; sourceTree = ""; }; - 0E58BF2F22405410006FB157 /* lzoconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lzoconf.h; sourceTree = ""; }; - 0E58BF3022405410006FB157 /* lzodefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lzodefs.h; sourceTree = ""; }; - 0E58BF3122405410006FB157 /* minilzo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = minilzo.h; sourceTree = ""; }; - 0E58BF3222405410006FB157 /* minilzo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = minilzo.c; sourceTree = ""; }; - 0E58BF4922405C2F006FB157 /* StandardLZO.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StandardLZO.m; sourceTree = ""; }; - 0E58BF4F2240F98E006FB157 /* CompressionAlgorithmNative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompressionAlgorithmNative.h; sourceTree = ""; }; - 0E58BF522240FAA6006FB157 /* CompressionAlgorithm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompressionAlgorithm.swift; sourceTree = ""; }; 0E58BF5522411F37006FB157 /* LZO.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LZO.h; sourceTree = ""; }; 0E58BF5822411FEF006FB157 /* LZO.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LZO.m; sourceTree = ""; }; 0E6479DD212EAC96008E6888 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0E6479E0212EACD6008E6888 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 0E749F5E2178885500BB2701 /* OpenVPNSession+PIA.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OpenVPNSession+PIA.swift"; sourceTree = ""; }; 0E749F612178911C00BB2701 /* pia-2048.pem */ = {isa = PBXFileReference; lastKnownFileType = text; path = "pia-2048.pem"; sourceTree = ""; }; 0E85A25B202CCA3D0059E9F9 /* TunnelKitHost.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TunnelKitHost.entitlements; sourceTree = ""; }; 0EA82A232190B220007960EB /* TunnelKitTests-macOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "TunnelKitTests-macOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 0EA82A272190B220007960EB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0EB03E0E2290CF52006D03A0 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; - 0EB03E3E2290D310006D03A0 /* CoreConfiguration+OpenVPN.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CoreConfiguration+OpenVPN.swift"; sourceTree = ""; }; - 0EB03E412291542C006D03A0 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; 0ECC60D72254981A0020BEAC /* ConfigurationError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationError.swift; sourceTree = ""; }; - 0ECE3527212EB7770040F253 /* CryptoContainer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CryptoContainer.swift; sourceTree = ""; }; 0ECEB1132252C8E900E9E551 /* tunnelbear.enc.8.ovpn */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tunnelbear.enc.8.ovpn; sourceTree = ""; }; 0ECEB1142252C8E900E9E551 /* tunnelbear.enc.8.key */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tunnelbear.enc.8.key; sourceTree = ""; }; 0ECEB11A2252CDAD00E9E551 /* tunnelbear.crt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tunnelbear.crt; sourceTree = ""; }; - 0ED9C8632138139000621BA3 /* CompressionFraming.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompressionFraming.swift; sourceTree = ""; }; 0EE2F96D2291636B00F56F49 /* IPv4Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IPv4Settings.swift; sourceTree = ""; }; 0EE2F9702291638600F56F49 /* IPv6Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IPv6Settings.swift; sourceTree = ""; }; 0EE2F973229163C900F56F49 /* Proxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Proxy.swift; sourceTree = ""; }; - 0EE2F97622916A5D00F56F49 /* OpenVPN.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenVPN.swift; sourceTree = ""; }; 0EE2F9792291817300F56F49 /* Errors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = ""; }; 0EE2F9AB2291853D00F56F49 /* Session.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Session.swift; sourceTree = ""; }; - 0EE2F9DE22918DA100F56F49 /* ConnectionStrategy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionStrategy.swift; sourceTree = ""; }; 0EE2F9E022918DA100F56F49 /* NETCPSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NETCPSocket.swift; sourceTree = ""; }; 0EE2F9E122918DA100F56F49 /* NETunnelInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NETunnelInterface.swift; sourceTree = ""; }; 0EE2F9E222918DA100F56F49 /* NWTCPConnectionState+Description.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NWTCPConnectionState+Description.swift"; sourceTree = ""; }; 0EE2F9E322918DA100F56F49 /* NEUDPSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NEUDPSocket.swift; sourceTree = ""; }; 0EE2F9E422918DA100F56F49 /* NWUDPSessionState+Description.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NWUDPSessionState+Description.swift"; sourceTree = ""; }; 0EE2F9E522918DA100F56F49 /* DNSResolver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DNSResolver.swift; sourceTree = ""; }; - 0EE2F9E622918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OpenVPNTunnelProvider+Configuration.swift"; sourceTree = ""; }; 0EE2F9E722918DA100F56F49 /* Keychain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Keychain.swift; sourceTree = ""; }; 0EE2F9E822918DA100F56F49 /* MemoryDestination.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MemoryDestination.swift; sourceTree = ""; }; 0EE2F9E922918DA100F56F49 /* GenericSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GenericSocket.swift; sourceTree = ""; }; - 0EE2F9EA22918DA100F56F49 /* OpenVPNTunnelProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenVPNTunnelProvider.swift; sourceTree = ""; }; 0EE2F9EB22918DA100F56F49 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; - 0EE2F9EC22918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OpenVPNTunnelProvider+Interaction.swift"; sourceTree = ""; }; 0EE2F9ED22918DA100F56F49 /* InterfaceObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InterfaceObserver.swift; sourceTree = ""; }; 0EE2FA0C2291953300F56F49 /* RawPerformanceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RawPerformanceTests.swift; sourceTree = ""; }; 0EE2FA0D2291953300F56F49 /* DataPathPerformanceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataPathPerformanceTests.swift; sourceTree = ""; }; @@ -422,41 +444,21 @@ 0EE2FA1B2291953300F56F49 /* PushTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PushTests.swift; sourceTree = ""; }; 0EE2FA1C2291953300F56F49 /* CompressionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompressionTests.swift; sourceTree = ""; }; 0EE2FA1D2291953300F56F49 /* DataPathEncryptionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataPathEncryptionTests.swift; sourceTree = ""; }; - 0EE3B3E321471C3A0027AB17 /* StaticKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StaticKey.swift; sourceTree = ""; }; - 0EE7A79420F61EDC00B42E6A /* PacketMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PacketMacros.h; sourceTree = ""; }; - 0EE7A79720F6296F00B42E6A /* PacketMacros.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PacketMacros.m; sourceTree = ""; }; - 0EE7A79D20F6488400B42E6A /* DataPathCrypto.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataPathCrypto.h; sourceTree = ""; }; 0EFB902722788511006405E4 /* RoutingTable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoutingTable.h; sourceTree = ""; }; 0EFB902822788511006405E4 /* RoutingTable.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoutingTable.m; sourceTree = ""; }; - 0EFEB42A2006D3C800F81029 /* EncryptionBridge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EncryptionBridge.swift; sourceTree = ""; }; - 0EFEB42B2006D3C800F81029 /* SessionKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionKey.swift; sourceTree = ""; }; - 0EFEB42D2006D3C800F81029 /* MSS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSS.h; sourceTree = ""; }; 0EFEB42E2006D3C800F81029 /* Allocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Allocation.h; sourceTree = ""; }; 0EFEB42F2006D3C800F81029 /* TunnelInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TunnelInterface.swift; sourceTree = ""; }; - 0EFEB4302006D3C800F81029 /* TLSBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TLSBox.m; sourceTree = ""; }; 0EFEB4312006D3C800F81029 /* ZeroingData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZeroingData.m; sourceTree = ""; }; - 0EFEB4322006D3C800F81029 /* CryptoBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CryptoBox.m; sourceTree = ""; }; - 0EFEB4352006D3C800F81029 /* DataPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataPath.h; sourceTree = ""; }; 0EFEB4362006D3C800F81029 /* Errors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Errors.h; sourceTree = ""; }; 0EFEB4372006D3C800F81029 /* SecureRandom.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecureRandom.swift; sourceTree = ""; }; - 0EFEB4382006D3C800F81029 /* ProtocolMacros.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProtocolMacros.swift; sourceTree = ""; }; - 0EFEB4392006D3C800F81029 /* ReplayProtector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplayProtector.h; sourceTree = ""; }; - 0EFEB43A2006D3C800F81029 /* Authenticator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Authenticator.swift; sourceTree = ""; }; 0EFEB43B2006D3C800F81029 /* ZeroingData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZeroingData.swift; sourceTree = ""; }; - 0EFEB43C2006D3C800F81029 /* OpenVPNSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenVPNSession.swift; sourceTree = ""; }; - 0EFEB43D2006D3C800F81029 /* MSS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSS.m; sourceTree = ""; }; - 0EFEB43E2006D3C800F81029 /* Packet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Packet.swift; sourceTree = ""; }; - 0EFEB4402006D3C800F81029 /* CryptoBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoBox.h; sourceTree = ""; }; 0EFEB4412006D3C800F81029 /* ZeroingData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZeroingData.h; sourceTree = ""; }; 0EFEB4432006D3C800F81029 /* Data+Manipulation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Data+Manipulation.swift"; sourceTree = ""; }; - 0EFEB4442006D3C800F81029 /* TLSBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TLSBox.h; sourceTree = ""; }; 0EFEB4452006D3C800F81029 /* IOInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IOInterface.swift; sourceTree = ""; }; 0EFEB4462006D3C800F81029 /* Allocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Allocation.m; sourceTree = ""; }; - 0EFEB4482006D3C800F81029 /* ReplayProtector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReplayProtector.m; sourceTree = ""; }; 0EFEB4492006D3C800F81029 /* LinkInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinkInterface.swift; sourceTree = ""; }; 0EFEB44A2006D3C800F81029 /* CoreConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreConfiguration.swift; sourceTree = ""; }; 0EFEB44B2006D3C800F81029 /* Errors.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Errors.m; sourceTree = ""; }; - 0EFEB44C2006D3C800F81029 /* DataPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DataPath.m; sourceTree = ""; }; 276657B3FED3840178C53D6B /* Pods_TunnelKit_TunnelKit_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TunnelKit_TunnelKit_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2DD764A8C3908CB48A442295 /* Pods-TunnelKit-TunnelKitTests-macOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TunnelKit-TunnelKitTests-macOS.release.xcconfig"; path = "Target Support Files/Pods-TunnelKit-TunnelKitTests-macOS/Pods-TunnelKit-TunnelKitTests-macOS.release.xcconfig"; sourceTree = ""; }; 33C00B882D0DF7C28257630B /* Pods-TunnelKit-TunnelKit-macOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TunnelKit-TunnelKit-macOS.debug.xcconfig"; path = "Target Support Files/Pods-TunnelKit-TunnelKit-macOS/Pods-TunnelKit-TunnelKit-macOS.debug.xcconfig"; sourceTree = ""; }; @@ -593,25 +595,12 @@ children = ( 0EE2F9DD22918DA100F56F49 /* AppExtension */, 0EFEB4292006D3C800F81029 /* Core */, - 0E58BEDC2240521F006FB157 /* LZO */, - 0EB03E0A2290A338006D03A0 /* OpenVPN */, + 0E23B41922982AF800304C30 /* Extra */, + 0E23B3E022982AF800304C30 /* Protocols */, ); path = Sources; sourceTree = ""; }; - 0E23B3CE2297190E00304C30 /* AppExtension */ = { - isa = PBXGroup; - children = ( - 0EE2F9DE22918DA100F56F49 /* ConnectionStrategy.swift */, - 0E23B3CF2297192900304C30 /* NETCPLink.swift */, - 0E23B3D22297193000304C30 /* NEUDPLink.swift */, - 0EE2F9EA22918DA100F56F49 /* OpenVPNTunnelProvider.swift */, - 0EE2F9E622918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift */, - 0EE2F9EC22918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift */, - ); - path = AppExtension; - sourceTree = ""; - }; 0E23B3D52297451700304C30 /* OpenVPN */ = { isa = PBXGroup; children = ( @@ -652,22 +641,107 @@ path = Core; sourceTree = ""; }; - 0E58BEDC2240521F006FB157 /* LZO */ = { + 0E23B3E022982AF800304C30 /* Protocols */ = { isa = PBXGroup; children = ( - 0E58BF4722405734006FB157 /* lib */, - 0E58BF4922405C2F006FB157 /* StandardLZO.m */, + 0E23B3E122982AF800304C30 /* OpenVPN */, + ); + path = Protocols; + sourceTree = ""; + }; + 0E23B3E122982AF800304C30 /* OpenVPN */ = { + isa = PBXGroup; + children = ( + 0E23B3F722982AF800304C30 /* AppExtension */, + 0E23B40422982AF800304C30 /* Authenticator.swift */, + 0E23B40222982AF800304C30 /* CompressionAlgorithm.swift */, + 0E23B3F422982AF800304C30 /* CompressionAlgorithmNative.h */, + 0E23B40522982AF800304C30 /* CompressionFraming.swift */, + 0E23B40D22982AF800304C30 /* CompressionFramingNative.h */, + 0E23B41722982AF800304C30 /* Configuration.swift */, + 0E23B40E22982AF800304C30 /* ConfigurationParser.swift */, + 0E23B3E922982AF800304C30 /* ControlChannel.swift */, + 0E23B3E622982AF800304C30 /* ControlChannelSerializer.swift */, + 0E23B3ED22982AF800304C30 /* ControlPacket.h */, + 0E23B41122982AF800304C30 /* ControlPacket.m */, + 0E23B3EA22982AF800304C30 /* CoreConfiguration+OpenVPN.swift */, + 0E23B40122982AF800304C30 /* Crypto.h */, + 0E23B40C22982AF800304C30 /* CryptoAEAD.h */, + 0E23B3E322982AF800304C30 /* CryptoAEAD.m */, + 0E23B41022982AF800304C30 /* CryptoBox.h */, + 0E23B3EE22982AF800304C30 /* CryptoBox.m */, + 0E23B3E222982AF800304C30 /* CryptoCBC.h */, + 0E23B40622982AF800304C30 /* CryptoCBC.m */, + 0E23B3F122982AF800304C30 /* CryptoContainer.swift */, + 0E23B3E422982AF800304C30 /* CryptoCTR.h */, + 0E23B40B22982AF800304C30 /* CryptoCTR.m */, + 0E23B41522982AF800304C30 /* CryptoMacros.h */, + 0E23B3F622982AF800304C30 /* DataPath.h */, + 0E23B41822982AF800304C30 /* DataPath.m */, + 0E23B3F222982AF800304C30 /* DataPathCrypto.h */, + 0E23B40322982AF800304C30 /* EncryptionBridge.swift */, + 0E23B41222982AF800304C30 /* module.modulemap */, + 0E23B3E722982AF800304C30 /* MSS.h */, + 0E23B40A22982AF800304C30 /* MSS.m */, + 0E23B3F322982AF800304C30 /* OpenVPN.swift */, + 0E23B3EC22982AF800304C30 /* OpenVPNError.swift */, + 0E23B3EF22982AF800304C30 /* OpenVPNSession.swift */, + 0E23B3F022982AF800304C30 /* OpenVPNSession+PIA.swift */, + 0E23B40F22982AF800304C30 /* Packet.swift */, + 0E23B40922982AF800304C30 /* PacketMacros.h */, + 0E23B3E822982AF800304C30 /* PacketMacros.m */, + 0E23B3FE22982AF800304C30 /* PacketStream.h */, + 0E23B41622982AF800304C30 /* PacketStream.m */, + 0E23B3FF22982AF800304C30 /* ProtocolMacros.swift */, + 0E23B40822982AF800304C30 /* PushReply.swift */, + 0E23B40022982AF800304C30 /* ReplayProtector.h */, + 0E23B41422982AF800304C30 /* ReplayProtector.m */, + 0E23B3E522982AF800304C30 /* SessionKey.swift */, + 0E23B40722982AF800304C30 /* StaticKey.swift */, + 0E23B41322982AF800304C30 /* TLSBox.h */, + 0E23B3EB22982AF800304C30 /* TLSBox.m */, + 0E23B3F522982AF800304C30 /* TLSWrap.swift */, + ); + path = OpenVPN; + sourceTree = ""; + }; + 0E23B3F722982AF800304C30 /* AppExtension */ = { + isa = PBXGroup; + children = ( + 0E23B3F822982AF800304C30 /* OpenVPNTunnelProvider+Interaction.swift */, + 0E23B3F922982AF800304C30 /* NEUDPLink.swift */, + 0E23B3FA22982AF800304C30 /* ConnectionStrategy.swift */, + 0E23B3FB22982AF800304C30 /* OpenVPNTunnelProvider+Configuration.swift */, + 0E23B3FC22982AF800304C30 /* NETCPLink.swift */, + 0E23B3FD22982AF800304C30 /* OpenVPNTunnelProvider.swift */, + ); + path = AppExtension; + sourceTree = ""; + }; + 0E23B41922982AF800304C30 /* Extra */ = { + isa = PBXGroup; + children = ( + 0E23B41A22982AF800304C30 /* LZO */, + ); + path = Extra; + sourceTree = ""; + }; + 0E23B41A22982AF800304C30 /* LZO */ = { + isa = PBXGroup; + children = ( + 0E23B41C22982AF800304C30 /* lib */, + 0E23B41B22982AF800304C30 /* StandardLZO.m */, ); path = LZO; sourceTree = ""; }; - 0E58BF4722405734006FB157 /* lib */ = { + 0E23B41C22982AF800304C30 /* lib */ = { isa = PBXGroup; children = ( - 0E58BF2F22405410006FB157 /* lzoconf.h */, - 0E58BF3022405410006FB157 /* lzodefs.h */, - 0E58BF3222405410006FB157 /* minilzo.c */, - 0E58BF3122405410006FB157 /* minilzo.h */, + 0E23B41E22982AF800304C30 /* lzoconf.h */, + 0E23B41D22982AF800304C30 /* lzodefs.h */, + 0E23B42422982AF800304C30 /* minilzo.c */, + 0E23B42022982AF800304C30 /* minilzo.h */, ); path = lib; sourceTree = ""; @@ -704,62 +778,6 @@ path = "TunnelKitTests-iOS"; sourceTree = ""; }; - 0EB03E0A2290A338006D03A0 /* OpenVPN */ = { - isa = PBXGroup; - children = ( - 0E23B3CE2297190E00304C30 /* AppExtension */, - 0EFEB43A2006D3C800F81029 /* Authenticator.swift */, - 0E58BF522240FAA6006FB157 /* CompressionAlgorithm.swift */, - 0E58BF4F2240F98E006FB157 /* CompressionAlgorithmNative.h */, - 0ED9C8632138139000621BA3 /* CompressionFraming.swift */, - 0E245D6B2137F73600B012A2 /* CompressionFramingNative.h */, - 0E0C2124212ED29D008AB282 /* Configuration.swift */, - 0E011F872196E2AB00BA59EE /* ConfigurationParser.swift */, - 0E12B2A721456C0200B4BAE9 /* ControlChannel.swift */, - 0E12B2AA2145E01700B4BAE9 /* ControlChannelSerializer.swift */, - 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */, - 0E39BCE7214B2AB60035E9DE /* ControlPacket.m */, - 0EB03E3E2290D310006D03A0 /* CoreConfiguration+OpenVPN.swift */, - 0E07596A20EF79AB00F38FD8 /* Crypto.h */, - 0E07597C20F0060E00F38FD8 /* CryptoAEAD.h */, - 0E07597D20F0060E00F38FD8 /* CryptoAEAD.m */, - 0EFEB4402006D3C800F81029 /* CryptoBox.h */, - 0EFEB4322006D3C800F81029 /* CryptoBox.m */, - 0E07596D20EF79B400F38FD8 /* CryptoCBC.h */, - 0E07595C20EF6D1400F38FD8 /* CryptoCBC.m */, - 0ECE3527212EB7770040F253 /* CryptoContainer.swift */, - 0E3B15C52152B05E00984B17 /* CryptoCTR.h */, - 0E3B15C62152B05E00984B17 /* CryptoCTR.m */, - 0E07596120EF733F00F38FD8 /* CryptoMacros.h */, - 0EFEB4352006D3C800F81029 /* DataPath.h */, - 0EFEB44C2006D3C800F81029 /* DataPath.m */, - 0EE7A79D20F6488400B42E6A /* DataPathCrypto.h */, - 0EFEB42A2006D3C800F81029 /* EncryptionBridge.swift */, - 0EB03E412291542C006D03A0 /* module.modulemap */, - 0EFEB42D2006D3C800F81029 /* MSS.h */, - 0EFEB43D2006D3C800F81029 /* MSS.m */, - 0EE2F97622916A5D00F56F49 /* OpenVPN.swift */, - 0E0C2123212ED29D008AB282 /* OpenVPNError.swift */, - 0EFEB43C2006D3C800F81029 /* OpenVPNSession.swift */, - 0E749F5E2178885500BB2701 /* OpenVPNSession+PIA.swift */, - 0EFEB43E2006D3C800F81029 /* Packet.swift */, - 0EE7A79420F61EDC00B42E6A /* PacketMacros.h */, - 0EE7A79720F6296F00B42E6A /* PacketMacros.m */, - 0E48AC622271ADA8009B1A98 /* PacketStream.h */, - 0E48AC632271ADA9009B1A98 /* PacketStream.m */, - 0EFEB4382006D3C800F81029 /* ProtocolMacros.swift */, - 0E3E0F202108A8CC00B371C1 /* PushReply.swift */, - 0EFEB4392006D3C800F81029 /* ReplayProtector.h */, - 0EFEB4482006D3C800F81029 /* ReplayProtector.m */, - 0EFEB42B2006D3C800F81029 /* SessionKey.swift */, - 0EE3B3E321471C3A0027AB17 /* StaticKey.swift */, - 0EFEB4442006D3C800F81029 /* TLSBox.h */, - 0EFEB4302006D3C800F81029 /* TLSBox.m */, - 0E041D082152E6FE0025FE3C /* TLSWrap.swift */, - ); - path = OpenVPN; - sourceTree = ""; - }; 0EE2F9DD22918DA100F56F49 /* AppExtension */ = { isa = PBXGroup; children = ( @@ -863,30 +881,31 @@ buildActionMask = 2147483647; files = ( 0E58BF5622411F3D006FB157 /* LZO.h in Headers */, - 0EF5CF262141E142004FF1BD /* PacketMacros.h in Headers */, - 0EFEB4642006D3C800F81029 /* ReplayProtector.h in Headers */, + 0E23B48722982AF800304C30 /* CryptoMacros.h in Headers */, + 0E23B44922982AF800304C30 /* CompressionAlgorithmNative.h in Headers */, 0EFEB4612006D3C800F81029 /* Errors.h in Headers */, - 0E48AC642271ADA9009B1A98 /* PacketStream.h in Headers */, - 0E58BF3722405410006FB157 /* minilzo.h in Headers */, - 0E07596E20EF79B400F38FD8 /* CryptoCBC.h in Headers */, - 0E58BF3522405410006FB157 /* lzodefs.h in Headers */, - 0E58BF502240F98F006FB157 /* CompressionAlgorithmNative.h in Headers */, + 0E23B45B22982AF800304C30 /* PacketStream.h in Headers */, + 0E23B42F22982AF800304C30 /* MSS.h in Headers */, + 0E23B42522982AF800304C30 /* CryptoCBC.h in Headers */, + 0E23B45F22982AF800304C30 /* ReplayProtector.h in Headers */, + 0E23B44D22982AF800304C30 /* DataPath.h in Headers */, + 0E23B46122982AF800304C30 /* Crypto.h in Headers */, 0E0B20402278A85C007A3CB9 /* RoutingTableEntry.h in Headers */, - 0E07596320EF733F00F38FD8 /* CryptoMacros.h in Headers */, - 0EFEB46E2006D3C800F81029 /* TLSBox.h in Headers */, 0E411B9B2271F90700E0852C /* DNS.h in Headers */, - 0E07596B20EF79AB00F38FD8 /* Crypto.h in Headers */, - 0EFEB46B2006D3C800F81029 /* CryptoBox.h in Headers */, + 0E23B47F22982AF800304C30 /* CryptoBox.h in Headers */, + 0E23B44522982AF800304C30 /* DataPathCrypto.h in Headers */, + 0E23B49322982AF800304C30 /* lzoconf.h in Headers */, 0EFEB4592006D3C800F81029 /* Allocation.h in Headers */, + 0E23B47122982AF800304C30 /* PacketMacros.h in Headers */, + 0E23B43B22982AF800304C30 /* ControlPacket.h in Headers */, 0EFB902922788511006405E4 /* RoutingTable.h in Headers */, - 0EFEB4582006D3C800F81029 /* MSS.h in Headers */, - 0E58BF3322405410006FB157 /* lzoconf.h in Headers */, - 0E245D6C2137F73600B012A2 /* CompressionFramingNative.h in Headers */, - 0E3B15C72152B05E00984B17 /* CryptoCTR.h in Headers */, - 0EFEB4602006D3C800F81029 /* DataPath.h in Headers */, - 0E39BCE8214B2AB60035E9DE /* ControlPacket.h in Headers */, - 0E07597E20F0060E00F38FD8 /* CryptoAEAD.h in Headers */, 0EFEB46C2006D3C800F81029 /* ZeroingData.h in Headers */, + 0E23B47922982AF800304C30 /* CompressionFramingNative.h in Headers */, + 0E23B49722982AF800304C30 /* minilzo.h in Headers */, + 0E23B47722982AF800304C30 /* CryptoAEAD.h in Headers */, + 0E23B48322982AF800304C30 /* TLSBox.h in Headers */, + 0E23B49122982AF800304C30 /* lzodefs.h in Headers */, + 0E23B42922982AF800304C30 /* CryptoCTR.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -895,30 +914,31 @@ buildActionMask = 2147483647; files = ( 0E58BF5722411F3E006FB157 /* LZO.h in Headers */, - 0EF5CF272141E15B004FF1BD /* PacketMacros.h in Headers */, - 0EEC49E620B5F7F6008FEB91 /* MSS.h in Headers */, + 0E23B48822982AF800304C30 /* CryptoMacros.h in Headers */, + 0E23B44A22982AF800304C30 /* CompressionAlgorithmNative.h in Headers */, 0EEC49E520B5F7F6008FEB91 /* Errors.h in Headers */, - 0E48AC652271ADA9009B1A98 /* PacketStream.h in Headers */, - 0E58BF3822405410006FB157 /* minilzo.h in Headers */, - 0E07596F20EF79B400F38FD8 /* CryptoCBC.h in Headers */, - 0E58BF3622405410006FB157 /* lzodefs.h in Headers */, - 0E58BF512240F98F006FB157 /* CompressionAlgorithmNative.h in Headers */, + 0E23B45C22982AF800304C30 /* PacketStream.h in Headers */, + 0E23B43022982AF800304C30 /* MSS.h in Headers */, + 0E23B42622982AF800304C30 /* CryptoCBC.h in Headers */, + 0E23B46022982AF800304C30 /* ReplayProtector.h in Headers */, + 0E23B44E22982AF800304C30 /* DataPath.h in Headers */, + 0E23B46222982AF800304C30 /* Crypto.h in Headers */, 0E0B20412278A85C007A3CB9 /* RoutingTableEntry.h in Headers */, - 0E07596420EF733F00F38FD8 /* CryptoMacros.h in Headers */, 0EEC49EA20B5F7F6008FEB91 /* ZeroingData.h in Headers */, + 0E23B48022982AF800304C30 /* CryptoBox.h in Headers */, + 0E23B44622982AF800304C30 /* DataPathCrypto.h in Headers */, + 0E23B49422982AF800304C30 /* lzoconf.h in Headers */, 0E411B9C2271F90700E0852C /* DNS.h in Headers */, - 0E07596C20EF79AB00F38FD8 /* Crypto.h in Headers */, + 0E23B47222982AF800304C30 /* PacketMacros.h in Headers */, + 0E23B43C22982AF800304C30 /* ControlPacket.h in Headers */, 0EEC49E120B5F7EA008FEB91 /* Allocation.h in Headers */, - 0EEC49E320B5F7F6008FEB91 /* DataPath.h in Headers */, 0EFB902A22788511006405E4 /* RoutingTable.h in Headers */, - 0EF5CF282141E183004FF1BD /* CompressionFramingNative.h in Headers */, - 0E58BF3422405410006FB157 /* lzoconf.h in Headers */, - 0EEC49E820B5F7F6008FEB91 /* ReplayProtector.h in Headers */, - 0E3B15C82152B05E00984B17 /* CryptoCTR.h in Headers */, - 0EEC49E920B5F7F6008FEB91 /* TLSBox.h in Headers */, - 0E39BCE9214B2AB60035E9DE /* ControlPacket.h in Headers */, - 0E07597F20F0060E00F38FD8 /* CryptoAEAD.h in Headers */, - 0EEC49E220B5F7F6008FEB91 /* CryptoBox.h in Headers */, + 0E23B47A22982AF800304C30 /* CompressionFramingNative.h in Headers */, + 0E23B49822982AF800304C30 /* minilzo.h in Headers */, + 0E23B47822982AF800304C30 /* CryptoAEAD.h in Headers */, + 0E23B48422982AF800304C30 /* TLSBox.h in Headers */, + 0E23B49222982AF800304C30 /* lzodefs.h in Headers */, + 0E23B42A22982AF800304C30 /* CryptoCTR.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1318,80 +1338,80 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0E58BF4C22405C2F006FB157 /* StandardLZO.m in Sources */, 0EE2F974229163C900F56F49 /* Proxy.swift in Sources */, 0EFEB4732006D3C800F81029 /* LinkInterface.swift in Sources */, - 0EFEB4652006D3C800F81029 /* Authenticator.swift in Sources */, + 0E23B48922982AF800304C30 /* PacketStream.m in Sources */, 0E23B3DE229749C600304C30 /* LinkProducer.swift in Sources */, + 0E23B42722982AF800304C30 /* CryptoAEAD.m in Sources */, 0EE2F9F222918DA100F56F49 /* NETunnelInterface.swift in Sources */, + 0E23B46722982AF800304C30 /* Authenticator.swift in Sources */, + 0E23B43922982AF800304C30 /* OpenVPNError.swift in Sources */, + 0E23B44F22982AF800304C30 /* OpenVPNTunnelProvider+Interaction.swift in Sources */, + 0E23B46D22982AF800304C30 /* StaticKey.swift in Sources */, + 0E23B49F22982AF800304C30 /* minilzo.c in Sources */, 0EE2F9FE22918DA100F56F49 /* Keychain.swift in Sources */, - 0EE7A79820F6296F00B42E6A /* PacketMacros.m in Sources */, - 0EFEB4562006D3C800F81029 /* SessionKey.swift in Sources */, + 0E23B45122982AF800304C30 /* NEUDPLink.swift in Sources */, 0E0B20422278A85C007A3CB9 /* RoutingTableEntry.m in Sources */, + 0E23B43D22982AF800304C30 /* CryptoBox.m in Sources */, + 0E23B44B22982AF800304C30 /* TLSWrap.swift in Sources */, + 0E23B47522982AF800304C30 /* CryptoCTR.m in Sources */, + 0E23B47D22982AF800304C30 /* Packet.swift in Sources */, + 0E23B46322982AF800304C30 /* CompressionAlgorithm.swift in Sources */, + 0E23B48D22982AF800304C30 /* DataPath.m in Sources */, 0E58BF5922411FEF006FB157 /* LZO.m in Sources */, - 0E23B3D32297193000304C30 /* NEUDPLink.swift in Sources */, 0E12B29E21449ADB00B4BAE9 /* NSRegularExpression+Shortcuts.swift in Sources */, 0EE2F9F822918DA100F56F49 /* NWUDPSessionState+Description.swift in Sources */, - 0E749F5F2178885500BB2701 /* OpenVPNSession+PIA.swift in Sources */, - 0EE3B3E421471C3A0027AB17 /* StaticKey.swift in Sources */, 0EE2F9AC2291853D00F56F49 /* Session.swift in Sources */, + 0E23B48122982AF800304C30 /* ControlPacket.m in Sources */, 0EFEB4622006D3C800F81029 /* SecureRandom.swift in Sources */, - 0EFEB45D2006D3C800F81029 /* CryptoBox.m in Sources */, - 0E3B15C92152B05E00984B17 /* CryptoCTR.m in Sources */, 0E011F7D2196D97200BA59EE /* EndpointProtocol.swift in Sources */, + 0E23B46922982AF800304C30 /* CompressionFraming.swift in Sources */, + 0E23B47B22982AF800304C30 /* ConfigurationParser.swift in Sources */, + 0E23B46F22982AF800304C30 /* PushReply.swift in Sources */, + 0E23B45522982AF800304C30 /* OpenVPNTunnelProvider+Configuration.swift in Sources */, 0EE2F9F022918DA100F56F49 /* NETCPSocket.swift in Sources */, - 0E0C2125212ED29D008AB282 /* OpenVPNError.swift in Sources */, - 0E12B2A821456C0200B4BAE9 /* ControlChannel.swift in Sources */, - 0EFEB4552006D3C800F81029 /* EncryptionBridge.swift in Sources */, + 0E23B48B22982AF800304C30 /* Configuration.swift in Sources */, + 0E23B43122982AF800304C30 /* PacketMacros.m in Sources */, 0EFEB45C2006D3C800F81029 /* ZeroingData.m in Sources */, 0EE2F9712291638600F56F49 /* IPv6Settings.swift in Sources */, + 0E23B42B22982AF800304C30 /* SessionKey.swift in Sources */, 0EE2F97A2291817300F56F49 /* Errors.swift in Sources */, - 0EFEB4632006D3C800F81029 /* ProtocolMacros.swift in Sources */, 0EFB902B22788512006405E4 /* RoutingTable.m in Sources */, + 0E23B43522982AF800304C30 /* CoreConfiguration+OpenVPN.swift in Sources */, 0EFEB46D2006D3C800F81029 /* Data+Manipulation.swift in Sources */, + 0E23B46B22982AF800304C30 /* CryptoCBC.m in Sources */, + 0E23B46522982AF800304C30 /* EncryptionBridge.swift in Sources */, 0EE2F9F422918DA100F56F49 /* NWTCPConnectionState+Description.swift in Sources */, - 0ECE3528212EB7770040F253 /* CryptoContainer.swift in Sources */, 0EFEB4742006D3C800F81029 /* CoreConfiguration.swift in Sources */, - 0E07595F20EF6D1400F38FD8 /* CryptoCBC.m in Sources */, + 0E23B48F22982AF800304C30 /* StandardLZO.m in Sources */, 0EFEB46F2006D3C800F81029 /* IOInterface.swift in Sources */, - 0E07598020F0060E00F38FD8 /* CryptoAEAD.m in Sources */, - 0E011F882196E2AB00BA59EE /* ConfigurationParser.swift in Sources */, 0EE2FA0222918DA100F56F49 /* GenericSocket.swift in Sources */, - 0EE2FA0822918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift in Sources */, - 0EE2FA0422918DA100F56F49 /* OpenVPNTunnelProvider.swift in Sources */, 0EE2F9FA22918DA100F56F49 /* DNSResolver.swift in Sources */, + 0E23B43322982AF800304C30 /* ControlChannel.swift in Sources */, + 0E23B48522982AF800304C30 /* ReplayProtector.m in Sources */, + 0E23B44122982AF800304C30 /* OpenVPNSession+PIA.swift in Sources */, + 0E23B42D22982AF800304C30 /* ControlChannelSerializer.swift in Sources */, 0EE2F9F622918DA100F56F49 /* NEUDPSocket.swift in Sources */, - 0E39BCEA214B2AB60035E9DE /* ControlPacket.m in Sources */, 0EE2F96E2291636B00F56F49 /* IPv4Settings.swift in Sources */, - 0E12B2AB2145E01700B4BAE9 /* ControlChannelSerializer.swift in Sources */, 0EFEB4662006D3C800F81029 /* ZeroingData.swift in Sources */, - 0E23B3D02297192900304C30 /* NETCPLink.swift in Sources */, - 0EFEB4682006D3C800F81029 /* MSS.m in Sources */, 0EE2FA0622918DA100F56F49 /* Utils.swift in Sources */, - 0E48AC662271ADA9009B1A98 /* PacketStream.m in Sources */, - 0EE2F97722916A5D00F56F49 /* OpenVPN.swift in Sources */, + 0E23B44322982AF800304C30 /* CryptoContainer.swift in Sources */, 0E411B9D2271F90700E0852C /* DNS.m in Sources */, - 0EFEB45B2006D3C800F81029 /* TLSBox.m in Sources */, - 0E58BF3922405410006FB157 /* minilzo.c in Sources */, - 0EE2F9FC22918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift in Sources */, + 0E23B43722982AF800304C30 /* TLSBox.m in Sources */, 0EFEB4702006D3C800F81029 /* Allocation.m in Sources */, - 0E041D092152E6FE0025FE3C /* TLSWrap.swift in Sources */, - 0EFEB4672006D3C800F81029 /* OpenVPNSession.swift in Sources */, - 0ED9C8642138139000621BA3 /* CompressionFraming.swift in Sources */, - 0EFEB4722006D3C800F81029 /* ReplayProtector.m in Sources */, - 0E3E0F212108A8CC00B371C1 /* PushReply.swift in Sources */, 0EE2FA0A22918DA100F56F49 /* InterfaceObserver.swift in Sources */, + 0E23B43F22982AF800304C30 /* OpenVPNSession.swift in Sources */, + 0E23B44722982AF800304C30 /* OpenVPN.swift in Sources */, 0ECC60D82254981A0020BEAC /* ConfigurationError.swift in Sources */, 0EFEB4752006D3C800F81029 /* Errors.m in Sources */, - 0E58BF532240FAA6006FB157 /* CompressionAlgorithm.swift in Sources */, - 0EB03E3F2290D310006D03A0 /* CoreConfiguration+OpenVPN.swift in Sources */, 0E12B2A521454F7F00B4BAE9 /* BidirectionalState.swift in Sources */, - 0EFEB4762006D3C800F81029 /* DataPath.m in Sources */, - 0E0C2127212ED29D008AB282 /* Configuration.swift in Sources */, - 0EE2F9EE22918DA100F56F49 /* ConnectionStrategy.swift in Sources */, - 0EFEB4692006D3C800F81029 /* Packet.swift in Sources */, + 0E23B45722982AF800304C30 /* NETCPLink.swift in Sources */, + 0E23B45322982AF800304C30 /* ConnectionStrategy.swift in Sources */, 0E011F7A2196D93600BA59EE /* SocketType.swift in Sources */, + 0E23B45922982AF800304C30 /* OpenVPNTunnelProvider.swift in Sources */, 0EFEB45A2006D3C800F81029 /* TunnelInterface.swift in Sources */, + 0E23B47322982AF800304C30 /* MSS.m in Sources */, + 0E23B45D22982AF800304C30 /* ProtocolMacros.swift in Sources */, 0EE2FA0022918DA100F56F49 /* MemoryDestination.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1400,80 +1420,80 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0E58BF4D22405C2F006FB157 /* StandardLZO.m in Sources */, 0EE2F975229163C900F56F49 /* Proxy.swift in Sources */, 0EFEB4A12006D7F300F81029 /* LinkInterface.swift in Sources */, - 0EE7A79920F6296F00B42E6A /* PacketMacros.m in Sources */, + 0E23B48A22982AF800304C30 /* PacketStream.m in Sources */, 0E23B3DF229749C600304C30 /* LinkProducer.swift in Sources */, + 0E23B42822982AF800304C30 /* CryptoAEAD.m in Sources */, 0EE2F9F322918DA100F56F49 /* NETunnelInterface.swift in Sources */, + 0E23B46822982AF800304C30 /* Authenticator.swift in Sources */, + 0E23B43A22982AF800304C30 /* OpenVPNError.swift in Sources */, + 0E23B45022982AF800304C30 /* OpenVPNTunnelProvider+Interaction.swift in Sources */, + 0E23B46E22982AF800304C30 /* StaticKey.swift in Sources */, + 0E23B4A022982AF800304C30 /* minilzo.c in Sources */, 0EE2F9FF22918DA100F56F49 /* Keychain.swift in Sources */, + 0E23B45222982AF800304C30 /* NEUDPLink.swift in Sources */, 0E0B20432278A85C007A3CB9 /* RoutingTableEntry.m in Sources */, + 0E23B43E22982AF800304C30 /* CryptoBox.m in Sources */, + 0E23B44C22982AF800304C30 /* TLSWrap.swift in Sources */, + 0E23B47622982AF800304C30 /* CryptoCTR.m in Sources */, + 0E23B47E22982AF800304C30 /* Packet.swift in Sources */, + 0E23B46422982AF800304C30 /* CompressionAlgorithm.swift in Sources */, + 0E23B48E22982AF800304C30 /* DataPath.m in Sources */, 0E58BF5A22411FEF006FB157 /* LZO.m in Sources */, 0E12B29F21449ADB00B4BAE9 /* NSRegularExpression+Shortcuts.swift in Sources */, - 0EFEB4A02006D7F300F81029 /* ReplayProtector.m in Sources */, - 0E23B3D42297193000304C30 /* NEUDPLink.swift in Sources */, - 0E749F602178885500BB2701 /* OpenVPNSession+PIA.swift in Sources */, 0EE2F9F922918DA100F56F49 /* NWUDPSessionState+Description.swift in Sources */, - 0EFEB4992006D7F300F81029 /* OpenVPNSession.swift in Sources */, - 0EE3B3E521471C3A0027AB17 /* StaticKey.swift in Sources */, 0EE2F9AD2291853D00F56F49 /* Session.swift in Sources */, - 0EFEB4962006D7F300F81029 /* ProtocolMacros.swift in Sources */, - 0E3B15CA2152B05E00984B17 /* CryptoCTR.m in Sources */, + 0E23B48222982AF800304C30 /* ControlPacket.m in Sources */, 0E011F7E2196D97200BA59EE /* EndpointProtocol.swift in Sources */, - 0E0C2126212ED29D008AB282 /* OpenVPNError.swift in Sources */, 0EE2F9F122918DA100F56F49 /* NETCPSocket.swift in Sources */, - 0E12B2A921456C0200B4BAE9 /* ControlChannel.swift in Sources */, + 0E23B46A22982AF800304C30 /* CompressionFraming.swift in Sources */, + 0E23B47C22982AF800304C30 /* ConfigurationParser.swift in Sources */, + 0E23B47022982AF800304C30 /* PushReply.swift in Sources */, + 0E23B45622982AF800304C30 /* OpenVPNTunnelProvider+Configuration.swift in Sources */, 0EFEB4982006D7F300F81029 /* ZeroingData.swift in Sources */, + 0E23B48C22982AF800304C30 /* Configuration.swift in Sources */, + 0E23B43222982AF800304C30 /* PacketMacros.m in Sources */, 0EFEB4A32006D7F300F81029 /* Errors.m in Sources */, 0EFEB4A22006D7F300F81029 /* CoreConfiguration.swift in Sources */, + 0E23B42C22982AF800304C30 /* SessionKey.swift in Sources */, 0EE2F9722291638600F56F49 /* IPv6Settings.swift in Sources */, 0EE2F97B2291817300F56F49 /* Errors.swift in Sources */, + 0E23B43622982AF800304C30 /* CoreConfiguration+OpenVPN.swift in Sources */, 0EFB902C22788512006405E4 /* RoutingTable.m in Sources */, + 0E23B46C22982AF800304C30 /* CryptoCBC.m in Sources */, + 0E23B46622982AF800304C30 /* EncryptionBridge.swift in Sources */, 0EFEB4952006D7F300F81029 /* SecureRandom.swift in Sources */, - 0EFEB49A2006D7F300F81029 /* MSS.m in Sources */, 0EE2F9F522918DA100F56F49 /* NWTCPConnectionState+Description.swift in Sources */, - 0ECE352A212EB88E0040F253 /* CryptoContainer.swift in Sources */, - 0EFEB48D2006D7F300F81029 /* EncryptionBridge.swift in Sources */, + 0E23B49022982AF800304C30 /* StandardLZO.m in Sources */, 0EFEB4922006D7F300F81029 /* ZeroingData.m in Sources */, - 0E07596020EF6D1400F38FD8 /* CryptoCBC.m in Sources */, - 0EFEB4932006D7F300F81029 /* CryptoBox.m in Sources */, - 0E011F892196E2AB00BA59EE /* ConfigurationParser.swift in Sources */, 0EE2FA0322918DA100F56F49 /* GenericSocket.swift in Sources */, - 0EE2FA0922918DA100F56F49 /* OpenVPNTunnelProvider+Interaction.swift in Sources */, - 0EE2FA0522918DA100F56F49 /* OpenVPNTunnelProvider.swift in Sources */, 0EE2F9FB22918DA100F56F49 /* DNSResolver.swift in Sources */, + 0E23B43422982AF800304C30 /* ControlChannel.swift in Sources */, + 0E23B48622982AF800304C30 /* ReplayProtector.m in Sources */, + 0E23B44222982AF800304C30 /* OpenVPNSession+PIA.swift in Sources */, + 0E23B42E22982AF800304C30 /* ControlChannelSerializer.swift in Sources */, 0EE2F9F722918DA100F56F49 /* NEUDPSocket.swift in Sources */, - 0E39BCEB214B2AB60035E9DE /* ControlPacket.m in Sources */, 0EE2F96F2291636B00F56F49 /* IPv4Settings.swift in Sources */, - 0E12B2AC2145E01700B4BAE9 /* ControlChannelSerializer.swift in Sources */, - 0E07598120F0060E00F38FD8 /* CryptoAEAD.m in Sources */, - 0E23B3D12297192900304C30 /* NETCPLink.swift in Sources */, 0EFEB49C2006D7F300F81029 /* Data+Manipulation.swift in Sources */, 0EE2FA0722918DA100F56F49 /* Utils.swift in Sources */, - 0E48AC672271ADA9009B1A98 /* PacketStream.m in Sources */, - 0EE2F97822916A5D00F56F49 /* OpenVPN.swift in Sources */, + 0E23B44422982AF800304C30 /* CryptoContainer.swift in Sources */, 0E411B9E2271F90700E0852C /* DNS.m in Sources */, + 0E23B43822982AF800304C30 /* TLSBox.m in Sources */, 0EFEB4902006D7F300F81029 /* TunnelInterface.swift in Sources */, 0EFEB49E2006D7F300F81029 /* Allocation.m in Sources */, - 0EE2F9FD22918DA100F56F49 /* OpenVPNTunnelProvider+Configuration.swift in Sources */, - 0E58BF3A22405410006FB157 /* minilzo.c in Sources */, - 0E041D0A2152E6FE0025FE3C /* TLSWrap.swift in Sources */, - 0EFEB48E2006D7F300F81029 /* SessionKey.swift in Sources */, - 0ED9C8652138139000621BA3 /* CompressionFraming.swift in Sources */, - 0EFEB4A42006D7F300F81029 /* DataPath.m in Sources */, + 0E23B44022982AF800304C30 /* OpenVPNSession.swift in Sources */, + 0E23B44822982AF800304C30 /* OpenVPN.swift in Sources */, 0ECC60D92254981A0020BEAC /* ConfigurationError.swift in Sources */, 0EE2FA0B22918DA100F56F49 /* InterfaceObserver.swift in Sources */, - 0E3E0F222108A8CC00B371C1 /* PushReply.swift in Sources */, - 0E58BF542240FAA6006FB157 /* CompressionAlgorithm.swift in Sources */, 0E12B2A621454F7F00B4BAE9 /* BidirectionalState.swift in Sources */, - 0EB03E402290D310006D03A0 /* CoreConfiguration+OpenVPN.swift in Sources */, - 0EFEB4912006D7F300F81029 /* TLSBox.m in Sources */, + 0E23B45822982AF800304C30 /* NETCPLink.swift in Sources */, + 0E23B45422982AF800304C30 /* ConnectionStrategy.swift in Sources */, 0EFEB49D2006D7F300F81029 /* IOInterface.swift in Sources */, - 0E0C2128212ED29D008AB282 /* Configuration.swift in Sources */, - 0EE2F9EF22918DA100F56F49 /* ConnectionStrategy.swift in Sources */, - 0EFEB4972006D7F300F81029 /* Authenticator.swift in Sources */, + 0E23B45A22982AF800304C30 /* OpenVPNTunnelProvider.swift in Sources */, 0E011F7B2196D93600BA59EE /* SocketType.swift in Sources */, - 0EFEB49B2006D7F300F81029 /* Packet.swift in Sources */, + 0E23B47422982AF800304C30 /* MSS.m in Sources */, + 0E23B45E22982AF800304C30 /* ProtocolMacros.swift in Sources */, 0EE2FA0122918DA100F56F49 /* MemoryDestination.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/TunnelKit/Sources/LZO/StandardLZO.m b/TunnelKit/Sources/Extra/LZO/StandardLZO.m similarity index 100% rename from TunnelKit/Sources/LZO/StandardLZO.m rename to TunnelKit/Sources/Extra/LZO/StandardLZO.m diff --git a/TunnelKit/Sources/LZO/lib/COPYING b/TunnelKit/Sources/Extra/LZO/lib/COPYING similarity index 100% rename from TunnelKit/Sources/LZO/lib/COPYING rename to TunnelKit/Sources/Extra/LZO/lib/COPYING diff --git a/TunnelKit/Sources/LZO/lib/Makefile b/TunnelKit/Sources/Extra/LZO/lib/Makefile similarity index 100% rename from TunnelKit/Sources/LZO/lib/Makefile rename to TunnelKit/Sources/Extra/LZO/lib/Makefile diff --git a/TunnelKit/Sources/LZO/lib/README.LZO b/TunnelKit/Sources/Extra/LZO/lib/README.LZO similarity index 100% rename from TunnelKit/Sources/LZO/lib/README.LZO rename to TunnelKit/Sources/Extra/LZO/lib/README.LZO diff --git a/TunnelKit/Sources/LZO/lib/lzoconf.h b/TunnelKit/Sources/Extra/LZO/lib/lzoconf.h similarity index 100% rename from TunnelKit/Sources/LZO/lib/lzoconf.h rename to TunnelKit/Sources/Extra/LZO/lib/lzoconf.h diff --git a/TunnelKit/Sources/LZO/lib/lzodefs.h b/TunnelKit/Sources/Extra/LZO/lib/lzodefs.h similarity index 100% rename from TunnelKit/Sources/LZO/lib/lzodefs.h rename to TunnelKit/Sources/Extra/LZO/lib/lzodefs.h diff --git a/TunnelKit/Sources/LZO/lib/minilzo.c b/TunnelKit/Sources/Extra/LZO/lib/minilzo.c similarity index 100% rename from TunnelKit/Sources/LZO/lib/minilzo.c rename to TunnelKit/Sources/Extra/LZO/lib/minilzo.c diff --git a/TunnelKit/Sources/LZO/lib/minilzo.h b/TunnelKit/Sources/Extra/LZO/lib/minilzo.h similarity index 100% rename from TunnelKit/Sources/LZO/lib/minilzo.h rename to TunnelKit/Sources/Extra/LZO/lib/minilzo.h diff --git a/TunnelKit/Sources/LZO/lib/testmini.c b/TunnelKit/Sources/Extra/LZO/lib/testmini.c similarity index 100% rename from TunnelKit/Sources/LZO/lib/testmini.c rename to TunnelKit/Sources/Extra/LZO/lib/testmini.c diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/ConnectionStrategy.swift b/TunnelKit/Sources/Protocols/OpenVPN/AppExtension/ConnectionStrategy.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/AppExtension/ConnectionStrategy.swift rename to TunnelKit/Sources/Protocols/OpenVPN/AppExtension/ConnectionStrategy.swift diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/NETCPLink.swift b/TunnelKit/Sources/Protocols/OpenVPN/AppExtension/NETCPLink.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/AppExtension/NETCPLink.swift rename to TunnelKit/Sources/Protocols/OpenVPN/AppExtension/NETCPLink.swift diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/NEUDPLink.swift b/TunnelKit/Sources/Protocols/OpenVPN/AppExtension/NEUDPLink.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/AppExtension/NEUDPLink.swift rename to TunnelKit/Sources/Protocols/OpenVPN/AppExtension/NEUDPLink.swift diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift b/TunnelKit/Sources/Protocols/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift rename to TunnelKit/Sources/Protocols/OpenVPN/AppExtension/OpenVPNTunnelProvider+Configuration.swift diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Interaction.swift b/TunnelKit/Sources/Protocols/OpenVPN/AppExtension/OpenVPNTunnelProvider+Interaction.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider+Interaction.swift rename to TunnelKit/Sources/Protocols/OpenVPN/AppExtension/OpenVPNTunnelProvider+Interaction.swift diff --git a/TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift b/TunnelKit/Sources/Protocols/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift rename to TunnelKit/Sources/Protocols/OpenVPN/AppExtension/OpenVPNTunnelProvider.swift diff --git a/TunnelKit/Sources/OpenVPN/Authenticator.swift b/TunnelKit/Sources/Protocols/OpenVPN/Authenticator.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/Authenticator.swift rename to TunnelKit/Sources/Protocols/OpenVPN/Authenticator.swift diff --git a/TunnelKit/Sources/OpenVPN/CompressionAlgorithm.swift b/TunnelKit/Sources/Protocols/OpenVPN/CompressionAlgorithm.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/CompressionAlgorithm.swift rename to TunnelKit/Sources/Protocols/OpenVPN/CompressionAlgorithm.swift diff --git a/TunnelKit/Sources/OpenVPN/CompressionAlgorithmNative.h b/TunnelKit/Sources/Protocols/OpenVPN/CompressionAlgorithmNative.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/CompressionAlgorithmNative.h rename to TunnelKit/Sources/Protocols/OpenVPN/CompressionAlgorithmNative.h diff --git a/TunnelKit/Sources/OpenVPN/CompressionFraming.swift b/TunnelKit/Sources/Protocols/OpenVPN/CompressionFraming.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/CompressionFraming.swift rename to TunnelKit/Sources/Protocols/OpenVPN/CompressionFraming.swift diff --git a/TunnelKit/Sources/OpenVPN/CompressionFramingNative.h b/TunnelKit/Sources/Protocols/OpenVPN/CompressionFramingNative.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/CompressionFramingNative.h rename to TunnelKit/Sources/Protocols/OpenVPN/CompressionFramingNative.h diff --git a/TunnelKit/Sources/OpenVPN/Configuration.swift b/TunnelKit/Sources/Protocols/OpenVPN/Configuration.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/Configuration.swift rename to TunnelKit/Sources/Protocols/OpenVPN/Configuration.swift diff --git a/TunnelKit/Sources/OpenVPN/ConfigurationParser.swift b/TunnelKit/Sources/Protocols/OpenVPN/ConfigurationParser.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/ConfigurationParser.swift rename to TunnelKit/Sources/Protocols/OpenVPN/ConfigurationParser.swift diff --git a/TunnelKit/Sources/OpenVPN/ControlChannel.swift b/TunnelKit/Sources/Protocols/OpenVPN/ControlChannel.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/ControlChannel.swift rename to TunnelKit/Sources/Protocols/OpenVPN/ControlChannel.swift diff --git a/TunnelKit/Sources/OpenVPN/ControlChannelSerializer.swift b/TunnelKit/Sources/Protocols/OpenVPN/ControlChannelSerializer.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/ControlChannelSerializer.swift rename to TunnelKit/Sources/Protocols/OpenVPN/ControlChannelSerializer.swift diff --git a/TunnelKit/Sources/OpenVPN/ControlPacket.h b/TunnelKit/Sources/Protocols/OpenVPN/ControlPacket.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/ControlPacket.h rename to TunnelKit/Sources/Protocols/OpenVPN/ControlPacket.h diff --git a/TunnelKit/Sources/OpenVPN/ControlPacket.m b/TunnelKit/Sources/Protocols/OpenVPN/ControlPacket.m similarity index 100% rename from TunnelKit/Sources/OpenVPN/ControlPacket.m rename to TunnelKit/Sources/Protocols/OpenVPN/ControlPacket.m diff --git a/TunnelKit/Sources/OpenVPN/CoreConfiguration+OpenVPN.swift b/TunnelKit/Sources/Protocols/OpenVPN/CoreConfiguration+OpenVPN.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/CoreConfiguration+OpenVPN.swift rename to TunnelKit/Sources/Protocols/OpenVPN/CoreConfiguration+OpenVPN.swift diff --git a/TunnelKit/Sources/OpenVPN/Crypto.h b/TunnelKit/Sources/Protocols/OpenVPN/Crypto.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/Crypto.h rename to TunnelKit/Sources/Protocols/OpenVPN/Crypto.h diff --git a/TunnelKit/Sources/OpenVPN/CryptoAEAD.h b/TunnelKit/Sources/Protocols/OpenVPN/CryptoAEAD.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/CryptoAEAD.h rename to TunnelKit/Sources/Protocols/OpenVPN/CryptoAEAD.h diff --git a/TunnelKit/Sources/OpenVPN/CryptoAEAD.m b/TunnelKit/Sources/Protocols/OpenVPN/CryptoAEAD.m similarity index 100% rename from TunnelKit/Sources/OpenVPN/CryptoAEAD.m rename to TunnelKit/Sources/Protocols/OpenVPN/CryptoAEAD.m diff --git a/TunnelKit/Sources/OpenVPN/CryptoBox.h b/TunnelKit/Sources/Protocols/OpenVPN/CryptoBox.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/CryptoBox.h rename to TunnelKit/Sources/Protocols/OpenVPN/CryptoBox.h diff --git a/TunnelKit/Sources/OpenVPN/CryptoBox.m b/TunnelKit/Sources/Protocols/OpenVPN/CryptoBox.m similarity index 100% rename from TunnelKit/Sources/OpenVPN/CryptoBox.m rename to TunnelKit/Sources/Protocols/OpenVPN/CryptoBox.m diff --git a/TunnelKit/Sources/OpenVPN/CryptoCBC.h b/TunnelKit/Sources/Protocols/OpenVPN/CryptoCBC.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/CryptoCBC.h rename to TunnelKit/Sources/Protocols/OpenVPN/CryptoCBC.h diff --git a/TunnelKit/Sources/OpenVPN/CryptoCBC.m b/TunnelKit/Sources/Protocols/OpenVPN/CryptoCBC.m similarity index 100% rename from TunnelKit/Sources/OpenVPN/CryptoCBC.m rename to TunnelKit/Sources/Protocols/OpenVPN/CryptoCBC.m diff --git a/TunnelKit/Sources/OpenVPN/CryptoCTR.h b/TunnelKit/Sources/Protocols/OpenVPN/CryptoCTR.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/CryptoCTR.h rename to TunnelKit/Sources/Protocols/OpenVPN/CryptoCTR.h diff --git a/TunnelKit/Sources/OpenVPN/CryptoCTR.m b/TunnelKit/Sources/Protocols/OpenVPN/CryptoCTR.m similarity index 100% rename from TunnelKit/Sources/OpenVPN/CryptoCTR.m rename to TunnelKit/Sources/Protocols/OpenVPN/CryptoCTR.m diff --git a/TunnelKit/Sources/OpenVPN/CryptoContainer.swift b/TunnelKit/Sources/Protocols/OpenVPN/CryptoContainer.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/CryptoContainer.swift rename to TunnelKit/Sources/Protocols/OpenVPN/CryptoContainer.swift diff --git a/TunnelKit/Sources/OpenVPN/CryptoMacros.h b/TunnelKit/Sources/Protocols/OpenVPN/CryptoMacros.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/CryptoMacros.h rename to TunnelKit/Sources/Protocols/OpenVPN/CryptoMacros.h diff --git a/TunnelKit/Sources/OpenVPN/DataPath.h b/TunnelKit/Sources/Protocols/OpenVPN/DataPath.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/DataPath.h rename to TunnelKit/Sources/Protocols/OpenVPN/DataPath.h diff --git a/TunnelKit/Sources/OpenVPN/DataPath.m b/TunnelKit/Sources/Protocols/OpenVPN/DataPath.m similarity index 100% rename from TunnelKit/Sources/OpenVPN/DataPath.m rename to TunnelKit/Sources/Protocols/OpenVPN/DataPath.m diff --git a/TunnelKit/Sources/OpenVPN/DataPathCrypto.h b/TunnelKit/Sources/Protocols/OpenVPN/DataPathCrypto.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/DataPathCrypto.h rename to TunnelKit/Sources/Protocols/OpenVPN/DataPathCrypto.h diff --git a/TunnelKit/Sources/OpenVPN/EncryptionBridge.swift b/TunnelKit/Sources/Protocols/OpenVPN/EncryptionBridge.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/EncryptionBridge.swift rename to TunnelKit/Sources/Protocols/OpenVPN/EncryptionBridge.swift diff --git a/TunnelKit/Sources/OpenVPN/MSS.h b/TunnelKit/Sources/Protocols/OpenVPN/MSS.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/MSS.h rename to TunnelKit/Sources/Protocols/OpenVPN/MSS.h diff --git a/TunnelKit/Sources/OpenVPN/MSS.m b/TunnelKit/Sources/Protocols/OpenVPN/MSS.m similarity index 100% rename from TunnelKit/Sources/OpenVPN/MSS.m rename to TunnelKit/Sources/Protocols/OpenVPN/MSS.m diff --git a/TunnelKit/Sources/OpenVPN/OpenVPN.swift b/TunnelKit/Sources/Protocols/OpenVPN/OpenVPN.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/OpenVPN.swift rename to TunnelKit/Sources/Protocols/OpenVPN/OpenVPN.swift diff --git a/TunnelKit/Sources/OpenVPN/OpenVPNError.swift b/TunnelKit/Sources/Protocols/OpenVPN/OpenVPNError.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/OpenVPNError.swift rename to TunnelKit/Sources/Protocols/OpenVPN/OpenVPNError.swift diff --git a/TunnelKit/Sources/OpenVPN/OpenVPNSession+PIA.swift b/TunnelKit/Sources/Protocols/OpenVPN/OpenVPNSession+PIA.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/OpenVPNSession+PIA.swift rename to TunnelKit/Sources/Protocols/OpenVPN/OpenVPNSession+PIA.swift diff --git a/TunnelKit/Sources/OpenVPN/OpenVPNSession.swift b/TunnelKit/Sources/Protocols/OpenVPN/OpenVPNSession.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/OpenVPNSession.swift rename to TunnelKit/Sources/Protocols/OpenVPN/OpenVPNSession.swift diff --git a/TunnelKit/Sources/OpenVPN/Packet.swift b/TunnelKit/Sources/Protocols/OpenVPN/Packet.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/Packet.swift rename to TunnelKit/Sources/Protocols/OpenVPN/Packet.swift diff --git a/TunnelKit/Sources/OpenVPN/PacketMacros.h b/TunnelKit/Sources/Protocols/OpenVPN/PacketMacros.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/PacketMacros.h rename to TunnelKit/Sources/Protocols/OpenVPN/PacketMacros.h diff --git a/TunnelKit/Sources/OpenVPN/PacketMacros.m b/TunnelKit/Sources/Protocols/OpenVPN/PacketMacros.m similarity index 100% rename from TunnelKit/Sources/OpenVPN/PacketMacros.m rename to TunnelKit/Sources/Protocols/OpenVPN/PacketMacros.m diff --git a/TunnelKit/Sources/OpenVPN/PacketStream.h b/TunnelKit/Sources/Protocols/OpenVPN/PacketStream.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/PacketStream.h rename to TunnelKit/Sources/Protocols/OpenVPN/PacketStream.h diff --git a/TunnelKit/Sources/OpenVPN/PacketStream.m b/TunnelKit/Sources/Protocols/OpenVPN/PacketStream.m similarity index 100% rename from TunnelKit/Sources/OpenVPN/PacketStream.m rename to TunnelKit/Sources/Protocols/OpenVPN/PacketStream.m diff --git a/TunnelKit/Sources/OpenVPN/ProtocolMacros.swift b/TunnelKit/Sources/Protocols/OpenVPN/ProtocolMacros.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/ProtocolMacros.swift rename to TunnelKit/Sources/Protocols/OpenVPN/ProtocolMacros.swift diff --git a/TunnelKit/Sources/OpenVPN/PushReply.swift b/TunnelKit/Sources/Protocols/OpenVPN/PushReply.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/PushReply.swift rename to TunnelKit/Sources/Protocols/OpenVPN/PushReply.swift diff --git a/TunnelKit/Sources/OpenVPN/ReplayProtector.h b/TunnelKit/Sources/Protocols/OpenVPN/ReplayProtector.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/ReplayProtector.h rename to TunnelKit/Sources/Protocols/OpenVPN/ReplayProtector.h diff --git a/TunnelKit/Sources/OpenVPN/ReplayProtector.m b/TunnelKit/Sources/Protocols/OpenVPN/ReplayProtector.m similarity index 100% rename from TunnelKit/Sources/OpenVPN/ReplayProtector.m rename to TunnelKit/Sources/Protocols/OpenVPN/ReplayProtector.m diff --git a/TunnelKit/Sources/OpenVPN/SessionKey.swift b/TunnelKit/Sources/Protocols/OpenVPN/SessionKey.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/SessionKey.swift rename to TunnelKit/Sources/Protocols/OpenVPN/SessionKey.swift diff --git a/TunnelKit/Sources/OpenVPN/StaticKey.swift b/TunnelKit/Sources/Protocols/OpenVPN/StaticKey.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/StaticKey.swift rename to TunnelKit/Sources/Protocols/OpenVPN/StaticKey.swift diff --git a/TunnelKit/Sources/OpenVPN/TLSBox.h b/TunnelKit/Sources/Protocols/OpenVPN/TLSBox.h similarity index 100% rename from TunnelKit/Sources/OpenVPN/TLSBox.h rename to TunnelKit/Sources/Protocols/OpenVPN/TLSBox.h diff --git a/TunnelKit/Sources/OpenVPN/TLSBox.m b/TunnelKit/Sources/Protocols/OpenVPN/TLSBox.m similarity index 100% rename from TunnelKit/Sources/OpenVPN/TLSBox.m rename to TunnelKit/Sources/Protocols/OpenVPN/TLSBox.m diff --git a/TunnelKit/Sources/OpenVPN/TLSWrap.swift b/TunnelKit/Sources/Protocols/OpenVPN/TLSWrap.swift similarity index 100% rename from TunnelKit/Sources/OpenVPN/TLSWrap.swift rename to TunnelKit/Sources/Protocols/OpenVPN/TLSWrap.swift diff --git a/TunnelKit/Sources/OpenVPN/module.modulemap b/TunnelKit/Sources/Protocols/OpenVPN/module.modulemap similarity index 100% rename from TunnelKit/Sources/OpenVPN/module.modulemap rename to TunnelKit/Sources/Protocols/OpenVPN/module.modulemap From adcae1686e66260ec42539c78518b92b86494987 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 23 May 2019 23:25:35 +0200 Subject: [PATCH 11/12] Update Demo --- Demo/BasicTunnel-iOS/ViewController.swift | 10 +++++----- Demo/BasicTunnel-macOS/ViewController.swift | 8 ++++---- .../PacketTunnelProvider.swift | 2 +- .../PacketTunnelProvider.swift | 2 +- Demo/Podfile.lock | 14 ++++++++------ 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Demo/BasicTunnel-iOS/ViewController.swift b/Demo/BasicTunnel-iOS/ViewController.swift index 521f17d..62f35c8 100644 --- a/Demo/BasicTunnel-iOS/ViewController.swift +++ b/Demo/BasicTunnel-iOS/ViewController.swift @@ -39,7 +39,7 @@ import UIKit import NetworkExtension import TunnelKit -private let ca = CryptoContainer(pem: """ +private let ca = OpenVPN.CryptoContainer(pem: """ -----BEGIN CERTIFICATE----- MIIFqzCCBJOgAwIBAgIJAKZ7D5Yv87qDMA0GCSqGSIb3DQEBDQUAMIHoMQswCQYD VQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNVBAcTCkxvc0FuZ2VsZXMxIDAeBgNV @@ -86,9 +86,9 @@ extension ViewController { let hostname = ((domain == "") ? server : [server, domain].joined(separator: ".")) let port = UInt16(textPort.text!)! - let credentials = SessionProxy.Credentials(textUsername.text!, textPassword.text!) + let credentials = OpenVPN.Credentials(textUsername.text!, textPassword.text!) - var sessionBuilder = SessionProxy.ConfigurationBuilder() + var sessionBuilder = OpenVPN.ConfigurationBuilder() sessionBuilder.ca = ca sessionBuilder.cipher = .aes128cbc sessionBuilder.digest = .sha1 @@ -98,7 +98,7 @@ extension ViewController { let socketType: SocketType = switchTCP.isOn ? .tcp : .udp sessionBuilder.endpointProtocols = [EndpointProtocol(socketType, port)] sessionBuilder.usesPIAPatches = true - var builder = TunnelKitProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build()) + var builder = OpenVPNTunnelProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build()) builder.mtu = 1350 builder.shouldDebug = true builder.masksPrivateData = false @@ -218,7 +218,7 @@ class ViewController: UIViewController, URLSessionDataDelegate { guard let vpn = currentManager?.connection as? NETunnelProviderSession else { return } - try? vpn.sendProviderMessage(TunnelKitProvider.Message.requestLog.data) { (data) in + try? vpn.sendProviderMessage(OpenVPNTunnelProvider.Message.requestLog.data) { (data) in guard let data = data, let log = String(data: data, encoding: .utf8) else { return } diff --git a/Demo/BasicTunnel-macOS/ViewController.swift b/Demo/BasicTunnel-macOS/ViewController.swift index a2e30d7..d903467 100644 --- a/Demo/BasicTunnel-macOS/ViewController.swift +++ b/Demo/BasicTunnel-macOS/ViewController.swift @@ -39,7 +39,7 @@ import Cocoa import NetworkExtension import TunnelKit -private let ca = CryptoContainer(pem: """ +private let ca = OpenVPN.CryptoContainer(pem: """ -----BEGIN CERTIFICATE----- MIIFqzCCBJOgAwIBAgIJAKZ7D5Yv87qDMA0GCSqGSIb3DQEBDQUAMIHoMQswCQYD VQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNVBAcTCkxvc0FuZ2VsZXMxIDAeBgNV @@ -86,9 +86,9 @@ extension ViewController { let hostname = ((domain == "") ? server : [server, domain].joined(separator: ".")) let port = UInt16(textPort.stringValue)! - let credentials = SessionProxy.Credentials(textUsername.stringValue, textPassword.stringValue) + let credentials = OpenVPN.Credentials(textUsername.stringValue, textPassword.stringValue) - var sessionBuilder = SessionProxy.ConfigurationBuilder() + var sessionBuilder = OpenVPN.ConfigurationBuilder() sessionBuilder.ca = ca sessionBuilder.cipher = .aes128cbc sessionBuilder.digest = .sha1 @@ -99,7 +99,7 @@ extension ViewController { let socketType: SocketType = .udp sessionBuilder.endpointProtocols = [EndpointProtocol(socketType, port)] sessionBuilder.usesPIAPatches = true - var builder = TunnelKitProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build()) + var builder = OpenVPNTunnelProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build()) builder.mtu = 1350 builder.shouldDebug = true builder.masksPrivateData = false diff --git a/Demo/BasicTunnelExtension-iOS/PacketTunnelProvider.swift b/Demo/BasicTunnelExtension-iOS/PacketTunnelProvider.swift index 0bc15b4..256dad7 100644 --- a/Demo/BasicTunnelExtension-iOS/PacketTunnelProvider.swift +++ b/Demo/BasicTunnelExtension-iOS/PacketTunnelProvider.swift @@ -37,5 +37,5 @@ import TunnelKit -class PacketTunnelProvider: TunnelKitProvider { +class PacketTunnelProvider: OpenVPNTunnelProvider { } diff --git a/Demo/BasicTunnelExtension-macOS/PacketTunnelProvider.swift b/Demo/BasicTunnelExtension-macOS/PacketTunnelProvider.swift index d8428fa..f580e24 100644 --- a/Demo/BasicTunnelExtension-macOS/PacketTunnelProvider.swift +++ b/Demo/BasicTunnelExtension-macOS/PacketTunnelProvider.swift @@ -37,5 +37,5 @@ import TunnelKit -class PacketTunnelProvider: TunnelKitProvider { +class PacketTunnelProvider: OpenVPNTunnelProvider { } diff --git a/Demo/Podfile.lock b/Demo/Podfile.lock index 35d4279..11943ca 100644 --- a/Demo/Podfile.lock +++ b/Demo/Podfile.lock @@ -1,15 +1,17 @@ PODS: - OpenSSL-Apple (1.1.0j.2) - SwiftyBeaver (1.7.0) - - TunnelKit (1.6.3): - - TunnelKit/AppExtension (= 1.6.3) - - TunnelKit/Core (= 1.6.3) - - TunnelKit/AppExtension (1.6.3): + - TunnelKit (2.0.0): + - TunnelKit/Protocols/OpenVPN (= 2.0.0) + - TunnelKit/AppExtension (2.0.0): - SwiftyBeaver - TunnelKit/Core - - TunnelKit/Core (1.6.3): + - TunnelKit/Core (2.0.0): - OpenSSL-Apple (~> 1.1.0j.2) - SwiftyBeaver + - TunnelKit/Protocols/OpenVPN (2.0.0): + - TunnelKit/AppExtension + - TunnelKit/Core DEPENDENCIES: - TunnelKit (from `..`) @@ -26,7 +28,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: OpenSSL-Apple: e88e1eb314acb4a05e2348069790c4aa49f6d319 SwiftyBeaver: 4cc0080d2e23f980652e28978db11a5c9da39165 - TunnelKit: ac8dad986e36e513303ed5d258c7e4aedb45c84b + TunnelKit: 821c15bb87aafae69eb8c63e4cc46d883fff8797 PODFILE CHECKSUM: f66dfaaa92a8d04ab2743f3caeab0ac9f9f25859 From 2ddf7121767a26824f8524b8a104bb195c284351 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 23 May 2019 21:54:34 +0200 Subject: [PATCH 12/12] Update jazzy YAML --- .jazzy.yaml | 17 ++++++++++++++--- TunnelKit/Sources/Core/Errors.swift | 2 +- TunnelKit/Sources/Core/Session.swift | 2 +- TunnelKit/Sources/Core/Utils.swift | 3 ++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.jazzy.yaml b/.jazzy.yaml index f41fd92..36e9c6e 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -16,6 +16,7 @@ custom_categories: children: - BidirectionalState - ConfigurationError + - DNSResolver - EndpointProtocol - IOInterface - IPv4Settings @@ -25,12 +26,22 @@ custom_categories: - Session - SocketType - TunnelInterface - - name: OpenVPN + - name: AppExtension + children: + - GenericSocket + - GenericSocketDelegate + - InterfaceObserver + - Keychain + - KeychainError + - LinkProducer + - MemoryDestination + - NETCPSocket + - NETunnelInterface + - NEUDPSocket + - name: Protocols/OpenVPN children: - OpenVPN - OpenVPNError - OpenVPNSession - OpenVPNSessionDelegate - - name: AppExtension - children: - OpenVPNTunnelProvider diff --git a/TunnelKit/Sources/Core/Errors.swift b/TunnelKit/Sources/Core/Errors.swift index d10548f..ca303f5 100644 --- a/TunnelKit/Sources/Core/Errors.swift +++ b/TunnelKit/Sources/Core/Errors.swift @@ -2,7 +2,7 @@ // Errors.swift // TunnelKit // -// Created by Davide De Rosa on 05/19/19. +// Created by Davide De Rosa on 5/19/19. // Copyright (c) 2019 Davide De Rosa. All rights reserved. // // https://github.com/passepartoutvpn diff --git a/TunnelKit/Sources/Core/Session.swift b/TunnelKit/Sources/Core/Session.swift index ab8fb9f..ac198a7 100644 --- a/TunnelKit/Sources/Core/Session.swift +++ b/TunnelKit/Sources/Core/Session.swift @@ -2,7 +2,7 @@ // Session.swift // TunnelKit // -// Created by Davide De Rosa on 05/19/19. +// Created by Davide De Rosa on 5/19/19. // Copyright (c) 2019 Davide De Rosa. All rights reserved. // // https://github.com/passepartoutvpn diff --git a/TunnelKit/Sources/Core/Utils.swift b/TunnelKit/Sources/Core/Utils.swift index 937bc25..66f7b2a 100644 --- a/TunnelKit/Sources/Core/Utils.swift +++ b/TunnelKit/Sources/Core/Utils.swift @@ -36,7 +36,8 @@ import Foundation -extension DispatchQueue { +/// :nodoc: +public extension DispatchQueue { func schedule(after: DispatchTimeInterval, block: @escaping () -> Void) { asyncAfter(deadline: .now() + after, execute: block) }