Skip to content

Commit

Permalink
Fall back on DSA-only installation checks for .pkg installations
Browse files Browse the repository at this point in the history
  • Loading branch information
andymatuschak committed Nov 20, 2012
1 parent 337002f commit 243fdf8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions SUBasicUpdateDriver.m
Expand Up @@ -204,19 +204,20 @@ - (void)download:(NSURLDownload *)d decideDestinationWithSuggestedFilename:(NSSt
[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
Expand Down

0 comments on commit 243fdf8

Please sign in to comment.