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

Lines changed: 4 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy