diff --git a/Sparkle/SUUpdateValidator.m b/Sparkle/SUUpdateValidator.m index b8aab518..4aea1746 100644 --- a/Sparkle/SUUpdateValidator.m +++ b/Sparkle/SUUpdateValidator.m @@ -223,7 +223,7 @@ } } else { if (error != NULL) { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUValidationError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"The update archive %@, and the app is signed with a new Code Signing identity that doesn't match code signing of the original app. At least one method of signature verification must be valid. The update will be rejected.", dsaStatus], NSUnderlyingErrorKey: innerError }]; + *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUValidationError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"The update archive %@, and the app is signed with a new Code Signing identity that doesn't match code signing of the original app. At least one method of signature verification must be valid. The update will be rejected.", dsaStatus] }]; } } diff --git a/Tests/SUUpdateValidatorTest.swift b/Tests/SUUpdateValidatorTest.swift index a475939c..50007d25 100644 --- a/Tests/SUUpdateValidatorTest.swift +++ b/Tests/SUUpdateValidatorTest.swift @@ -87,7 +87,7 @@ class SUUpdateValidatorTest: XCTestCase { let validator = SUUpdateValidator(downloadPath: self.signedTestFilePath, signatures: signatures, host: host) - let result = validator.validateDownloadPath() + let result = (try? validator.validateDownloadPath()) != nil XCTAssertEqual(result, expectedResult, "bundle: \(bundleConfig), signatures: \(signatureConfig)", line: line) } @@ -112,7 +112,7 @@ class SUUpdateValidatorTest: XCTestCase { let newBundle = self.bundle(newBundleConfig) try! FileManager.default.copyItem(at: newBundle.bundleURL, to: URL(fileURLWithPath: updateDirectory).appendingPathComponent(oldBundle.bundleURL.lastPathComponent)) - let result = validator.validate(withUpdateDirectory: updateDirectory) + let result = (try? validator.validate(withUpdateDirectory: updateDirectory)) != nil XCTAssertEqual(result, expectedResult, "oldBundle: \(oldBundleConfig), newBundle: \(newBundleConfig), signatures: \(signatureConfig)", line: line) }