diff --git a/Sparkle/Autoupdate/AppInstaller.m b/Sparkle/Autoupdate/AppInstaller.m index 1845d55d..de0ead72 100644 --- a/Sparkle/Autoupdate/AppInstaller.m +++ b/Sparkle/Autoupdate/AppInstaller.m @@ -215,7 +215,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; } } - BOOL updateIsCodeSigned = [SUCodeSigningVerifier applicationAtPathIsCodeSigned:installSourcePath]; + BOOL updateIsCodeSigned = [SUCodeSigningVerifier bundleAtPathIsCodeSigned:installSourcePath]; if (dsaKeysMatch) { NSError *error = nil; @@ -225,7 +225,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; } } else { NSString *hostBundlePath = host.bundlePath; - BOOL hostIsCodeSigned = [SUCodeSigningVerifier applicationAtPathIsCodeSigned:hostBundlePath]; + BOOL hostIsCodeSigned = [SUCodeSigningVerifier bundleAtPathIsCodeSigned:hostBundlePath]; NSString *dsaStatus = newPublicDSAKey ? @"has a new DSA key that doesn't match the previous one" : (publicDSAKey ? @"removes the DSA key" : @"isn't signed with a DSA key"); if (!hostIsCodeSigned || !updateIsCodeSigned) { diff --git a/Sparkle/SUCodeSigningVerifier.h b/Sparkle/SUCodeSigningVerifier.h index 4bb19819..7afdda30 100644 --- a/Sparkle/SUCodeSigningVerifier.h +++ b/Sparkle/SUCodeSigningVerifier.h @@ -12,9 +12,9 @@ #import @interface SUCodeSigningVerifier : NSObject -+ (BOOL)codeSignatureAtPath:(NSString *)oldApplicationPath matchesSignatureAtPath:(NSString *)newApplicationPath error:(NSError **)error; -+ (BOOL)codeSignatureIsValidAtPath:(NSString *)applicationPath error:(NSError **)error; -+ (BOOL)applicationAtPathIsCodeSigned:(NSString *)applicationPath; ++ (BOOL)codeSignatureAtPath:(NSString *)oldBundlePath matchesSignatureAtPath:(NSString *)newBundlePath error:(NSError **)error; ++ (BOOL)codeSignatureIsValidAtPath:(NSString *)bundlePath error:(NSError **)error; ++ (BOOL)bundleAtPathIsCodeSigned:(NSString *)bundlePath; @end #endif diff --git a/Sparkle/SUCodeSigningVerifier.m b/Sparkle/SUCodeSigningVerifier.m index 6f115ce8..dcf1d4bf 100644 --- a/Sparkle/SUCodeSigningVerifier.m +++ b/Sparkle/SUCodeSigningVerifier.m @@ -17,7 +17,7 @@ @implementation SUCodeSigningVerifier -+ (BOOL)codeSignatureAtPath:(NSString *)oldApplicationPath matchesSignatureAtPath:(NSString *)newApplicationPath error:(NSError *__autoreleasing *)error ++ (BOOL)codeSignatureAtPath:(NSString *)oldBundlePath matchesSignatureAtPath:(NSString *)newBundlePath error:(NSError *__autoreleasing *)error { OSStatus result; SecRequirementRef requirement = NULL; @@ -30,7 +30,7 @@ *error = nil; } - oldBundle = [NSBundle bundleWithPath:oldApplicationPath]; + oldBundle = [NSBundle bundleWithPath:oldBundlePath]; if (!oldBundle) { SULog(@"Failed to load NSBundle for original"); result = -1; @@ -48,7 +48,7 @@ goto finally; } - newBundle = [NSBundle bundleWithPath:newApplicationPath]; + newBundle = [NSBundle bundleWithPath:newBundlePath]; if (!newBundle) { SULog(@"Failed to load NSBundle for update"); result = -1; @@ -94,7 +94,7 @@ finally: return (result == noErr); } -+ (BOOL)codeSignatureIsValidAtPath:(NSString *)applicationPath error:(NSError *__autoreleasing *)error ++ (BOOL)codeSignatureIsValidAtPath:(NSString *)bundlePath error:(NSError *__autoreleasing *)error { OSStatus result; SecStaticCodeRef staticCode = NULL; @@ -104,7 +104,7 @@ finally: *error = nil; } - newBundle = [NSBundle bundleWithPath:applicationPath]; + newBundle = [NSBundle bundleWithPath:bundlePath]; if (!newBundle) { SULog(@"Failed to load NSBundle"); result = -1; @@ -129,7 +129,7 @@ finally: if (result != noErr) { if (result == errSecCSUnsigned) { - SULog(@"Error: The app is not signed using Apple Code Signing. %@", applicationPath); + SULog(@"Error: The app is not signed using Apple Code Signing. %@", bundlePath); } if (result == errSecCSReqFailed) { [self logSigningInfoForCode:staticCode label:@"new info"]; @@ -161,13 +161,13 @@ static id valueOrNSNull(id value) { } } -+ (BOOL)applicationAtPathIsCodeSigned:(NSString *)applicationPath ++ (BOOL)bundleAtPathIsCodeSigned:(NSString *)bundlePath { OSStatus result; SecStaticCodeRef staticCode = NULL; NSBundle *newBundle; - newBundle = [NSBundle bundleWithPath:applicationPath]; + newBundle = [NSBundle bundleWithPath:bundlePath]; if (!newBundle) { SULog(@"Failed to load NSBundle"); return NO; diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 58055ff4..3f3fbf4b 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -106,7 +106,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification -(void)checkIfConfiguredProperly { BOOL hasPublicDSAKey = [self.host publicDSAKey] != nil; BOOL isMainBundle = [self.host.bundle isEqualTo:[NSBundle mainBundle]]; - BOOL hostIsCodeSigned = [SUCodeSigningVerifier applicationAtPathIsCodeSigned:self.host.bundle.bundlePath]; + BOOL hostIsCodeSigned = [SUCodeSigningVerifier bundleAtPathIsCodeSigned:self.host.bundle.bundlePath]; NSURL *feedURL = [self feedURL]; BOOL servingOverHttps = [[[feedURL scheme] lowercaseString] isEqualToString:@"https"]; if (!isMainBundle && !hasPublicDSAKey) {