Merge branch 'restrict-unrecognized-options'
This commit is contained in:
commit
acb57749db
|
@ -132,6 +132,9 @@ extension TunnelKitProvider.Configuration {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defaultProto = TunnelKitProvider.SocketType(protoString: str)
|
defaultProto = TunnelKitProvider.SocketType(protoString: str)
|
||||||
|
if defaultProto == nil {
|
||||||
|
unsupportedError = ApplicationError.unsupportedConfiguration(option: "proto \(str)")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Regex.port.enumerateArguments(in: line) {
|
Regex.port.enumerateArguments(in: line) {
|
||||||
guard let str = $0.first else {
|
guard let str = $0.first else {
|
||||||
|
@ -158,12 +161,18 @@ extension TunnelKitProvider.Configuration {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cipher = SessionProxy.Cipher(rawValue: rawValue.uppercased())
|
cipher = SessionProxy.Cipher(rawValue: rawValue.uppercased())
|
||||||
|
if cipher == nil {
|
||||||
|
unsupportedError = ApplicationError.unsupportedConfiguration(option: "cipher \(rawValue)")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Regex.auth.enumerateArguments(in: line) {
|
Regex.auth.enumerateArguments(in: line) {
|
||||||
guard let rawValue = $0.first else {
|
guard let rawValue = $0.first else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
digest = SessionProxy.Digest(rawValue: rawValue.uppercased())
|
digest = SessionProxy.Digest(rawValue: rawValue.uppercased())
|
||||||
|
if digest == nil {
|
||||||
|
unsupportedError = ApplicationError.unsupportedConfiguration(option: "auth \(rawValue)")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Regex.compLZO.enumerateComponents(in: line) { _ in
|
Regex.compLZO.enumerateComponents(in: line) { _ in
|
||||||
compressionFraming = .compLZO
|
compressionFraming = .compLZO
|
||||||
|
|
Loading…
Reference in New Issue