Merge branch 'extend-infra-preset'

This commit is contained in:
Davide De Rosa 2019-03-26 00:42:55 +01:00
commit 7790abb33d
6 changed files with 25 additions and 17 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -55,6 +55,8 @@ public struct InfrastructurePreset: Codable {
case compressionFraming = "frame"
case compressionAlgorithm = "compression"
case keepAliveSeconds = "ping"
case renegotiatesAfterSeconds = "reneg"
@ -63,6 +65,8 @@ public struct InfrastructurePreset: Codable {
case usesPIAPatches = "pia"
case checksEKU = "eku"
case randomizeEndpoint = "random"
}
@ -97,10 +101,12 @@ public struct InfrastructurePreset: Codable {
sessionBuilder.clientCertificate = try cfgContainer.decodeIfPresent(CryptoContainer.self, forKey: .clientCertificate)
sessionBuilder.clientKey = try cfgContainer.decodeIfPresent(CryptoContainer.self, forKey: .clientKey)
sessionBuilder.compressionFraming = try cfgContainer.decode(SessionProxy.CompressionFraming.self, forKey: .compressionFraming)
sessionBuilder.compressionAlgorithm = try cfgContainer.decodeIfPresent(SessionProxy.CompressionAlgorithm.self, forKey: .compressionAlgorithm) ?? .disabled
sessionBuilder.tlsWrap = try cfgContainer.decodeIfPresent(SessionProxy.TLSWrap.self, forKey: .tlsWrap)
sessionBuilder.keepAliveInterval = try cfgContainer.decodeIfPresent(TimeInterval.self, forKey: .keepAliveSeconds)
sessionBuilder.renegotiatesAfter = try cfgContainer.decodeIfPresent(TimeInterval.self, forKey: .renegotiatesAfterSeconds)
sessionBuilder.usesPIAPatches = try cfgContainer.decodeIfPresent(Bool.self, forKey: .usesPIAPatches) ?? false
sessionBuilder.checksEKU = try cfgContainer.decodeIfPresent(Bool.self, forKey: .checksEKU) ?? false
sessionBuilder.randomizeEndpoint = try cfgContainer.decodeIfPresent(Bool.self, forKey: .randomizeEndpoint) ?? false
var builder = TunnelKitProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build())
@ -123,10 +129,12 @@ public struct InfrastructurePreset: Codable {
try cfgContainer.encodeIfPresent(configuration.sessionConfiguration.clientCertificate, forKey: .clientCertificate)
try cfgContainer.encodeIfPresent(configuration.sessionConfiguration.clientKey, forKey: .clientKey)
try cfgContainer.encode(configuration.sessionConfiguration.compressionFraming, forKey: .compressionFraming)
try cfgContainer.encodeIfPresent(configuration.sessionConfiguration.compressionAlgorithm, forKey: .compressionAlgorithm)
try cfgContainer.encodeIfPresent(configuration.sessionConfiguration.tlsWrap, forKey: .tlsWrap)
try cfgContainer.encodeIfPresent(configuration.sessionConfiguration.keepAliveInterval, forKey: .keepAliveSeconds)
try cfgContainer.encodeIfPresent(configuration.sessionConfiguration.renegotiatesAfter, forKey: .renegotiatesAfterSeconds)
try cfgContainer.encodeIfPresent(configuration.sessionConfiguration.usesPIAPatches, forKey: .usesPIAPatches)
try cfgContainer.encodeIfPresent(configuration.sessionConfiguration.checksEKU, forKey: .checksEKU)
try cfgContainer.encodeIfPresent(configuration.sessionConfiguration.randomizeEndpoint, forKey: .randomizeEndpoint)
}
}

View File

@ -5,8 +5,8 @@ use_frameworks!
def shared_pods
#pod 'TunnelKit', '~> 1.5.0'
#pod 'TunnelKit/LZO', '~> 1.5.0'
pod 'TunnelKit', :git => 'https://github.com/keeshux/tunnelkit', :commit => '00c76f7'
pod 'TunnelKit/LZO', :git => 'https://github.com/keeshux/tunnelkit', :commit => '00c76f7'
pod 'TunnelKit', :git => 'https://github.com/keeshux/tunnelkit', :commit => 'd03f1bd'
pod 'TunnelKit/LZO', :git => 'https://github.com/keeshux/tunnelkit', :commit => 'd03f1bd'
#pod 'TunnelKit', :path => '../../personal/tunnelkit'
#pod 'TunnelKit/LZO', :path => '../../personal/tunnelkit'
end

View File

@ -2,21 +2,21 @@ PODS:
- MBProgressHUD (1.1.0)
- OpenSSL-Apple (1.1.0i.2)
- SwiftyBeaver (1.6.2)
- TunnelKit (1.5.1):
- TunnelKit/AppExtension (= 1.5.1)
- TunnelKit/Core (= 1.5.1)
- TunnelKit/AppExtension (1.5.1):
- TunnelKit (1.5.2):
- TunnelKit/AppExtension (= 1.5.2)
- TunnelKit/Core (= 1.5.2)
- TunnelKit/AppExtension (1.5.2):
- SwiftyBeaver
- TunnelKit/Core
- TunnelKit/Core (1.5.1):
- TunnelKit/Core (1.5.2):
- OpenSSL-Apple (~> 1.1.0i.2)
- SwiftyBeaver
- TunnelKit/LZO (1.5.1)
- TunnelKit/LZO (1.5.2)
DEPENDENCIES:
- MBProgressHUD
- TunnelKit (from `https://github.com/keeshux/tunnelkit`, commit `00c76f7`)
- TunnelKit/LZO (from `https://github.com/keeshux/tunnelkit`, commit `00c76f7`)
- TunnelKit (from `https://github.com/keeshux/tunnelkit`, commit `d03f1bd`)
- TunnelKit/LZO (from `https://github.com/keeshux/tunnelkit`, commit `d03f1bd`)
SPEC REPOS:
https://github.com/cocoapods/specs.git:
@ -26,20 +26,20 @@ SPEC REPOS:
EXTERNAL SOURCES:
TunnelKit:
:commit: 00c76f7
:commit: d03f1bd
:git: https://github.com/keeshux/tunnelkit
CHECKOUT OPTIONS:
TunnelKit:
:commit: 00c76f7
:commit: d03f1bd
:git: https://github.com/keeshux/tunnelkit
SPEC CHECKSUMS:
MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
OpenSSL-Apple: 37a8c0b04df4bb8971deef4671cc29222861319c
SwiftyBeaver: 8e67ab3cd94389cbbb7a9c7cc02748d98bfee68e
TunnelKit: fb4db4d4c4b36af0ca8e973e3345a1c3ef5ac85c
TunnelKit: 75323e2f45e698647ccaebd5a6bcae8c002afea4
PODFILE CHECKSUM: 799d9ce384c55495fd4f7fd60423f4218c32a887
PODFILE CHECKSUM: a2c0a287a69e21e328e35816f2c813616b80f54c
COCOAPODS: 1.6.1