Raise exception on external file in .ovpn
- ca - cert - key - tls-auth - tls-crypt
This commit is contained in:
parent
8fe29cf924
commit
d026004db3
|
@ -53,6 +53,8 @@ extension TunnelKitProvider.Configuration {
|
||||||
|
|
||||||
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 blockBegin = Utils.regex("^<[\\w\\-]+>")
|
static let blockBegin = Utils.regex("^<[\\w\\-]+>")
|
||||||
|
|
||||||
static let blockEnd = Utils.regex("^<\\/[\\w\\-]+>")
|
static let blockEnd = Utils.regex("^<\\/[\\w\\-]+>")
|
||||||
|
@ -209,6 +211,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.externalFiles.enumerateArguments(in: line) { (_) in
|
||||||
|
unsupportedError = ApplicationError.unsupportedConfiguration(option: "external file: \"\(line)\"")
|
||||||
|
}
|
||||||
|
|
||||||
if let error = unsupportedError {
|
if let error = unsupportedError {
|
||||||
throw error
|
throw error
|
||||||
|
|
Loading…
Reference in New Issue