From f691a4f204b8c8d14ab0267ec93f18c33023402a Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Wed, 24 Oct 2018 00:24:23 +0200 Subject: [PATCH] Raise exception on proxy in .ovpn --- .../Sources/VPN/TunnelKitProvider+FileConfiguration.swift | 5 +++++ README.md | 1 + 2 files changed, 6 insertions(+) diff --git a/Passepartout/Sources/VPN/TunnelKitProvider+FileConfiguration.swift b/Passepartout/Sources/VPN/TunnelKitProvider+FileConfiguration.swift index f9a644f1..ea1260c7 100644 --- a/Passepartout/Sources/VPN/TunnelKitProvider+FileConfiguration.swift +++ b/Passepartout/Sources/VPN/TunnelKitProvider+FileConfiguration.swift @@ -51,6 +51,8 @@ extension TunnelKitProvider.Configuration { static let fragment = Utils.regex("^fragment +\\d+") + static let proxy = Utils.regex("^\\w+-proxy") + static let keyDirection = Utils.regex("^key-direction +\\d") 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 unsupportedError = ApplicationError.unsupportedConfiguration(option: "fragment") } + Regex.proxy.enumerateArguments(in: line) { (_) in + unsupportedError = ApplicationError.unsupportedConfiguration(option: "proxy: \"\(line)\"") + } Regex.externalFiles.enumerateArguments(in: line) { (_) in unsupportedError = ApplicationError.unsupportedConfiguration(option: "external file: \"\(line)\"") } diff --git a/README.md b/README.md index e6d09be2..f4805f49 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ Unsupported (probably ever): - Compression - `--comp-lzo` other than `no` - `--compress` other than empty +- Proxy - External file references (inline `` only) Ignored: