From b62f7669f2e054fa9885e12d4d0afbb829e9678a Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Wed, 17 Oct 2018 18:37:02 +0200 Subject: [PATCH 1/2] Match cfg lines from the beginning E.g. cipher was matching tls-cipher. --- .../TunnelKitProvider+FileConfiguration.swift | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Passepartout/Sources/VPN/TunnelKitProvider+FileConfiguration.swift b/Passepartout/Sources/VPN/TunnelKitProvider+FileConfiguration.swift index 15a6a1ad..68624189 100644 --- a/Passepartout/Sources/VPN/TunnelKitProvider+FileConfiguration.swift +++ b/Passepartout/Sources/VPN/TunnelKitProvider+FileConfiguration.swift @@ -31,31 +31,31 @@ private let log = SwiftyBeaver.self extension TunnelKitProvider.Configuration { private struct Regex { - static let proto = Utils.regex("proto +(udp6?|tcp6?)") + static let proto = Utils.regex("^proto +(udp6?|tcp6?)") - static let port = Utils.regex("port +\\d+") + static let port = Utils.regex("^port +\\d+") - static let remote = Utils.regex("remote +[^ ]+( +\\d+)?( +(udp6?|tcp6?))?") + static let remote = Utils.regex("^remote +[^ ]+( +\\d+)?( +(udp6?|tcp6?))?") - static let cipher = Utils.regex("cipher +[\\w\\-]+") + static let cipher = Utils.regex("^cipher +[\\w\\-]+") - static let auth = Utils.regex("auth +[\\w\\-]+") + static let auth = Utils.regex("^auth +[\\w\\-]+") - static let compLZO = Utils.regex("comp-lzo") + static let compLZO = Utils.regex("^comp-lzo") - static let compress = Utils.regex("compress") + static let compress = Utils.regex("^compress") - static let ping = Utils.regex("ping +\\d+") + static let ping = Utils.regex("^ping +\\d+") - static let renegSec = Utils.regex("reneg-sec +\\d+") + static let renegSec = Utils.regex("^reneg-sec +\\d+") - static let fragment = Utils.regex("fragment +\\d+") + static let fragment = Utils.regex("^fragment +\\d+") - static let keyDirection = Utils.regex("key-direction +\\d") + static let keyDirection = Utils.regex("^key-direction +\\d") - static let blockBegin = Utils.regex("<[\\w\\-]+>") + static let blockBegin = Utils.regex("^<[\\w\\-]+>") - static let blockEnd = Utils.regex("<\\/[\\w\\-]+>") + static let blockEnd = Utils.regex("^<\\/[\\w\\-]+>") } static func parsed(from url: URL) throws -> (String, TunnelKitProvider.Configuration) { From 483edee22e9018ea8045d8104c742e90a72e8d55 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 18 Oct 2018 00:10:14 +0200 Subject: [PATCH 2/2] Do not open .ovpn documents in-place Files was raising a permission error. --- Passepartout-iOS/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Passepartout-iOS/Info.plist b/Passepartout-iOS/Info.plist index f0b1cf26..7fb75e09 100644 --- a/Passepartout-iOS/Info.plist +++ b/Passepartout-iOS/Info.plist @@ -42,7 +42,7 @@ LSRequiresIPhoneOS LSSupportsOpeningDocumentsInPlace - + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile