Skip to content

Commit 48c893c

Browse files
committed
new function
1 parent 6e99358 commit 48c893c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Coder Desktop/VPNLib/Download.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public class SignatureValidator {
5656
private static let signInfoFlags: SecCSFlags = .init(rawValue: kSecCSSigningInformation)
5757

5858
// `expectedVersion` must be of the form `[0-9]+.[0-9]+.[0-9]+`
59-
// swiftlint:disable:next cyclomatic_complexity
6059
public static func validate(path: URL, expectedVersion: String) throws(ValidationError) {
6160
guard FileManager.default.fileExists(atPath: path.path) else {
6261
throw .fileNotFound
@@ -97,6 +96,10 @@ public class SignatureValidator {
9796
throw .missingInfoPList
9897
}
9998

99+
try validateInfo(infoPlist: infoPlist, expectedVersion: expectedVersion)
100+
}
101+
102+
private static func validateInfo(infoPlist: [String: AnyObject], expectedVersion: String) throws(ValidationError) {
100103
guard let plistIdent = infoPlist[infoIdentifierKey] as? String, plistIdent == expectedIdentifier else {
101104
throw .invalidIdentifier(identifier: infoPlist[infoIdentifierKey] as? String)
102105
}

0 commit comments

Comments
 (0)