From 9da7fa9667853e7272bf897a607be69e13f789e9 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sun, 19 May 2019 02:05:34 +0200 Subject: [PATCH] Split Core into Core+OpenVPN Two Obj-C modules: - __TunnelKitCore - __TunnelKitOpenVPN Seems the only way to do it in multiple module maps. Move OpenVPN specifics out of CoreConfiguration. --- TunnelKit.xcodeproj/project.pbxproj | 294 +++++++++--------- .../Transport/NETCPInterface.swift | 2 +- .../AppExtension/TunnelKitProvider.swift | 2 +- .../Sources/Core/CoreConfiguration.swift | 50 --- TunnelKit/Sources/Core/SecureRandom.swift | 2 +- TunnelKit/Sources/Core/ZeroingData.swift | 2 +- TunnelKit/Sources/Core/module.modulemap | 18 +- .../CompressionAlgorithmNative.h | 0 .../CompressionFramingNative.h | 0 .../ConfigurationParser.swift | 2 +- .../{Core => OpenVPN}/ControlChannel.swift | 5 +- .../ControlChannelSerializer.swift | 3 +- .../Sources/{Core => OpenVPN}/ControlPacket.h | 0 .../Sources/{Core => OpenVPN}/ControlPacket.m | 1 + .../OpenVPN/CoreConfiguration+OpenVPN.swift | 93 ++++++ TunnelKit/Sources/{Core => OpenVPN}/Crypto.h | 3 +- .../Sources/{Core => OpenVPN}/CryptoAEAD.h | 0 .../Sources/{Core => OpenVPN}/CryptoAEAD.m | 2 + .../Sources/{Core => OpenVPN}/CryptoBox.h | 3 +- .../Sources/{Core => OpenVPN}/CryptoBox.m | 0 .../Sources/{Core => OpenVPN}/CryptoCBC.h | 0 .../Sources/{Core => OpenVPN}/CryptoCBC.m | 1 + .../Sources/{Core => OpenVPN}/CryptoCTR.h | 0 .../Sources/{Core => OpenVPN}/CryptoCTR.m | 1 + .../{Core => OpenVPN}/CryptoContainer.swift | 2 +- .../Sources/{Core => OpenVPN}/CryptoMacros.h | 0 .../Sources/{Core => OpenVPN}/DataPath.h | 15 +- .../Sources/{Core => OpenVPN}/DataPath.m | 1 + .../{Core => OpenVPN}/DataPathCrypto.h | 0 TunnelKit/Sources/{Core => OpenVPN}/MSS.h | 1 + TunnelKit/Sources/{Core => OpenVPN}/MSS.m | 0 .../Sources/{Core => OpenVPN}/Packet.swift | 4 +- .../Sources/{Core => OpenVPN}/PacketMacros.h | 0 .../Sources/{Core => OpenVPN}/PacketMacros.m | 0 .../Sources/{Core => OpenVPN}/PacketStream.h | 0 .../Sources/{Core => OpenVPN}/PacketStream.m | 0 .../{Core => OpenVPN}/ProtocolMacros.swift | 0 .../{Core => OpenVPN}/ReplayProtector.h | 0 .../{Core => OpenVPN}/ReplayProtector.m | 0 .../{Core => OpenVPN}/SessionError.swift | 2 +- .../SessionProxy+Authenticator.swift | 21 +- .../SessionProxy+CompressionAlgorithm.swift | 2 +- .../SessionProxy+CompressionFraming.swift | 2 +- .../SessionProxy+Configuration.swift | 0 .../SessionProxy+EncryptionBridge.swift | 17 +- .../{Core => OpenVPN}/SessionProxy+PIA.swift | 0 .../SessionProxy+SessionKey.swift | 5 +- .../SessionProxy+SessionReply.swift | 0 .../SessionProxy+TLSWrap.swift | 0 .../{Core => OpenVPN}/SessionProxy.swift | 13 +- .../Sources/{Core => OpenVPN}/StaticKey.swift | 2 +- TunnelKit/Sources/{Core => OpenVPN}/TLSBox.h | 0 TunnelKit/Sources/{Core => OpenVPN}/TLSBox.m | 0 TunnelKit/Sources/OpenVPN/module.modulemap | 51 +++ TunnelKitTests/CompressionTests.swift | 2 +- TunnelKitTests/ControlChannelTests.swift | 3 +- TunnelKitTests/DNSTests.swift | 2 +- TunnelKitTests/DataPathEncryptionTests.swift | 3 +- TunnelKitTests/DataPathPerformanceTests.swift | 2 +- .../EncryptionPerformanceTests.swift | 3 +- TunnelKitTests/EncryptionTests.swift | 3 +- TunnelKitTests/LinkTests.swift | 2 +- TunnelKitTests/PacketTests.swift | 2 +- TunnelKitTests/RoutingTests.swift | 2 +- TunnelKitTests/TestUtils.swift | 3 +- 65 files changed, 382 insertions(+), 267 deletions(-) rename TunnelKit/Sources/{Core => OpenVPN}/CompressionAlgorithmNative.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/CompressionFramingNative.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/ConfigurationParser.swift (99%) rename TunnelKit/Sources/{Core => OpenVPN}/ControlChannel.swift (98%) rename TunnelKit/Sources/{Core => OpenVPN}/ControlChannelSerializer.swift (99%) rename TunnelKit/Sources/{Core => OpenVPN}/ControlPacket.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/ControlPacket.m (99%) create mode 100644 TunnelKit/Sources/OpenVPN/CoreConfiguration+OpenVPN.swift rename TunnelKit/Sources/{Core => OpenVPN}/Crypto.h (99%) rename TunnelKit/Sources/{Core => OpenVPN}/CryptoAEAD.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/CryptoAEAD.m (99%) rename TunnelKit/Sources/{Core => OpenVPN}/CryptoBox.h (99%) rename TunnelKit/Sources/{Core => OpenVPN}/CryptoBox.m (100%) rename TunnelKit/Sources/{Core => OpenVPN}/CryptoCBC.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/CryptoCBC.m (99%) rename TunnelKit/Sources/{Core => OpenVPN}/CryptoCTR.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/CryptoCTR.m (99%) rename TunnelKit/Sources/{Core => OpenVPN}/CryptoContainer.swift (99%) rename TunnelKit/Sources/{Core => OpenVPN}/CryptoMacros.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/DataPath.h (83%) rename TunnelKit/Sources/{Core => OpenVPN}/DataPath.m (99%) rename TunnelKit/Sources/{Core => OpenVPN}/DataPathCrypto.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/MSS.h (98%) rename TunnelKit/Sources/{Core => OpenVPN}/MSS.m (100%) rename TunnelKit/Sources/{Core => OpenVPN}/Packet.swift (98%) rename TunnelKit/Sources/{Core => OpenVPN}/PacketMacros.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/PacketMacros.m (100%) rename TunnelKit/Sources/{Core => OpenVPN}/PacketStream.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/PacketStream.m (100%) rename TunnelKit/Sources/{Core => OpenVPN}/ProtocolMacros.swift (100%) rename TunnelKit/Sources/{Core => OpenVPN}/ReplayProtector.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/ReplayProtector.m (100%) rename TunnelKit/Sources/{Core => OpenVPN}/SessionError.swift (99%) rename TunnelKit/Sources/{Core => OpenVPN}/SessionProxy+Authenticator.swift (94%) rename TunnelKit/Sources/{Core => OpenVPN}/SessionProxy+CompressionAlgorithm.swift (98%) rename TunnelKit/Sources/{Core => OpenVPN}/SessionProxy+CompressionFraming.swift (98%) rename TunnelKit/Sources/{Core => OpenVPN}/SessionProxy+Configuration.swift (100%) rename TunnelKit/Sources/{Core => OpenVPN}/SessionProxy+EncryptionBridge.swift (93%) rename TunnelKit/Sources/{Core => OpenVPN}/SessionProxy+PIA.swift (100%) rename TunnelKit/Sources/{Core => OpenVPN}/SessionProxy+SessionKey.swift (96%) rename TunnelKit/Sources/{Core => OpenVPN}/SessionProxy+SessionReply.swift (100%) rename TunnelKit/Sources/{Core => OpenVPN}/SessionProxy+TLSWrap.swift (100%) rename TunnelKit/Sources/{Core => OpenVPN}/SessionProxy.swift (99%) rename TunnelKit/Sources/{Core => OpenVPN}/StaticKey.swift (99%) rename TunnelKit/Sources/{Core => OpenVPN}/TLSBox.h (100%) rename TunnelKit/Sources/{Core => OpenVPN}/TLSBox.m (100%) create mode 100644 TunnelKit/Sources/OpenVPN/module.modulemap diff --git a/TunnelKit.xcodeproj/project.pbxproj b/TunnelKit.xcodeproj/project.pbxproj index fb0e2ae..c3d2dda 100644 --- a/TunnelKit.xcodeproj/project.pbxproj +++ b/TunnelKit.xcodeproj/project.pbxproj @@ -129,6 +129,38 @@ 0EA82A3C2190B2B9007960EB /* StaticKeyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E041D0B2152E80A0025FE3C /* StaticKeyTests.swift */; }; 0EA82A3D2190B2B9007960EB /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB2B45A20F0BE4C004233D7 /* TestUtils.swift */; }; 0EA82A3E2190B2BC007960EB /* pia-2048.pem in Resources */ = {isa = PBXBuildFile; fileRef = 0E749F612178911C00BB2701 /* pia-2048.pem */; }; + 0EB03E202290D22A006D03A0 /* ConnectionStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E102290D22A006D03A0 /* ConnectionStrategy.swift */; }; + 0EB03E212290D22A006D03A0 /* ConnectionStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E102290D22A006D03A0 /* ConnectionStrategy.swift */; }; + 0EB03E222290D22A006D03A0 /* NETCPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E122290D22A006D03A0 /* NETCPInterface.swift */; }; + 0EB03E232290D22A006D03A0 /* NETCPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E122290D22A006D03A0 /* NETCPInterface.swift */; }; + 0EB03E242290D22A006D03A0 /* NETunnelInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E132290D22A006D03A0 /* NETunnelInterface.swift */; }; + 0EB03E252290D22A006D03A0 /* NETunnelInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E132290D22A006D03A0 /* NETunnelInterface.swift */; }; + 0EB03E262290D22A006D03A0 /* NWTCPConnectionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E142290D22A006D03A0 /* NWTCPConnectionState+Description.swift */; }; + 0EB03E272290D22A006D03A0 /* NWTCPConnectionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E142290D22A006D03A0 /* NWTCPConnectionState+Description.swift */; }; + 0EB03E282290D22A006D03A0 /* NEUDPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E152290D22A006D03A0 /* NEUDPInterface.swift */; }; + 0EB03E292290D22A006D03A0 /* NEUDPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E152290D22A006D03A0 /* NEUDPInterface.swift */; }; + 0EB03E2A2290D22A006D03A0 /* NWUDPSessionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E162290D22A006D03A0 /* NWUDPSessionState+Description.swift */; }; + 0EB03E2B2290D22A006D03A0 /* NWUDPSessionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E162290D22A006D03A0 /* NWUDPSessionState+Description.swift */; }; + 0EB03E2C2290D22A006D03A0 /* DNSResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E172290D22A006D03A0 /* DNSResolver.swift */; }; + 0EB03E2D2290D22A006D03A0 /* DNSResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E172290D22A006D03A0 /* DNSResolver.swift */; }; + 0EB03E2E2290D22A006D03A0 /* TunnelKitProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E182290D22A006D03A0 /* TunnelKitProvider+Configuration.swift */; }; + 0EB03E2F2290D22A006D03A0 /* TunnelKitProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E182290D22A006D03A0 /* TunnelKitProvider+Configuration.swift */; }; + 0EB03E302290D22A006D03A0 /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E192290D22A006D03A0 /* Keychain.swift */; }; + 0EB03E312290D22A006D03A0 /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E192290D22A006D03A0 /* Keychain.swift */; }; + 0EB03E322290D22A006D03A0 /* MemoryDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1A2290D22A006D03A0 /* MemoryDestination.swift */; }; + 0EB03E332290D22A006D03A0 /* MemoryDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1A2290D22A006D03A0 /* MemoryDestination.swift */; }; + 0EB03E342290D22A006D03A0 /* GenericSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1B2290D22A006D03A0 /* GenericSocket.swift */; }; + 0EB03E352290D22A006D03A0 /* GenericSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1B2290D22A006D03A0 /* GenericSocket.swift */; }; + 0EB03E362290D22A006D03A0 /* TunnelKitProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1C2290D22A006D03A0 /* TunnelKitProvider.swift */; }; + 0EB03E372290D22A006D03A0 /* TunnelKitProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1C2290D22A006D03A0 /* TunnelKitProvider.swift */; }; + 0EB03E382290D22A006D03A0 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1D2290D22A006D03A0 /* Utils.swift */; }; + 0EB03E392290D22A006D03A0 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1D2290D22A006D03A0 /* Utils.swift */; }; + 0EB03E3A2290D22A006D03A0 /* TunnelKitProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1E2290D22A006D03A0 /* TunnelKitProvider+Interaction.swift */; }; + 0EB03E3B2290D22A006D03A0 /* TunnelKitProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1E2290D22A006D03A0 /* TunnelKitProvider+Interaction.swift */; }; + 0EB03E3C2290D22A006D03A0 /* InterfaceObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1F2290D22A006D03A0 /* InterfaceObserver.swift */; }; + 0EB03E3D2290D22A006D03A0 /* InterfaceObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB03E1F2290D22A006D03A0 /* InterfaceObserver.swift */; }; + 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 */; }; 0EB2B45320F0BB44004233D7 /* EncryptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB2B45220F0BB44004233D7 /* EncryptionTests.swift */; }; 0EB2B45520F0BB53004233D7 /* DataManipulationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB2B45420F0BB53004233D7 /* DataManipulationTests.swift */; }; 0EB2B45720F0BD16004233D7 /* RandomTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB2B45620F0BD16004233D7 /* RandomTests.swift */; }; @@ -137,22 +169,6 @@ 0EB2B45D20F0BF41004233D7 /* RawPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB2B45C20F0BF41004233D7 /* RawPerformanceTests.swift */; }; 0EB2B45F20F0C098004233D7 /* EncryptionPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB2B45E20F0C098004233D7 /* EncryptionPerformanceTests.swift */; }; 0EB2B46120F0C0A4004233D7 /* DataPathPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB2B46020F0C0A4004233D7 /* DataPathPerformanceTests.swift */; }; - 0EBBF2E52084FE6F00E36B40 /* GenericSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2E42084FE6F00E36B40 /* GenericSocket.swift */; }; - 0EBBF2E62084FE6F00E36B40 /* GenericSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2E42084FE6F00E36B40 /* GenericSocket.swift */; }; - 0EBBF2F3208505D300E36B40 /* NEUDPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2EC2085055100E36B40 /* NEUDPInterface.swift */; }; - 0EBBF2F4208505D400E36B40 /* NEUDPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2EC2085055100E36B40 /* NEUDPInterface.swift */; }; - 0EBBF2F5208505D700E36B40 /* NETunnelInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2EB2085055100E36B40 /* NETunnelInterface.swift */; }; - 0EBBF2F6208505D700E36B40 /* NETunnelInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2EB2085055100E36B40 /* NETunnelInterface.swift */; }; - 0EBBF2F7208505DD00E36B40 /* NWUDPSessionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2EA2085055100E36B40 /* NWUDPSessionState+Description.swift */; }; - 0EBBF2F8208505DD00E36B40 /* NWUDPSessionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2EA2085055100E36B40 /* NWUDPSessionState+Description.swift */; }; - 0EBBF2FA2085061600E36B40 /* NETCPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2F92085061600E36B40 /* NETCPInterface.swift */; }; - 0EBBF2FB2085061600E36B40 /* NETCPInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2F92085061600E36B40 /* NETCPInterface.swift */; }; - 0EBBF3002085196000E36B40 /* NWTCPConnectionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2FF2085196000E36B40 /* NWTCPConnectionState+Description.swift */; }; - 0EBBF3012085196000E36B40 /* NWTCPConnectionState+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EBBF2FF2085196000E36B40 /* NWTCPConnectionState+Description.swift */; }; - 0EC1BBA520D71190007C4C7B /* DNSResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EC1BBA420D71190007C4C7B /* DNSResolver.swift */; }; - 0EC1BBA620D712DE007C4C7B /* DNSResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EC1BBA420D71190007C4C7B /* DNSResolver.swift */; }; - 0EC1BBA820D7D803007C4C7B /* ConnectionStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EC1BBA720D7D803007C4C7B /* ConnectionStrategy.swift */; }; - 0EC1BBA920D7D803007C4C7B /* ConnectionStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EC1BBA720D7D803007C4C7B /* ConnectionStrategy.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 */; }; @@ -170,8 +186,6 @@ 0EE7A79820F6296F00B42E6A /* PacketMacros.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE7A79720F6296F00B42E6A /* PacketMacros.m */; }; 0EE7A79920F6296F00B42E6A /* PacketMacros.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE7A79720F6296F00B42E6A /* PacketMacros.m */; }; 0EE7A7A120F664AC00B42E6A /* DataPathEncryptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE7A7A020F664AB00B42E6A /* DataPathEncryptionTests.swift */; }; - 0EEC49DC20B5E732008FEB91 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EEC49DB20B5E732008FEB91 /* Utils.swift */; }; - 0EEC49DD20B5E732008FEB91 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EEC49DB20B5E732008FEB91 /* Utils.swift */; }; 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 */; }; @@ -216,12 +230,6 @@ 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 */; }; - 0EFEB4782006D3C800F81029 /* TunnelKitProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB44F2006D3C800F81029 /* TunnelKitProvider+Configuration.swift */; }; - 0EFEB4792006D3C800F81029 /* TunnelKitProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4502006D3C800F81029 /* TunnelKitProvider+Interaction.swift */; }; - 0EFEB47B2006D3C800F81029 /* TunnelKitProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4522006D3C800F81029 /* TunnelKitProvider.swift */; }; - 0EFEB4872006D7C400F81029 /* TunnelKitProvider+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB44F2006D3C800F81029 /* TunnelKitProvider+Configuration.swift */; }; - 0EFEB4882006D7C400F81029 /* TunnelKitProvider+Interaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4502006D3C800F81029 /* TunnelKitProvider+Interaction.swift */; }; - 0EFEB48A2006D7C400F81029 /* TunnelKitProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4522006D3C800F81029 /* TunnelKitProvider.swift */; }; 0EFEB48D2006D7F300F81029 /* SessionProxy+EncryptionBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB42A2006D3C800F81029 /* SessionProxy+EncryptionBridge.swift */; }; 0EFEB48E2006D7F300F81029 /* SessionProxy+SessionKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB42B2006D3C800F81029 /* SessionProxy+SessionKey.swift */; }; 0EFEB4902006D7F300F81029 /* TunnelInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB42F2006D3C800F81029 /* TunnelInterface.swift */; }; @@ -243,12 +251,6 @@ 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 */; }; - 0EFEB4AB200760EC00F81029 /* MemoryDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4A9200760EB00F81029 /* MemoryDestination.swift */; }; - 0EFEB4AC200760EC00F81029 /* InterfaceObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4AA200760EC00F81029 /* InterfaceObserver.swift */; }; - 0EFEB4AE2007625E00F81029 /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4AD2007625E00F81029 /* Keychain.swift */; }; - 0EFEB4AF2007627700F81029 /* InterfaceObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4AA200760EC00F81029 /* InterfaceObserver.swift */; }; - 0EFEB4B02007627700F81029 /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4AD2007625E00F81029 /* Keychain.swift */; }; - 0EFEB4B12007627700F81029 /* MemoryDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFEB4A9200760EB00F81029 /* MemoryDestination.swift */; }; 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 */; }; @@ -357,6 +359,24 @@ 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 = ""; }; + 0EB03E102290D22A006D03A0 /* ConnectionStrategy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionStrategy.swift; sourceTree = ""; }; + 0EB03E122290D22A006D03A0 /* NETCPInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NETCPInterface.swift; sourceTree = ""; }; + 0EB03E132290D22A006D03A0 /* NETunnelInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NETunnelInterface.swift; sourceTree = ""; }; + 0EB03E142290D22A006D03A0 /* NWTCPConnectionState+Description.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NWTCPConnectionState+Description.swift"; sourceTree = ""; }; + 0EB03E152290D22A006D03A0 /* NEUDPInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NEUDPInterface.swift; sourceTree = ""; }; + 0EB03E162290D22A006D03A0 /* NWUDPSessionState+Description.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NWUDPSessionState+Description.swift"; sourceTree = ""; }; + 0EB03E172290D22A006D03A0 /* DNSResolver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DNSResolver.swift; sourceTree = ""; }; + 0EB03E182290D22A006D03A0 /* TunnelKitProvider+Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TunnelKitProvider+Configuration.swift"; sourceTree = ""; }; + 0EB03E192290D22A006D03A0 /* Keychain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Keychain.swift; sourceTree = ""; }; + 0EB03E1A2290D22A006D03A0 /* MemoryDestination.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MemoryDestination.swift; sourceTree = ""; }; + 0EB03E1B2290D22A006D03A0 /* GenericSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GenericSocket.swift; sourceTree = ""; }; + 0EB03E1C2290D22A006D03A0 /* TunnelKitProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TunnelKitProvider.swift; sourceTree = ""; }; + 0EB03E1D2290D22A006D03A0 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; + 0EB03E1E2290D22A006D03A0 /* TunnelKitProvider+Interaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TunnelKitProvider+Interaction.swift"; sourceTree = ""; }; + 0EB03E1F2290D22A006D03A0 /* InterfaceObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InterfaceObserver.swift; 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 = ""; }; 0EB2B45220F0BB44004233D7 /* EncryptionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionTests.swift; sourceTree = ""; }; 0EB2B45420F0BB53004233D7 /* DataManipulationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataManipulationTests.swift; sourceTree = ""; }; 0EB2B45620F0BD16004233D7 /* RandomTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RandomTests.swift; sourceTree = ""; }; @@ -365,14 +385,6 @@ 0EB2B45C20F0BF41004233D7 /* RawPerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RawPerformanceTests.swift; sourceTree = ""; }; 0EB2B45E20F0C098004233D7 /* EncryptionPerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionPerformanceTests.swift; sourceTree = ""; }; 0EB2B46020F0C0A4004233D7 /* DataPathPerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataPathPerformanceTests.swift; sourceTree = ""; }; - 0EBBF2E42084FE6F00E36B40 /* GenericSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GenericSocket.swift; sourceTree = ""; }; - 0EBBF2EA2085055100E36B40 /* NWUDPSessionState+Description.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NWUDPSessionState+Description.swift"; sourceTree = ""; }; - 0EBBF2EB2085055100E36B40 /* NETunnelInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NETunnelInterface.swift; sourceTree = ""; }; - 0EBBF2EC2085055100E36B40 /* NEUDPInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NEUDPInterface.swift; sourceTree = ""; }; - 0EBBF2F92085061600E36B40 /* NETCPInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NETCPInterface.swift; sourceTree = ""; }; - 0EBBF2FF2085196000E36B40 /* NWTCPConnectionState+Description.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NWTCPConnectionState+Description.swift"; sourceTree = ""; }; - 0EC1BBA420D71190007C4C7B /* DNSResolver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DNSResolver.swift; sourceTree = ""; }; - 0EC1BBA720D7D803007C4C7B /* ConnectionStrategy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionStrategy.swift; 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 = ""; }; @@ -384,7 +396,6 @@ 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 = ""; }; 0EE7A7A020F664AB00B42E6A /* DataPathEncryptionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataPathEncryptionTests.swift; sourceTree = ""; }; - 0EEC49DB20B5E732008FEB91 /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; 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 /* SessionProxy+EncryptionBridge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SessionProxy+EncryptionBridge.swift"; sourceTree = ""; }; @@ -407,7 +418,6 @@ 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 = ""; }; - 0EFEB4422006D3C800F81029 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; 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 = ""; }; @@ -417,12 +427,6 @@ 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 = ""; }; - 0EFEB44F2006D3C800F81029 /* TunnelKitProvider+Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TunnelKitProvider+Configuration.swift"; sourceTree = ""; }; - 0EFEB4502006D3C800F81029 /* TunnelKitProvider+Interaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TunnelKitProvider+Interaction.swift"; sourceTree = ""; }; - 0EFEB4522006D3C800F81029 /* TunnelKitProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TunnelKitProvider.swift; sourceTree = ""; }; - 0EFEB4A9200760EB00F81029 /* MemoryDestination.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MemoryDestination.swift; sourceTree = ""; }; - 0EFEB4AA200760EC00F81029 /* InterfaceObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InterfaceObserver.swift; sourceTree = ""; }; - 0EFEB4AD2007625E00F81029 /* Keychain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Keychain.swift; 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 = ""; }; @@ -572,9 +576,10 @@ 0E17D8041F730DDD009EE129 /* Sources */ = { isa = PBXGroup; children = ( - 0EFEB44D2006D3C800F81029 /* AppExtension */, + 0EB03E0F2290D22A006D03A0 /* AppExtension */, 0EFEB4292006D3C800F81029 /* Core */, 0E58BEDC2240521F006FB157 /* LZO */, + 0EB03E0A2290A338006D03A0 /* OpenVPN */, ); path = Sources; sourceTree = ""; @@ -631,33 +636,17 @@ path = "TunnelKitTests-iOS"; sourceTree = ""; }; - 0EBBF2E32084FDF400E36B40 /* Transport */ = { + 0EB03E0A2290A338006D03A0 /* OpenVPN */ = { isa = PBXGroup; children = ( - 0EBBF2F92085061600E36B40 /* NETCPInterface.swift */, - 0EBBF2EB2085055100E36B40 /* NETunnelInterface.swift */, - 0EBBF2EC2085055100E36B40 /* NEUDPInterface.swift */, - 0EBBF2FF2085196000E36B40 /* NWTCPConnectionState+Description.swift */, - 0EBBF2EA2085055100E36B40 /* NWUDPSessionState+Description.swift */, - ); - path = Transport; - sourceTree = ""; - }; - 0EFEB4292006D3C800F81029 /* Core */ = { - isa = PBXGroup; - children = ( - 0EFEB42E2006D3C800F81029 /* Allocation.h */, - 0EFEB4462006D3C800F81029 /* Allocation.m */, - 0E12B2A421454F7F00B4BAE9 /* BidirectionalState.swift */, 0E58BF4F2240F98E006FB157 /* CompressionAlgorithmNative.h */, 0E245D6B2137F73600B012A2 /* CompressionFramingNative.h */, - 0ECC60D72254981A0020BEAC /* ConfigurationError.swift */, 0E011F872196E2AB00BA59EE /* ConfigurationParser.swift */, - 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */, - 0E39BCE7214B2AB60035E9DE /* ControlPacket.m */, 0E12B2A721456C0200B4BAE9 /* ControlChannel.swift */, 0E12B2AA2145E01700B4BAE9 /* ControlChannelSerializer.swift */, - 0EFEB44A2006D3C800F81029 /* CoreConfiguration.swift */, + 0E39BCE6214B2AB60035E9DE /* ControlPacket.h */, + 0E39BCE7214B2AB60035E9DE /* ControlPacket.m */, + 0EB03E3E2290D310006D03A0 /* CoreConfiguration+OpenVPN.swift */, 0E07596A20EF79AB00F38FD8 /* Crypto.h */, 0E07597C20F0060E00F38FD8 /* CryptoAEAD.h */, 0E07597D20F0060E00F38FD8 /* CryptoAEAD.m */, @@ -669,23 +658,12 @@ 0E3B15C52152B05E00984B17 /* CryptoCTR.h */, 0E3B15C62152B05E00984B17 /* CryptoCTR.m */, 0E07596120EF733F00F38FD8 /* CryptoMacros.h */, - 0EFEB4432006D3C800F81029 /* Data+Manipulation.swift */, 0EFEB4352006D3C800F81029 /* DataPath.h */, 0EFEB44C2006D3C800F81029 /* DataPath.m */, 0EE7A79D20F6488400B42E6A /* DataPathCrypto.h */, - 0E411B992271F90700E0852C /* DNS.h */, - 0E411B9A2271F90700E0852C /* DNS.m */, - 0E011F7C2196D97200BA59EE /* EndpointProtocol.swift */, - 0EFEB4362006D3C800F81029 /* Errors.h */, - 0EFEB44B2006D3C800F81029 /* Errors.m */, - 0EFEB4452006D3C800F81029 /* IOInterface.swift */, - 0EFEB4492006D3C800F81029 /* LinkInterface.swift */, - 0E58BF5522411F37006FB157 /* LZO.h */, - 0E58BF5822411FEF006FB157 /* LZO.m */, - 0EFEB4422006D3C800F81029 /* module.modulemap */, + 0EB03E412291542C006D03A0 /* module.modulemap */, 0EFEB42D2006D3C800F81029 /* MSS.h */, 0EFEB43D2006D3C800F81029 /* MSS.m */, - 0E12B29D21449ADB00B4BAE9 /* NSRegularExpression+Shortcuts.swift */, 0EFEB43E2006D3C800F81029 /* Packet.swift */, 0EE7A79420F61EDC00B42E6A /* PacketMacros.h */, 0EE7A79720F6296F00B42E6A /* PacketMacros.m */, @@ -694,11 +672,6 @@ 0EFEB4382006D3C800F81029 /* ProtocolMacros.swift */, 0EFEB4392006D3C800F81029 /* ReplayProtector.h */, 0EFEB4482006D3C800F81029 /* ReplayProtector.m */, - 0EFB902722788511006405E4 /* RoutingTable.h */, - 0EFB902822788511006405E4 /* RoutingTable.m */, - 0E0B203E2278A85B007A3CB9 /* RoutingTableEntry.h */, - 0E0B203F2278A85B007A3CB9 /* RoutingTableEntry.m */, - 0EFEB4372006D3C800F81029 /* SecureRandom.swift */, 0E0C2123212ED29D008AB282 /* SessionError.swift */, 0EFEB43C2006D3C800F81029 /* SessionProxy.swift */, 0EFEB43A2006D3C800F81029 /* SessionProxy+Authenticator.swift */, @@ -710,10 +683,69 @@ 0EFEB42B2006D3C800F81029 /* SessionProxy+SessionKey.swift */, 0E3E0F202108A8CC00B371C1 /* SessionProxy+SessionReply.swift */, 0E041D082152E6FE0025FE3C /* SessionProxy+TLSWrap.swift */, - 0E011F792196D93600BA59EE /* SocketType.swift */, 0EE3B3E321471C3A0027AB17 /* StaticKey.swift */, 0EFEB4442006D3C800F81029 /* TLSBox.h */, 0EFEB4302006D3C800F81029 /* TLSBox.m */, + ); + path = OpenVPN; + sourceTree = ""; + }; + 0EB03E0F2290D22A006D03A0 /* AppExtension */ = { + isa = PBXGroup; + children = ( + 0EB03E112290D22A006D03A0 /* Transport */, + 0EB03E102290D22A006D03A0 /* ConnectionStrategy.swift */, + 0EB03E172290D22A006D03A0 /* DNSResolver.swift */, + 0EB03E1B2290D22A006D03A0 /* GenericSocket.swift */, + 0EB03E1F2290D22A006D03A0 /* InterfaceObserver.swift */, + 0EB03E192290D22A006D03A0 /* Keychain.swift */, + 0EB03E1A2290D22A006D03A0 /* MemoryDestination.swift */, + 0EB03E1C2290D22A006D03A0 /* TunnelKitProvider.swift */, + 0EB03E182290D22A006D03A0 /* TunnelKitProvider+Configuration.swift */, + 0EB03E1E2290D22A006D03A0 /* TunnelKitProvider+Interaction.swift */, + 0EB03E1D2290D22A006D03A0 /* Utils.swift */, + ); + path = AppExtension; + sourceTree = ""; + }; + 0EB03E112290D22A006D03A0 /* Transport */ = { + isa = PBXGroup; + children = ( + 0EB03E122290D22A006D03A0 /* NETCPInterface.swift */, + 0EB03E132290D22A006D03A0 /* NETunnelInterface.swift */, + 0EB03E142290D22A006D03A0 /* NWTCPConnectionState+Description.swift */, + 0EB03E152290D22A006D03A0 /* NEUDPInterface.swift */, + 0EB03E162290D22A006D03A0 /* NWUDPSessionState+Description.swift */, + ); + path = Transport; + sourceTree = ""; + }; + 0EFEB4292006D3C800F81029 /* Core */ = { + isa = PBXGroup; + children = ( + 0EFEB42E2006D3C800F81029 /* Allocation.h */, + 0EFEB4462006D3C800F81029 /* Allocation.m */, + 0E12B2A421454F7F00B4BAE9 /* BidirectionalState.swift */, + 0ECC60D72254981A0020BEAC /* ConfigurationError.swift */, + 0EFEB44A2006D3C800F81029 /* CoreConfiguration.swift */, + 0EFEB4432006D3C800F81029 /* Data+Manipulation.swift */, + 0E411B992271F90700E0852C /* DNS.h */, + 0E411B9A2271F90700E0852C /* DNS.m */, + 0E011F7C2196D97200BA59EE /* EndpointProtocol.swift */, + 0EFEB4362006D3C800F81029 /* Errors.h */, + 0EFEB44B2006D3C800F81029 /* Errors.m */, + 0EFEB4452006D3C800F81029 /* IOInterface.swift */, + 0EFEB4492006D3C800F81029 /* LinkInterface.swift */, + 0E58BF5522411F37006FB157 /* LZO.h */, + 0E58BF5822411FEF006FB157 /* LZO.m */, + 0EB03E0E2290CF52006D03A0 /* module.modulemap */, + 0E12B29D21449ADB00B4BAE9 /* NSRegularExpression+Shortcuts.swift */, + 0EFB902722788511006405E4 /* RoutingTable.h */, + 0EFB902822788511006405E4 /* RoutingTable.m */, + 0E0B203E2278A85B007A3CB9 /* RoutingTableEntry.h */, + 0E0B203F2278A85B007A3CB9 /* RoutingTableEntry.m */, + 0EFEB4372006D3C800F81029 /* SecureRandom.swift */, + 0E011F792196D93600BA59EE /* SocketType.swift */, 0EFEB42F2006D3C800F81029 /* TunnelInterface.swift */, 0EFEB4412006D3C800F81029 /* ZeroingData.h */, 0EFEB4312006D3C800F81029 /* ZeroingData.m */, @@ -722,24 +754,6 @@ path = Core; sourceTree = ""; }; - 0EFEB44D2006D3C800F81029 /* AppExtension */ = { - isa = PBXGroup; - children = ( - 0EBBF2E32084FDF400E36B40 /* Transport */, - 0EC1BBA720D7D803007C4C7B /* ConnectionStrategy.swift */, - 0EC1BBA420D71190007C4C7B /* DNSResolver.swift */, - 0EBBF2E42084FE6F00E36B40 /* GenericSocket.swift */, - 0EFEB4AA200760EC00F81029 /* InterfaceObserver.swift */, - 0EFEB4AD2007625E00F81029 /* Keychain.swift */, - 0EFEB4A9200760EB00F81029 /* MemoryDestination.swift */, - 0EFEB4522006D3C800F81029 /* TunnelKitProvider.swift */, - 0EFEB44F2006D3C800F81029 /* TunnelKitProvider+Configuration.swift */, - 0EFEB4502006D3C800F81029 /* TunnelKitProvider+Interaction.swift */, - 0EEC49DB20B5E732008FEB91 /* Utils.swift */, - ); - path = AppExtension; - sourceTree = ""; - }; 1B27D1F0B446D5907FAF40E1 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -1231,66 +1245,67 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0EBBF2F5208505D700E36B40 /* NETunnelInterface.swift in Sources */, + 0EB03E202290D22A006D03A0 /* ConnectionStrategy.swift in Sources */, + 0EB03E322290D22A006D03A0 /* MemoryDestination.swift in Sources */, 0E58BF4C22405C2F006FB157 /* StandardLZO.m in Sources */, + 0EB03E222290D22A006D03A0 /* NETCPInterface.swift in Sources */, 0EFEB4732006D3C800F81029 /* LinkInterface.swift in Sources */, - 0EBBF2F8208505DD00E36B40 /* NWUDPSessionState+Description.swift in Sources */, 0EFEB4652006D3C800F81029 /* SessionProxy+Authenticator.swift in Sources */, 0EE7A79820F6296F00B42E6A /* PacketMacros.m in Sources */, - 0EEC49DC20B5E732008FEB91 /* Utils.swift in Sources */, + 0EB03E282290D22A006D03A0 /* NEUDPInterface.swift in Sources */, + 0EB03E2C2290D22A006D03A0 /* DNSResolver.swift in Sources */, 0EFEB4562006D3C800F81029 /* SessionProxy+SessionKey.swift in Sources */, - 0EC1BBA520D71190007C4C7B /* DNSResolver.swift in Sources */, 0E0B20422278A85C007A3CB9 /* RoutingTableEntry.m in Sources */, 0E58BF5922411FEF006FB157 /* LZO.m in Sources */, - 0EFEB4AB200760EC00F81029 /* MemoryDestination.swift in Sources */, 0E12B29E21449ADB00B4BAE9 /* NSRegularExpression+Shortcuts.swift in Sources */, - 0EFEB4AE2007625E00F81029 /* Keychain.swift in Sources */, 0E749F5F2178885500BB2701 /* SessionProxy+PIA.swift in Sources */, - 0EBBF3002085196000E36B40 /* NWTCPConnectionState+Description.swift in Sources */, 0EE3B3E421471C3A0027AB17 /* StaticKey.swift in Sources */, 0EFEB4622006D3C800F81029 /* SecureRandom.swift in Sources */, 0EFEB45D2006D3C800F81029 /* CryptoBox.m in Sources */, 0E3B15C92152B05E00984B17 /* CryptoCTR.m in Sources */, 0E011F7D2196D97200BA59EE /* EndpointProtocol.swift in Sources */, - 0EBBF2FA2085061600E36B40 /* NETCPInterface.swift in Sources */, 0E0C2125212ED29D008AB282 /* SessionError.swift in Sources */, 0E12B2A821456C0200B4BAE9 /* ControlChannel.swift in Sources */, 0EFEB4552006D3C800F81029 /* SessionProxy+EncryptionBridge.swift in Sources */, 0EFEB45C2006D3C800F81029 /* ZeroingData.m in Sources */, 0EFEB4632006D3C800F81029 /* ProtocolMacros.swift in Sources */, - 0EFEB4AC200760EC00F81029 /* InterfaceObserver.swift in Sources */, 0EFB902B22788512006405E4 /* RoutingTable.m in Sources */, 0EFEB46D2006D3C800F81029 /* Data+Manipulation.swift in Sources */, - 0EFEB47B2006D3C800F81029 /* TunnelKitProvider.swift in Sources */, + 0EB03E2A2290D22A006D03A0 /* NWUDPSessionState+Description.swift in Sources */, 0ECE3528212EB7770040F253 /* CryptoContainer.swift in Sources */, 0EFEB4742006D3C800F81029 /* CoreConfiguration.swift in Sources */, 0E07595F20EF6D1400F38FD8 /* CryptoCBC.m in Sources */, - 0EC1BBA820D7D803007C4C7B /* ConnectionStrategy.swift in Sources */, 0EFEB46F2006D3C800F81029 /* IOInterface.swift in Sources */, 0E07598020F0060E00F38FD8 /* CryptoAEAD.m in Sources */, 0E011F882196E2AB00BA59EE /* ConfigurationParser.swift in Sources */, 0E39BCEA214B2AB60035E9DE /* ControlPacket.m in Sources */, + 0EB03E3A2290D22A006D03A0 /* TunnelKitProvider+Interaction.swift in Sources */, 0E12B2AB2145E01700B4BAE9 /* ControlChannelSerializer.swift in Sources */, 0EFEB4662006D3C800F81029 /* ZeroingData.swift in Sources */, - 0EBBF2F3208505D300E36B40 /* NEUDPInterface.swift in Sources */, 0EFEB4682006D3C800F81029 /* MSS.m in Sources */, 0E48AC662271ADA9009B1A98 /* PacketStream.m in Sources */, + 0EB03E382290D22A006D03A0 /* Utils.swift in Sources */, 0E411B9D2271F90700E0852C /* DNS.m in Sources */, 0EFEB45B2006D3C800F81029 /* TLSBox.m in Sources */, - 0EFEB4792006D3C800F81029 /* TunnelKitProvider+Interaction.swift in Sources */, 0E58BF3922405410006FB157 /* minilzo.c in Sources */, + 0EB03E362290D22A006D03A0 /* TunnelKitProvider.swift in Sources */, + 0EB03E2E2290D22A006D03A0 /* TunnelKitProvider+Configuration.swift in Sources */, 0EFEB4702006D3C800F81029 /* Allocation.m in Sources */, 0E041D092152E6FE0025FE3C /* SessionProxy+TLSWrap.swift in Sources */, 0EFEB4672006D3C800F81029 /* SessionProxy.swift in Sources */, + 0EB03E3C2290D22A006D03A0 /* InterfaceObserver.swift in Sources */, 0ED9C8642138139000621BA3 /* SessionProxy+CompressionFraming.swift in Sources */, + 0EB03E262290D22A006D03A0 /* NWTCPConnectionState+Description.swift in Sources */, 0EFEB4722006D3C800F81029 /* ReplayProtector.m in Sources */, - 0EFEB4782006D3C800F81029 /* TunnelKitProvider+Configuration.swift in Sources */, 0E3E0F212108A8CC00B371C1 /* SessionProxy+SessionReply.swift in Sources */, 0ECC60D82254981A0020BEAC /* ConfigurationError.swift in Sources */, 0EFEB4752006D3C800F81029 /* Errors.m in Sources */, 0E58BF532240FAA6006FB157 /* SessionProxy+CompressionAlgorithm.swift in Sources */, + 0EB03E3F2290D310006D03A0 /* CoreConfiguration+OpenVPN.swift in Sources */, + 0EB03E342290D22A006D03A0 /* GenericSocket.swift in Sources */, + 0EB03E302290D22A006D03A0 /* Keychain.swift in Sources */, 0E12B2A521454F7F00B4BAE9 /* BidirectionalState.swift in Sources */, - 0EBBF2E52084FE6F00E36B40 /* GenericSocket.swift in Sources */, + 0EB03E242290D22A006D03A0 /* NETunnelInterface.swift in Sources */, 0EFEB4762006D3C800F81029 /* DataPath.m in Sources */, 0E0C2127212ED29D008AB282 /* SessionProxy+Configuration.swift in Sources */, 0EFEB4692006D3C800F81029 /* Packet.swift in Sources */, @@ -1303,66 +1318,67 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0EBBF2F6208505D700E36B40 /* NETunnelInterface.swift in Sources */, + 0EB03E212290D22A006D03A0 /* ConnectionStrategy.swift in Sources */, + 0EB03E332290D22A006D03A0 /* MemoryDestination.swift in Sources */, 0E58BF4D22405C2F006FB157 /* StandardLZO.m in Sources */, + 0EB03E232290D22A006D03A0 /* NETCPInterface.swift in Sources */, 0EFEB4A12006D7F300F81029 /* LinkInterface.swift in Sources */, - 0EFEB4872006D7C400F81029 /* TunnelKitProvider+Configuration.swift in Sources */, - 0EBBF2F7208505DD00E36B40 /* NWUDPSessionState+Description.swift in Sources */, - 0EFEB4882006D7C400F81029 /* TunnelKitProvider+Interaction.swift in Sources */, 0EE7A79920F6296F00B42E6A /* PacketMacros.m in Sources */, - 0EEC49DD20B5E732008FEB91 /* Utils.swift in Sources */, - 0EFEB4B12007627700F81029 /* MemoryDestination.swift in Sources */, 0E0B20432278A85C007A3CB9 /* RoutingTableEntry.m in Sources */, + 0EB03E292290D22A006D03A0 /* NEUDPInterface.swift in Sources */, + 0EB03E2D2290D22A006D03A0 /* DNSResolver.swift in Sources */, 0E58BF5A22411FEF006FB157 /* LZO.m in Sources */, - 0EC1BBA620D712DE007C4C7B /* DNSResolver.swift in Sources */, 0E12B29F21449ADB00B4BAE9 /* NSRegularExpression+Shortcuts.swift in Sources */, 0EFEB4A02006D7F300F81029 /* ReplayProtector.m in Sources */, 0E749F602178885500BB2701 /* SessionProxy+PIA.swift in Sources */, 0EFEB4992006D7F300F81029 /* SessionProxy.swift in Sources */, 0EE3B3E521471C3A0027AB17 /* StaticKey.swift in Sources */, - 0EBBF3012085196000E36B40 /* NWTCPConnectionState+Description.swift in Sources */, 0EFEB4962006D7F300F81029 /* ProtocolMacros.swift in Sources */, 0E3B15CA2152B05E00984B17 /* CryptoCTR.m in Sources */, 0E011F7E2196D97200BA59EE /* EndpointProtocol.swift in Sources */, - 0EFEB48A2006D7C400F81029 /* TunnelKitProvider.swift in Sources */, 0E0C2126212ED29D008AB282 /* SessionError.swift in Sources */, 0E12B2A921456C0200B4BAE9 /* ControlChannel.swift in Sources */, - 0EBBF2FB2085061600E36B40 /* NETCPInterface.swift in Sources */, 0EFEB4982006D7F300F81029 /* ZeroingData.swift in Sources */, 0EFEB4A32006D7F300F81029 /* Errors.m in Sources */, 0EFEB4A22006D7F300F81029 /* CoreConfiguration.swift in Sources */, 0EFB902C22788512006405E4 /* RoutingTable.m in Sources */, 0EFEB4952006D7F300F81029 /* SecureRandom.swift in Sources */, 0EFEB49A2006D7F300F81029 /* MSS.m in Sources */, + 0EB03E2B2290D22A006D03A0 /* NWUDPSessionState+Description.swift in Sources */, 0ECE352A212EB88E0040F253 /* CryptoContainer.swift in Sources */, 0EFEB48D2006D7F300F81029 /* SessionProxy+EncryptionBridge.swift in Sources */, 0EFEB4922006D7F300F81029 /* ZeroingData.m in Sources */, 0E07596020EF6D1400F38FD8 /* CryptoCBC.m in Sources */, - 0EC1BBA920D7D803007C4C7B /* ConnectionStrategy.swift in Sources */, 0EFEB4932006D7F300F81029 /* CryptoBox.m in Sources */, 0E011F892196E2AB00BA59EE /* ConfigurationParser.swift in Sources */, 0E39BCEB214B2AB60035E9DE /* ControlPacket.m in Sources */, + 0EB03E3B2290D22A006D03A0 /* TunnelKitProvider+Interaction.swift in Sources */, 0E12B2AC2145E01700B4BAE9 /* ControlChannelSerializer.swift in Sources */, 0E07598120F0060E00F38FD8 /* CryptoAEAD.m in Sources */, 0EFEB49C2006D7F300F81029 /* Data+Manipulation.swift in Sources */, - 0EBBF2F4208505D400E36B40 /* NEUDPInterface.swift in Sources */, 0E48AC672271ADA9009B1A98 /* PacketStream.m in Sources */, + 0EB03E392290D22A006D03A0 /* Utils.swift in Sources */, 0E411B9E2271F90700E0852C /* DNS.m in Sources */, 0EFEB4902006D7F300F81029 /* TunnelInterface.swift in Sources */, 0EFEB49E2006D7F300F81029 /* Allocation.m in Sources */, + 0EB03E372290D22A006D03A0 /* TunnelKitProvider.swift in Sources */, + 0EB03E2F2290D22A006D03A0 /* TunnelKitProvider+Configuration.swift in Sources */, 0E58BF3A22405410006FB157 /* minilzo.c in Sources */, - 0EFEB4B02007627700F81029 /* Keychain.swift in Sources */, 0E041D0A2152E6FE0025FE3C /* SessionProxy+TLSWrap.swift in Sources */, 0EFEB48E2006D7F300F81029 /* SessionProxy+SessionKey.swift in Sources */, + 0EB03E3D2290D22A006D03A0 /* InterfaceObserver.swift in Sources */, 0ED9C8652138139000621BA3 /* SessionProxy+CompressionFraming.swift in Sources */, - 0EFEB4AF2007627700F81029 /* InterfaceObserver.swift in Sources */, + 0EB03E272290D22A006D03A0 /* NWTCPConnectionState+Description.swift in Sources */, 0EFEB4A42006D7F300F81029 /* DataPath.m in Sources */, - 0EBBF2E62084FE6F00E36B40 /* GenericSocket.swift in Sources */, 0ECC60D92254981A0020BEAC /* ConfigurationError.swift in Sources */, 0E3E0F222108A8CC00B371C1 /* SessionProxy+SessionReply.swift in Sources */, 0E58BF542240FAA6006FB157 /* SessionProxy+CompressionAlgorithm.swift in Sources */, 0E12B2A621454F7F00B4BAE9 /* BidirectionalState.swift in Sources */, + 0EB03E402290D310006D03A0 /* CoreConfiguration+OpenVPN.swift in Sources */, + 0EB03E352290D22A006D03A0 /* GenericSocket.swift in Sources */, + 0EB03E312290D22A006D03A0 /* Keychain.swift in Sources */, 0EFEB4912006D7F300F81029 /* TLSBox.m in Sources */, + 0EB03E252290D22A006D03A0 /* NETunnelInterface.swift in Sources */, 0EFEB49D2006D7F300F81029 /* IOInterface.swift in Sources */, 0E0C2128212ED29D008AB282 /* SessionProxy+Configuration.swift in Sources */, 0EFEB4972006D7F300F81029 /* SessionProxy+Authenticator.swift in Sources */, @@ -1532,7 +1548,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 538; + CURRENT_PROJECT_VERSION = 567; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -1596,7 +1612,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 538; + CURRENT_PROJECT_VERSION = 567; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1629,7 +1645,7 @@ DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 538; + DYLIB_CURRENT_VERSION = 567; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "$(SRCROOT)/TunnelKit-iOS/Info.plist"; @@ -1653,7 +1669,7 @@ DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 538; + DYLIB_CURRENT_VERSION = 567; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "$(SRCROOT)/TunnelKit-iOS/Info.plist"; @@ -1677,7 +1693,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 538; + DYLIB_CURRENT_VERSION = 567; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; INFOPLIST_FILE = "$(SRCROOT)/TunnelKit-macOS/Info.plist"; @@ -1701,7 +1717,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 538; + DYLIB_CURRENT_VERSION = 567; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; INFOPLIST_FILE = "$(SRCROOT)/TunnelKit-macOS/Info.plist"; diff --git a/TunnelKit/Sources/AppExtension/Transport/NETCPInterface.swift b/TunnelKit/Sources/AppExtension/Transport/NETCPInterface.swift index c824b34..1039192 100644 --- a/TunnelKit/Sources/AppExtension/Transport/NETCPInterface.swift +++ b/TunnelKit/Sources/AppExtension/Transport/NETCPInterface.swift @@ -37,7 +37,7 @@ import Foundation import NetworkExtension import SwiftyBeaver -import __TunnelKitNative +import __TunnelKitOpenVPN private let log = SwiftyBeaver.self diff --git a/TunnelKit/Sources/AppExtension/TunnelKitProvider.swift b/TunnelKit/Sources/AppExtension/TunnelKitProvider.swift index 90f7023..2ef5a0e 100644 --- a/TunnelKit/Sources/AppExtension/TunnelKitProvider.swift +++ b/TunnelKit/Sources/AppExtension/TunnelKitProvider.swift @@ -36,7 +36,7 @@ import NetworkExtension import SwiftyBeaver -import __TunnelKitNative +import __TunnelKitCore private let log = SwiftyBeaver.self diff --git a/TunnelKit/Sources/Core/CoreConfiguration.swift b/TunnelKit/Sources/Core/CoreConfiguration.swift index 531d3ef..2ccf7d5 100644 --- a/TunnelKit/Sources/Core/CoreConfiguration.swift +++ b/TunnelKit/Sources/Core/CoreConfiguration.swift @@ -35,7 +35,6 @@ // import Foundation -import __TunnelKitNative class CoreConfiguration { static let identifier = "com.algoritmico.TunnelKit" @@ -54,60 +53,11 @@ class CoreConfiguration { // return "\(version) (\(build))" return info["CFBundleShortVersionString"] as? String ?? "" }() - - // MARK: Session // configurable static var masksPrivateData = true static let logsSensitiveData = false - - static let usesReplayProtection = true - - static let tickInterval = 0.2 - - static let pushRequestInterval = 2.0 - - static let pingTimeout = 120.0 - - static let retransmissionLimit = 0.1 - - static let softResetDelay = 5.0 - - static let softNegotiationTimeout = 120.0 - - // MARK: Authentication - - static let peerInfo: String = { - var info = [ - "IV_VER=2.4", - "IV_PLAT=mac", - "IV_UI_VER=\(identifier) \(version)", - "IV_PROTO=2", - "IV_NCP=2", - "IV_SSL=\(CryptoBox.version())", - "IV_LZO_STUB=1", - ] - if LZOIsSupported() { - info.append("IV_LZO=1") - } - info.append("") - return info.joined(separator: "\n") - }() - - static let randomLength = 32 - - // MARK: Keys - - static let label1 = "OpenVPN master secret" - - static let label2 = "OpenVPN key expansion" - - static let preMasterLength = 48 - - static let keyLength = 64 - - static let keysCount = 4 } extension CustomStringConvertible { diff --git a/TunnelKit/Sources/Core/SecureRandom.swift b/TunnelKit/Sources/Core/SecureRandom.swift index e3f522b..e816b61 100644 --- a/TunnelKit/Sources/Core/SecureRandom.swift +++ b/TunnelKit/Sources/Core/SecureRandom.swift @@ -36,7 +36,7 @@ import Foundation import Security.SecRandom -import __TunnelKitNative +import __TunnelKitCore enum SecureRandomError: Error { case randomGenerator diff --git a/TunnelKit/Sources/Core/ZeroingData.swift b/TunnelKit/Sources/Core/ZeroingData.swift index afcf3b6..8eb30b2 100644 --- a/TunnelKit/Sources/Core/ZeroingData.swift +++ b/TunnelKit/Sources/Core/ZeroingData.swift @@ -35,7 +35,7 @@ // import Foundation -import __TunnelKitNative +import __TunnelKitCore func Z() -> ZeroingData { return ZeroingData() diff --git a/TunnelKit/Sources/Core/module.modulemap b/TunnelKit/Sources/Core/module.modulemap index 8f407c3..f0b0d5d 100644 --- a/TunnelKit/Sources/Core/module.modulemap +++ b/TunnelKit/Sources/Core/module.modulemap @@ -34,23 +34,11 @@ // 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. // -module __TunnelKitNative { - header "Errors.h" - header "ZeroingData.h" - header "TLSBox.h" - header "Crypto.h" - header "CryptoBox.h" - header "MSS.h" - header "PacketMacros.h" - header "PacketStream.h" - header "ControlPacket.h" - header "ReplayProtector.h" - header "CompressionFramingNative.h" - header "CompressionAlgorithmNative.h" - header "DataPath.h" - header "DataPathCrypto.h" +module __TunnelKitCore { header "DNS.h" + header "Errors.h" header "LZO.h" header "RoutingTable.h" + header "ZeroingData.h" export * } diff --git a/TunnelKit/Sources/Core/CompressionAlgorithmNative.h b/TunnelKit/Sources/OpenVPN/CompressionAlgorithmNative.h similarity index 100% rename from TunnelKit/Sources/Core/CompressionAlgorithmNative.h rename to TunnelKit/Sources/OpenVPN/CompressionAlgorithmNative.h diff --git a/TunnelKit/Sources/Core/CompressionFramingNative.h b/TunnelKit/Sources/OpenVPN/CompressionFramingNative.h similarity index 100% rename from TunnelKit/Sources/Core/CompressionFramingNative.h rename to TunnelKit/Sources/OpenVPN/CompressionFramingNative.h diff --git a/TunnelKit/Sources/Core/ConfigurationParser.swift b/TunnelKit/Sources/OpenVPN/ConfigurationParser.swift similarity index 99% rename from TunnelKit/Sources/Core/ConfigurationParser.swift rename to TunnelKit/Sources/OpenVPN/ConfigurationParser.swift index 20a8ca3..6c4c62e 100644 --- a/TunnelKit/Sources/Core/ConfigurationParser.swift +++ b/TunnelKit/Sources/OpenVPN/ConfigurationParser.swift @@ -25,7 +25,7 @@ import Foundation import SwiftyBeaver -import __TunnelKitNative +import __TunnelKitCore private let log = SwiftyBeaver.self diff --git a/TunnelKit/Sources/Core/ControlChannel.swift b/TunnelKit/Sources/OpenVPN/ControlChannel.swift similarity index 98% rename from TunnelKit/Sources/Core/ControlChannel.swift rename to TunnelKit/Sources/OpenVPN/ControlChannel.swift index fadfce3..fd9edd6 100644 --- a/TunnelKit/Sources/Core/ControlChannel.swift +++ b/TunnelKit/Sources/OpenVPN/ControlChannel.swift @@ -24,8 +24,9 @@ // import Foundation -import __TunnelKitNative import SwiftyBeaver +import __TunnelKitCore +import __TunnelKitOpenVPN private let log = SwiftyBeaver.self @@ -163,7 +164,7 @@ class ControlChannel { for packet in queue.outbound { if let sentDate = packet.sentDate { let timeAgo = -sentDate.timeIntervalSinceNow - guard (timeAgo >= CoreConfiguration.retransmissionLimit) else { + guard (timeAgo >= CoreConfiguration.OpenVPN.retransmissionLimit) else { log.debug("Control: Skip writing packet with packetId \(packet.packetId) (sent on \(sentDate), \(timeAgo) seconds ago)") continue } diff --git a/TunnelKit/Sources/Core/ControlChannelSerializer.swift b/TunnelKit/Sources/OpenVPN/ControlChannelSerializer.swift similarity index 99% rename from TunnelKit/Sources/Core/ControlChannelSerializer.swift rename to TunnelKit/Sources/OpenVPN/ControlChannelSerializer.swift index 2b31702..bd117a2 100644 --- a/TunnelKit/Sources/Core/ControlChannelSerializer.swift +++ b/TunnelKit/Sources/OpenVPN/ControlChannelSerializer.swift @@ -24,8 +24,9 @@ // import Foundation -import __TunnelKitNative import SwiftyBeaver +import __TunnelKitCore +import __TunnelKitOpenVPN private let log = SwiftyBeaver.self diff --git a/TunnelKit/Sources/Core/ControlPacket.h b/TunnelKit/Sources/OpenVPN/ControlPacket.h similarity index 100% rename from TunnelKit/Sources/Core/ControlPacket.h rename to TunnelKit/Sources/OpenVPN/ControlPacket.h diff --git a/TunnelKit/Sources/Core/ControlPacket.m b/TunnelKit/Sources/OpenVPN/ControlPacket.m similarity index 99% rename from TunnelKit/Sources/Core/ControlPacket.m rename to TunnelKit/Sources/OpenVPN/ControlPacket.m index 90db26e..60c0ab0 100644 --- a/TunnelKit/Sources/Core/ControlPacket.m +++ b/TunnelKit/Sources/OpenVPN/ControlPacket.m @@ -24,6 +24,7 @@ // #import "ControlPacket.h" +#import "Crypto.h" @implementation ControlPacket diff --git a/TunnelKit/Sources/OpenVPN/CoreConfiguration+OpenVPN.swift b/TunnelKit/Sources/OpenVPN/CoreConfiguration+OpenVPN.swift new file mode 100644 index 0000000..c23467d --- /dev/null +++ b/TunnelKit/Sources/OpenVPN/CoreConfiguration+OpenVPN.swift @@ -0,0 +1,93 @@ +// +// CoreConfiguration+OpenVPN.swift +// TunnelKit +// +// Created by Davide De Rosa on 5/19/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 . +// +// 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 +import __TunnelKitCore +import __TunnelKitOpenVPN + +extension CoreConfiguration { + struct OpenVPN { + + // MARK: Session + + static let usesReplayProtection = true + + static let tickInterval = 0.2 + + static let pushRequestInterval = 2.0 + + static let pingTimeout = 120.0 + + static let retransmissionLimit = 0.1 + + static let softResetDelay = 5.0 + + static let softNegotiationTimeout = 120.0 + + // MARK: Authentication + + static let peerInfo: String = { + var info = [ + "IV_VER=2.4", + "IV_PLAT=mac", + "IV_UI_VER=\(identifier) \(version)", + "IV_PROTO=2", + "IV_NCP=2", + "IV_SSL=\(CryptoBox.version())", + "IV_LZO_STUB=1", + ] + if LZOIsSupported() { + info.append("IV_LZO=1") + } + info.append("") + return info.joined(separator: "\n") + }() + + static let randomLength = 32 + + // MARK: Keys + + static let label1 = "OpenVPN master secret" + + static let label2 = "OpenVPN key expansion" + + static let preMasterLength = 48 + + static let keyLength = 64 + + static let keysCount = 4 + } +} diff --git a/TunnelKit/Sources/Core/Crypto.h b/TunnelKit/Sources/OpenVPN/Crypto.h similarity index 99% rename from TunnelKit/Sources/Core/Crypto.h rename to TunnelKit/Sources/OpenVPN/Crypto.h index 707e806..73057dc 100644 --- a/TunnelKit/Sources/Core/Crypto.h +++ b/TunnelKit/Sources/OpenVPN/Crypto.h @@ -36,10 +36,9 @@ #import -#import "ZeroingData.h" - NS_ASSUME_NONNULL_BEGIN +@class ZeroingData; @protocol DataPathEncrypter; @protocol DataPathDecrypter; diff --git a/TunnelKit/Sources/Core/CryptoAEAD.h b/TunnelKit/Sources/OpenVPN/CryptoAEAD.h similarity index 100% rename from TunnelKit/Sources/Core/CryptoAEAD.h rename to TunnelKit/Sources/OpenVPN/CryptoAEAD.h diff --git a/TunnelKit/Sources/Core/CryptoAEAD.m b/TunnelKit/Sources/OpenVPN/CryptoAEAD.m similarity index 99% rename from TunnelKit/Sources/Core/CryptoAEAD.m rename to TunnelKit/Sources/OpenVPN/CryptoAEAD.m index 48de458..ebef5ca 100644 --- a/TunnelKit/Sources/Core/CryptoAEAD.m +++ b/TunnelKit/Sources/OpenVPN/CryptoAEAD.m @@ -40,6 +40,8 @@ #import "CryptoAEAD.h" #import "CryptoMacros.h" +#import "PacketMacros.h" +#import "ZeroingData.h" #import "Allocation.h" #import "Errors.h" diff --git a/TunnelKit/Sources/Core/CryptoBox.h b/TunnelKit/Sources/OpenVPN/CryptoBox.h similarity index 99% rename from TunnelKit/Sources/Core/CryptoBox.h rename to TunnelKit/Sources/OpenVPN/CryptoBox.h index 5aa7b4c..e5e3b4e 100644 --- a/TunnelKit/Sources/Core/CryptoBox.h +++ b/TunnelKit/Sources/OpenVPN/CryptoBox.h @@ -36,10 +36,9 @@ #import -#import "ZeroingData.h" - NS_ASSUME_NONNULL_BEGIN +@class ZeroingData; @protocol Encrypter; @protocol Decrypter; diff --git a/TunnelKit/Sources/Core/CryptoBox.m b/TunnelKit/Sources/OpenVPN/CryptoBox.m similarity index 100% rename from TunnelKit/Sources/Core/CryptoBox.m rename to TunnelKit/Sources/OpenVPN/CryptoBox.m diff --git a/TunnelKit/Sources/Core/CryptoCBC.h b/TunnelKit/Sources/OpenVPN/CryptoCBC.h similarity index 100% rename from TunnelKit/Sources/Core/CryptoCBC.h rename to TunnelKit/Sources/OpenVPN/CryptoCBC.h diff --git a/TunnelKit/Sources/Core/CryptoCBC.m b/TunnelKit/Sources/OpenVPN/CryptoCBC.m similarity index 99% rename from TunnelKit/Sources/Core/CryptoCBC.m rename to TunnelKit/Sources/OpenVPN/CryptoCBC.m index 4b615f4..26f19e8 100644 --- a/TunnelKit/Sources/Core/CryptoCBC.m +++ b/TunnelKit/Sources/OpenVPN/CryptoCBC.m @@ -41,6 +41,7 @@ #import "CryptoCBC.h" #import "CryptoMacros.h" #import "PacketMacros.h" +#import "ZeroingData.h" #import "Allocation.h" #import "Errors.h" diff --git a/TunnelKit/Sources/Core/CryptoCTR.h b/TunnelKit/Sources/OpenVPN/CryptoCTR.h similarity index 100% rename from TunnelKit/Sources/Core/CryptoCTR.h rename to TunnelKit/Sources/OpenVPN/CryptoCTR.h diff --git a/TunnelKit/Sources/Core/CryptoCTR.m b/TunnelKit/Sources/OpenVPN/CryptoCTR.m similarity index 99% rename from TunnelKit/Sources/Core/CryptoCTR.m rename to TunnelKit/Sources/OpenVPN/CryptoCTR.m index da61637..dd13dfa 100644 --- a/TunnelKit/Sources/Core/CryptoCTR.m +++ b/TunnelKit/Sources/OpenVPN/CryptoCTR.m @@ -30,6 +30,7 @@ #import "CryptoCTR.h" #import "CryptoMacros.h" #import "PacketMacros.h" +#import "ZeroingData.h" #import "Allocation.h" #import "Errors.h" diff --git a/TunnelKit/Sources/Core/CryptoContainer.swift b/TunnelKit/Sources/OpenVPN/CryptoContainer.swift similarity index 99% rename from TunnelKit/Sources/Core/CryptoContainer.swift rename to TunnelKit/Sources/OpenVPN/CryptoContainer.swift index 3c20c8b..44a14af 100644 --- a/TunnelKit/Sources/Core/CryptoContainer.swift +++ b/TunnelKit/Sources/OpenVPN/CryptoContainer.swift @@ -35,7 +35,7 @@ // import Foundation -import __TunnelKitNative +import __TunnelKitOpenVPN /// Represents a cryptographic container in PEM format. public struct CryptoContainer: Equatable { diff --git a/TunnelKit/Sources/Core/CryptoMacros.h b/TunnelKit/Sources/OpenVPN/CryptoMacros.h similarity index 100% rename from TunnelKit/Sources/Core/CryptoMacros.h rename to TunnelKit/Sources/OpenVPN/CryptoMacros.h diff --git a/TunnelKit/Sources/Core/DataPath.h b/TunnelKit/Sources/OpenVPN/DataPath.h similarity index 83% rename from TunnelKit/Sources/Core/DataPath.h rename to TunnelKit/Sources/OpenVPN/DataPath.h index 97f861b..041ddb7 100644 --- a/TunnelKit/Sources/Core/DataPath.h +++ b/TunnelKit/Sources/OpenVPN/DataPath.h @@ -36,6 +36,9 @@ #import +#import "CompressionFramingNative.h" +#import "CompressionAlgorithmNative.h" + NS_ASSUME_NONNULL_BEGIN @protocol DataPathEncrypter; @@ -48,12 +51,12 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) uint32_t maxPacketId; - (instancetype)initWithEncrypter:(id)encrypter - decrypter:(id)decrypter - peerId:(uint32_t)peerId // 24-bit, discard most significant byte - compressionFraming:(CompressionFramingNative)compressionFraming - compressionAlgorithm:(CompressionAlgorithmNative)compressionAlgorithm - maxPackets:(NSInteger)maxPackets - usesReplayProtection:(BOOL)usesReplayProtection; + decrypter:(id)decrypter + peerId:(uint32_t)peerId // 24-bit, discard most significant byte + compressionFraming:(CompressionFramingNative)compressionFraming + compressionAlgorithm:(CompressionAlgorithmNative)compressionAlgorithm + maxPackets:(NSInteger)maxPackets + usesReplayProtection:(BOOL)usesReplayProtection; - (nullable NSArray *)encryptPackets:(NSArray *)packets key:(uint8_t)key error:(NSError **)error; - (nullable NSArray *)decryptPackets:(NSArray *)packets keepAlive:(nullable bool *)keepAlive error:(NSError **)error; diff --git a/TunnelKit/Sources/Core/DataPath.m b/TunnelKit/Sources/OpenVPN/DataPath.m similarity index 99% rename from TunnelKit/Sources/Core/DataPath.m rename to TunnelKit/Sources/OpenVPN/DataPath.m index 4d3a59f..22faaf7 100644 --- a/TunnelKit/Sources/Core/DataPath.m +++ b/TunnelKit/Sources/OpenVPN/DataPath.m @@ -38,6 +38,7 @@ #import "DataPath.h" #import "DataPathCrypto.h" +#import "PacketMacros.h" #import "MSS.h" #import "ReplayProtector.h" #import "LZO.h" diff --git a/TunnelKit/Sources/Core/DataPathCrypto.h b/TunnelKit/Sources/OpenVPN/DataPathCrypto.h similarity index 100% rename from TunnelKit/Sources/Core/DataPathCrypto.h rename to TunnelKit/Sources/OpenVPN/DataPathCrypto.h diff --git a/TunnelKit/Sources/Core/MSS.h b/TunnelKit/Sources/OpenVPN/MSS.h similarity index 98% rename from TunnelKit/Sources/Core/MSS.h rename to TunnelKit/Sources/OpenVPN/MSS.h index 00eddf2..839f90f 100644 --- a/TunnelKit/Sources/Core/MSS.h +++ b/TunnelKit/Sources/OpenVPN/MSS.h @@ -35,5 +35,6 @@ // #import +#import void MSSFix(uint8_t *data, NSInteger data_len); diff --git a/TunnelKit/Sources/Core/MSS.m b/TunnelKit/Sources/OpenVPN/MSS.m similarity index 100% rename from TunnelKit/Sources/Core/MSS.m rename to TunnelKit/Sources/OpenVPN/MSS.m diff --git a/TunnelKit/Sources/Core/Packet.swift b/TunnelKit/Sources/OpenVPN/Packet.swift similarity index 98% rename from TunnelKit/Sources/Core/Packet.swift rename to TunnelKit/Sources/OpenVPN/Packet.swift index e8d5aeb..24264b0 100644 --- a/TunnelKit/Sources/Core/Packet.swift +++ b/TunnelKit/Sources/OpenVPN/Packet.swift @@ -35,9 +35,7 @@ // import Foundation -import __TunnelKitNative - -// TODO: convert to C for efficiency +import __TunnelKitOpenVPN ///// Reads and writes packets as a stream. Useful for stream-oriented links (e.g TCP/IP). //public class PacketStream { diff --git a/TunnelKit/Sources/Core/PacketMacros.h b/TunnelKit/Sources/OpenVPN/PacketMacros.h similarity index 100% rename from TunnelKit/Sources/Core/PacketMacros.h rename to TunnelKit/Sources/OpenVPN/PacketMacros.h diff --git a/TunnelKit/Sources/Core/PacketMacros.m b/TunnelKit/Sources/OpenVPN/PacketMacros.m similarity index 100% rename from TunnelKit/Sources/Core/PacketMacros.m rename to TunnelKit/Sources/OpenVPN/PacketMacros.m diff --git a/TunnelKit/Sources/Core/PacketStream.h b/TunnelKit/Sources/OpenVPN/PacketStream.h similarity index 100% rename from TunnelKit/Sources/Core/PacketStream.h rename to TunnelKit/Sources/OpenVPN/PacketStream.h diff --git a/TunnelKit/Sources/Core/PacketStream.m b/TunnelKit/Sources/OpenVPN/PacketStream.m similarity index 100% rename from TunnelKit/Sources/Core/PacketStream.m rename to TunnelKit/Sources/OpenVPN/PacketStream.m diff --git a/TunnelKit/Sources/Core/ProtocolMacros.swift b/TunnelKit/Sources/OpenVPN/ProtocolMacros.swift similarity index 100% rename from TunnelKit/Sources/Core/ProtocolMacros.swift rename to TunnelKit/Sources/OpenVPN/ProtocolMacros.swift diff --git a/TunnelKit/Sources/Core/ReplayProtector.h b/TunnelKit/Sources/OpenVPN/ReplayProtector.h similarity index 100% rename from TunnelKit/Sources/Core/ReplayProtector.h rename to TunnelKit/Sources/OpenVPN/ReplayProtector.h diff --git a/TunnelKit/Sources/Core/ReplayProtector.m b/TunnelKit/Sources/OpenVPN/ReplayProtector.m similarity index 100% rename from TunnelKit/Sources/Core/ReplayProtector.m rename to TunnelKit/Sources/OpenVPN/ReplayProtector.m diff --git a/TunnelKit/Sources/Core/SessionError.swift b/TunnelKit/Sources/OpenVPN/SessionError.swift similarity index 99% rename from TunnelKit/Sources/Core/SessionError.swift rename to TunnelKit/Sources/OpenVPN/SessionError.swift index d8c61a0..1435825 100644 --- a/TunnelKit/Sources/Core/SessionError.swift +++ b/TunnelKit/Sources/OpenVPN/SessionError.swift @@ -35,7 +35,7 @@ // import Foundation -import __TunnelKitNative +import __TunnelKitCore /// The possible errors raised/thrown during `SessionProxy` operation. public enum SessionError: String, Error { diff --git a/TunnelKit/Sources/Core/SessionProxy+Authenticator.swift b/TunnelKit/Sources/OpenVPN/SessionProxy+Authenticator.swift similarity index 94% rename from TunnelKit/Sources/Core/SessionProxy+Authenticator.swift rename to TunnelKit/Sources/OpenVPN/SessionProxy+Authenticator.swift index e35a388..3bfb681 100644 --- a/TunnelKit/Sources/Core/SessionProxy+Authenticator.swift +++ b/TunnelKit/Sources/OpenVPN/SessionProxy+Authenticator.swift @@ -36,7 +36,8 @@ import Foundation import SwiftyBeaver -import __TunnelKitNative +import __TunnelKitCore +import __TunnelKitOpenVPN private let log = SwiftyBeaver.self @@ -68,9 +69,9 @@ extension SessionProxy { var withLocalOptions: Bool init(_ username: String?, _ password: String?) throws { - preMaster = try SecureRandom.safeData(length: CoreConfiguration.preMasterLength) - random1 = try SecureRandom.safeData(length: CoreConfiguration.randomLength) - random2 = try SecureRandom.safeData(length: CoreConfiguration.randomLength) + preMaster = try SecureRandom.safeData(length: CoreConfiguration.OpenVPN.preMasterLength) + random1 = try SecureRandom.safeData(length: CoreConfiguration.OpenVPN.randomLength) + random2 = try SecureRandom.safeData(length: CoreConfiguration.OpenVPN.randomLength) // XXX: not 100% secure, can't erase input username/password if let username = username, let password = password { @@ -144,7 +145,7 @@ extension SessionProxy { } // peer info - raw.appendSized(Z(CoreConfiguration.peerInfo, nullTerminated: true)) + raw.appendSized(Z(CoreConfiguration.OpenVPN.peerInfo, nullTerminated: true)) if CoreConfiguration.logsSensitiveData { log.debug("TLS.auth: Put plaintext (\(raw.count) bytes): \(raw.toHex())") @@ -165,7 +166,7 @@ extension SessionProxy { let prefixLength = ProtocolMacros.tlsPrefix.count // TLS prefix + random (x2) + opts length [+ opts] - guard (controlBuffer.count >= prefixLength + 2 * CoreConfiguration.randomLength + 2) else { + guard (controlBuffer.count >= prefixLength + 2 * CoreConfiguration.OpenVPN.randomLength + 2) else { return false } @@ -176,11 +177,11 @@ extension SessionProxy { var offset = ProtocolMacros.tlsPrefix.count - let serverRandom1 = controlBuffer.withOffset(offset, count: CoreConfiguration.randomLength) - offset += CoreConfiguration.randomLength + let serverRandom1 = controlBuffer.withOffset(offset, count: CoreConfiguration.OpenVPN.randomLength) + offset += CoreConfiguration.OpenVPN.randomLength - let serverRandom2 = controlBuffer.withOffset(offset, count: CoreConfiguration.randomLength) - offset += CoreConfiguration.randomLength + let serverRandom2 = controlBuffer.withOffset(offset, count: CoreConfiguration.OpenVPN.randomLength) + offset += CoreConfiguration.OpenVPN.randomLength let serverOptsLength = Int(controlBuffer.networkUInt16Value(fromOffset: offset)) offset += 2 diff --git a/TunnelKit/Sources/Core/SessionProxy+CompressionAlgorithm.swift b/TunnelKit/Sources/OpenVPN/SessionProxy+CompressionAlgorithm.swift similarity index 98% rename from TunnelKit/Sources/Core/SessionProxy+CompressionAlgorithm.swift rename to TunnelKit/Sources/OpenVPN/SessionProxy+CompressionAlgorithm.swift index e7dfc73..89f4a14 100644 --- a/TunnelKit/Sources/Core/SessionProxy+CompressionAlgorithm.swift +++ b/TunnelKit/Sources/OpenVPN/SessionProxy+CompressionAlgorithm.swift @@ -24,7 +24,7 @@ // import Foundation -import __TunnelKitNative +import __TunnelKitOpenVPN extension SessionProxy { diff --git a/TunnelKit/Sources/Core/SessionProxy+CompressionFraming.swift b/TunnelKit/Sources/OpenVPN/SessionProxy+CompressionFraming.swift similarity index 98% rename from TunnelKit/Sources/Core/SessionProxy+CompressionFraming.swift rename to TunnelKit/Sources/OpenVPN/SessionProxy+CompressionFraming.swift index f4ce34d..39644d6 100644 --- a/TunnelKit/Sources/Core/SessionProxy+CompressionFraming.swift +++ b/TunnelKit/Sources/OpenVPN/SessionProxy+CompressionFraming.swift @@ -24,7 +24,7 @@ // import Foundation -import __TunnelKitNative +import __TunnelKitOpenVPN extension SessionProxy { diff --git a/TunnelKit/Sources/Core/SessionProxy+Configuration.swift b/TunnelKit/Sources/OpenVPN/SessionProxy+Configuration.swift similarity index 100% rename from TunnelKit/Sources/Core/SessionProxy+Configuration.swift rename to TunnelKit/Sources/OpenVPN/SessionProxy+Configuration.swift diff --git a/TunnelKit/Sources/Core/SessionProxy+EncryptionBridge.swift b/TunnelKit/Sources/OpenVPN/SessionProxy+EncryptionBridge.swift similarity index 93% rename from TunnelKit/Sources/Core/SessionProxy+EncryptionBridge.swift rename to TunnelKit/Sources/OpenVPN/SessionProxy+EncryptionBridge.swift index 3db728b..c0dd781 100644 --- a/TunnelKit/Sources/Core/SessionProxy+EncryptionBridge.swift +++ b/TunnelKit/Sources/OpenVPN/SessionProxy+EncryptionBridge.swift @@ -35,7 +35,8 @@ // import Foundation -import __TunnelKitNative +import __TunnelKitCore +import __TunnelKitOpenVPN extension SessionProxy { @@ -134,21 +135,21 @@ extension SessionProxy { } let masterData = try EncryptionBridge.keysPRF( - CoreConfiguration.label1, auth.preMaster, auth.random1, + CoreConfiguration.OpenVPN.label1, auth.preMaster, auth.random1, serverRandom1, nil, nil, - CoreConfiguration.preMasterLength + CoreConfiguration.OpenVPN.preMasterLength ) let keysData = try EncryptionBridge.keysPRF( - CoreConfiguration.label2, masterData, auth.random2, + CoreConfiguration.OpenVPN.label2, masterData, auth.random2, serverRandom2, sessionId, remoteSessionId, - CoreConfiguration.keysCount * CoreConfiguration.keyLength + CoreConfiguration.OpenVPN.keysCount * CoreConfiguration.OpenVPN.keyLength ) var keysArray = [ZeroingData]() - for i in 0.. Bool { - let timeout = (softReset ? CoreConfiguration.softNegotiationTimeout : link.negotiationTimeout) + let timeout = (softReset ? CoreConfiguration.OpenVPN.softNegotiationTimeout : link.negotiationTimeout) return ((controlState != .connected) && (-startTime.timeIntervalSinceNow > timeout)) } diff --git a/TunnelKit/Sources/Core/SessionProxy+SessionReply.swift b/TunnelKit/Sources/OpenVPN/SessionProxy+SessionReply.swift similarity index 100% rename from TunnelKit/Sources/Core/SessionProxy+SessionReply.swift rename to TunnelKit/Sources/OpenVPN/SessionProxy+SessionReply.swift diff --git a/TunnelKit/Sources/Core/SessionProxy+TLSWrap.swift b/TunnelKit/Sources/OpenVPN/SessionProxy+TLSWrap.swift similarity index 100% rename from TunnelKit/Sources/Core/SessionProxy+TLSWrap.swift rename to TunnelKit/Sources/OpenVPN/SessionProxy+TLSWrap.swift diff --git a/TunnelKit/Sources/Core/SessionProxy.swift b/TunnelKit/Sources/OpenVPN/SessionProxy.swift similarity index 99% rename from TunnelKit/Sources/Core/SessionProxy.swift rename to TunnelKit/Sources/OpenVPN/SessionProxy.swift index 9603923..ff5359c 100644 --- a/TunnelKit/Sources/Core/SessionProxy.swift +++ b/TunnelKit/Sources/OpenVPN/SessionProxy.swift @@ -36,7 +36,8 @@ import Foundation import SwiftyBeaver -import __TunnelKitNative +import __TunnelKitCore +import __TunnelKitOpenVPN private let log = SwiftyBeaver.self @@ -415,7 +416,7 @@ public class SessionProxy { } guard negotiationKey.controlState == .connected else { - queue.asyncAfter(deadline: .now() + CoreConfiguration.tickInterval) { [weak self] in + queue.asyncAfter(deadline: .now() + CoreConfiguration.OpenVPN.tickInterval) { [weak self] in self?.loopNegotiation() } return @@ -565,7 +566,7 @@ public class SessionProxy { } let now = Date() - guard (now.timeIntervalSince(lastPing.inbound) <= CoreConfiguration.pingTimeout) else { + guard (now.timeIntervalSince(lastPing.inbound) <= CoreConfiguration.OpenVPN.pingTimeout) else { deferStop(.shutdown, SessionError.pingTimeout) return } @@ -733,7 +734,7 @@ public class SessionProxy { if negotiationKey.softReset { completeConnection() } - nextPushRequestDate = Date().addingTimeInterval(CoreConfiguration.pushRequestInterval) + nextPushRequestDate = Date().addingTimeInterval(CoreConfiguration.OpenVPN.pushRequestInterval) } private func maybeRenegotiate() { @@ -898,7 +899,7 @@ public class SessionProxy { } negotiationKey.controlState = .preIfConfig - nextPushRequestDate = Date().addingTimeInterval(negotiationKey.softReset ? CoreConfiguration.softResetDelay : CoreConfiguration.retransmissionLimit) + nextPushRequestDate = Date().addingTimeInterval(negotiationKey.softReset ? CoreConfiguration.OpenVPN.softResetDelay : CoreConfiguration.OpenVPN.retransmissionLimit) pushRequest() } @@ -1113,7 +1114,7 @@ public class SessionProxy { compressionFraming: (pushedFraming ?? configuration.fallbackCompressionFraming).native, compressionAlgorithm: (pushedCompression ?? configuration.compressionAlgorithm ?? .disabled).native, maxPackets: link?.packetBufferSize ?? 200, - usesReplayProtection: CoreConfiguration.usesReplayProtection + usesReplayProtection: CoreConfiguration.OpenVPN.usesReplayProtection ) } diff --git a/TunnelKit/Sources/Core/StaticKey.swift b/TunnelKit/Sources/OpenVPN/StaticKey.swift similarity index 99% rename from TunnelKit/Sources/Core/StaticKey.swift rename to TunnelKit/Sources/OpenVPN/StaticKey.swift index 8b626a0..25ef60a 100644 --- a/TunnelKit/Sources/Core/StaticKey.swift +++ b/TunnelKit/Sources/OpenVPN/StaticKey.swift @@ -24,7 +24,7 @@ // import Foundation -import __TunnelKitNative +import __TunnelKitCore /// Represents an OpenVPN static key file (as generated with --genkey) public class StaticKey: Codable { diff --git a/TunnelKit/Sources/Core/TLSBox.h b/TunnelKit/Sources/OpenVPN/TLSBox.h similarity index 100% rename from TunnelKit/Sources/Core/TLSBox.h rename to TunnelKit/Sources/OpenVPN/TLSBox.h diff --git a/TunnelKit/Sources/Core/TLSBox.m b/TunnelKit/Sources/OpenVPN/TLSBox.m similarity index 100% rename from TunnelKit/Sources/Core/TLSBox.m rename to TunnelKit/Sources/OpenVPN/TLSBox.m diff --git a/TunnelKit/Sources/OpenVPN/module.modulemap b/TunnelKit/Sources/OpenVPN/module.modulemap new file mode 100644 index 0000000..dce4c3e --- /dev/null +++ b/TunnelKit/Sources/OpenVPN/module.modulemap @@ -0,0 +1,51 @@ +// +// module.modulemap +// TunnelKit +// +// Created by Davide De Rosa on 5/19/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 . +// +// 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. +// + +module __TunnelKitOpenVPN { + header "CompressionAlgorithmNative.h" + header "CompressionFramingNative.h" + header "ControlPacket.h" + header "Crypto.h" + header "CryptoBox.h" + header "DataPath.h" + header "DataPathCrypto.h" + header "MSS.h" + header "PacketMacros.h" + header "PacketStream.h" + header "ReplayProtector.h" + header "TLSBox.h" + export * +} diff --git a/TunnelKitTests/CompressionTests.swift b/TunnelKitTests/CompressionTests.swift index b00ee30..5457d20 100644 --- a/TunnelKitTests/CompressionTests.swift +++ b/TunnelKitTests/CompressionTests.swift @@ -25,7 +25,7 @@ import XCTest @testable import TunnelKit -import __TunnelKitNative +import __TunnelKitCore class CompressionTests: XCTestCase { diff --git a/TunnelKitTests/ControlChannelTests.swift b/TunnelKitTests/ControlChannelTests.swift index a092aa7..ff067a7 100644 --- a/TunnelKitTests/ControlChannelTests.swift +++ b/TunnelKitTests/ControlChannelTests.swift @@ -25,7 +25,8 @@ import XCTest @testable import TunnelKit -import __TunnelKitNative +import __TunnelKitCore +import __TunnelKitOpenVPN class ControlChannelTests: XCTestCase { private let hex = "634a4d2d459d606c8e6abbec168fdcd1871462eaa2eaed84c8f403bdf8c7da737d81b5774cc35fe0a42b38aa053f1335fd4a22d721880433bbb20ae1f2d88315b2d186b3b377685506fa39d85d38da16c2ecc0d631bda64f9d8f5a8d073f18aab97ade23e49ea9e7de86784d1ed5fa356df5f7fa1d163e5537efa8d4ba61239dc301a9aa55de0e06e33a7545f7d0cc153405576464ba92942dafa5fb79c7a60663ff1e7da3122ae09d4561653bef3eeb312ad68b191e2f94cbcf4e21caff0b59f8be86567bd21787070c2dc10a8baf7e87ce2e07d7d7de25ead11bd6d6e6ec030c0a3fd50d2d0ca3c0378022bb642e954868d7b93e18a131ecbb12b0bbedb1ce" diff --git a/TunnelKitTests/DNSTests.swift b/TunnelKitTests/DNSTests.swift index a906941..fbc4e3c 100644 --- a/TunnelKitTests/DNSTests.swift +++ b/TunnelKitTests/DNSTests.swift @@ -25,7 +25,7 @@ import XCTest import TunnelKit -import __TunnelKitNative +import __TunnelKitCore class DNSTests: XCTestCase { diff --git a/TunnelKitTests/DataPathEncryptionTests.swift b/TunnelKitTests/DataPathEncryptionTests.swift index e326cbf..54dce2e 100644 --- a/TunnelKitTests/DataPathEncryptionTests.swift +++ b/TunnelKitTests/DataPathEncryptionTests.swift @@ -36,7 +36,8 @@ import XCTest @testable import TunnelKit -@testable import __TunnelKitNative +import __TunnelKitCore +import __TunnelKitOpenVPN class DataPathEncryptionTests: XCTestCase { private let cipherKey = try! SecureRandom.safeData(length: 32) diff --git a/TunnelKitTests/DataPathPerformanceTests.swift b/TunnelKitTests/DataPathPerformanceTests.swift index dec72ae..5cef12f 100644 --- a/TunnelKitTests/DataPathPerformanceTests.swift +++ b/TunnelKitTests/DataPathPerformanceTests.swift @@ -36,7 +36,7 @@ import XCTest @testable import TunnelKit -@testable import __TunnelKitNative +import __TunnelKitOpenVPN class DataPathPerformanceTests: XCTestCase { private var dataPath: DataPath! diff --git a/TunnelKitTests/EncryptionPerformanceTests.swift b/TunnelKitTests/EncryptionPerformanceTests.swift index d2497ab..256828f 100644 --- a/TunnelKitTests/EncryptionPerformanceTests.swift +++ b/TunnelKitTests/EncryptionPerformanceTests.swift @@ -36,7 +36,8 @@ import XCTest @testable import TunnelKit -@testable import __TunnelKitNative +import __TunnelKitCore +import __TunnelKitOpenVPN class EncryptionPerformanceTests: XCTestCase { private var cbcEncrypter: Encrypter! diff --git a/TunnelKitTests/EncryptionTests.swift b/TunnelKitTests/EncryptionTests.swift index 3a7f6fb..9a0a399 100644 --- a/TunnelKitTests/EncryptionTests.swift +++ b/TunnelKitTests/EncryptionTests.swift @@ -36,7 +36,8 @@ import XCTest @testable import TunnelKit -@testable import __TunnelKitNative +import __TunnelKitCore +import __TunnelKitOpenVPN class EncryptionTests: XCTestCase { private var cipherEncKey: ZeroingData! diff --git a/TunnelKitTests/LinkTests.swift b/TunnelKitTests/LinkTests.swift index acfd378..7e6d2b7 100644 --- a/TunnelKitTests/LinkTests.swift +++ b/TunnelKitTests/LinkTests.swift @@ -36,7 +36,7 @@ import XCTest @testable import TunnelKit -@testable import __TunnelKitNative +@testable import __TunnelKitCore class LinkTests: XCTestCase { diff --git a/TunnelKitTests/PacketTests.swift b/TunnelKitTests/PacketTests.swift index 59592c6..b2933d7 100644 --- a/TunnelKitTests/PacketTests.swift +++ b/TunnelKitTests/PacketTests.swift @@ -25,7 +25,7 @@ import XCTest @testable import TunnelKit -import __TunnelKitNative +import __TunnelKitOpenVPN class PacketTests: XCTestCase { diff --git a/TunnelKitTests/RoutingTests.swift b/TunnelKitTests/RoutingTests.swift index 7dce057..8a01e5c 100644 --- a/TunnelKitTests/RoutingTests.swift +++ b/TunnelKitTests/RoutingTests.swift @@ -24,7 +24,7 @@ // import XCTest -import __TunnelKitNative +import __TunnelKitCore class RoutingTests: XCTestCase { diff --git a/TunnelKitTests/TestUtils.swift b/TunnelKitTests/TestUtils.swift index cf697d8..ec253ca 100644 --- a/TunnelKitTests/TestUtils.swift +++ b/TunnelKitTests/TestUtils.swift @@ -36,7 +36,8 @@ import Foundation @testable import TunnelKit -@testable import __TunnelKitNative +import __TunnelKitCore +import __TunnelKitOpenVPN class TestUtils { static func uniqArray(_ v: [Int]) -> [Int] {