diff --git a/SUBasicUpdateDriver.m b/SUBasicUpdateDriver.m index 4da1975f..cb23e877 100644 --- a/SUBasicUpdateDriver.m +++ b/SUBasicUpdateDriver.m @@ -204,19 +204,20 @@ [download setDestination:downloadPath allowOverwrite:YES]; } -- (BOOL)validateUpdateDownloadedToPath:(NSString *)destinationPath extractedToPath:(NSString *)extractedPath DSASignature:(NSString *)DSASignature publicDSAKey:(NSString *)publicDSAKey +- (BOOL)validateUpdateDownloadedToPath:(NSString *)downloadedPath extractedToPath:(NSString *)extractedPath DSASignature:(NSString *)DSASignature publicDSAKey:(NSString *)publicDSAKey { NSString *newBundlePath = [SUInstaller appPathInUpdateFolder:extractedPath forHost:host]; - if (!newBundlePath) return NO; - - NSError *error = nil; - if ([SUCodeSigningVerifier codeSignatureIsValidAtPath:newBundlePath error:&error]) { - return YES; - } else { - SULog(@"Code signature check on update failed: %@", error); + if (newBundlePath) + { + NSError *error = nil; + if ([SUCodeSigningVerifier codeSignatureIsValidAtPath:newBundlePath error:&error]) { + return YES; + } else { + SULog(@"Code signature check on update failed: %@", error); + } } - return [SUDSAVerifier validatePath:destinationPath withEncodedDSASignature:DSASignature withPublicDSAKey:publicDSAKey]; + return [SUDSAVerifier validatePath:downloadedPath withEncodedDSASignature:DSASignature withPublicDSAKey:publicDSAKey]; } - (void)downloadDidFinish:(NSURLDownload *)d