Fall back on DSA-only installation checks for .pkg installations

This commit is contained in:
Andy Matuschak committed 2012-11-20 14:56:35 -08:00
1 parent 337002f421
commit 243fdf8f7f
1 file changed
+10 -9
+10 -9
View File
@@ -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