Raise exception on proxy in .ovpn

This commit is contained in:
Davide De Rosa 2018-10-24 00:24:23 +02:00
parent 8375fc58fc
commit f691a4f204
2 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,8 @@ extension TunnelKitProvider.Configuration {
static let fragment = Utils.regex("^fragment +\\d+") static let fragment = Utils.regex("^fragment +\\d+")
static let proxy = Utils.regex("^\\w+-proxy")
static let keyDirection = Utils.regex("^key-direction +\\d") static let keyDirection = Utils.regex("^key-direction +\\d")
static let externalFiles = Utils.regex("^(ca|cert|key|tls-auth|tls-crypt)") static let externalFiles = Utils.regex("^(ca|cert|key|tls-auth|tls-crypt)")
@ -211,6 +213,9 @@ extension TunnelKitProvider.Configuration {
Regex.fragment.enumerateArguments(in: line) { (_) in Regex.fragment.enumerateArguments(in: line) { (_) in
unsupportedError = ApplicationError.unsupportedConfiguration(option: "fragment") unsupportedError = ApplicationError.unsupportedConfiguration(option: "fragment")
} }
Regex.proxy.enumerateArguments(in: line) { (_) in
unsupportedError = ApplicationError.unsupportedConfiguration(option: "proxy: \"\(line)\"")
}
Regex.externalFiles.enumerateArguments(in: line) { (_) in Regex.externalFiles.enumerateArguments(in: line) { (_) in
unsupportedError = ApplicationError.unsupportedConfiguration(option: "external file: \"\(line)\"") unsupportedError = ApplicationError.unsupportedConfiguration(option: "external file: \"\(line)\"")
} }

View File

@ -76,6 +76,7 @@ Unsupported (probably ever):
- Compression - Compression
- `--comp-lzo` other than `no` - `--comp-lzo` other than `no`
- `--compress` other than empty - `--compress` other than empty
- Proxy
- External file references (inline `<block>` only) - External file references (inline `<block>` only)
Ignored: Ignored: