Host app needn't be signed to verify signature of updated app

This commit is contained in:
Zorg committed 2015-04-26 16:28:17 -04:00
1 parent 28ea47f796
commit f55d2a4439
1 file changed
+3 -2
+3 -2
View File
@@ -231,7 +231,8 @@
return (DSASignature != nil);
}
BOOL canValidateByCodeSignature = [SUCodeSigningVerifier hostApplicationIsCodeSigned] && [SUCodeSigningVerifier applicationAtPathIsCodeSigned:newBundlePath];
BOOL isAppCodeSigned = [SUCodeSigningVerifier applicationAtPathIsCodeSigned:newBundlePath];
BOOL canValidateByCodeSignature = isAppCodeSigned && [SUCodeSigningVerifier hostApplicationIsCodeSigned];
if (!DSASignature && !canValidateByCodeSignature) {
SULog(@"The appcast item for the update has no DSA signature. The update will be rejected, because both DSA and Apple Code Signing verification failed.");
@@ -241,7 +242,7 @@
NSError *error = nil;
if (DSASignature) {
if (canValidateByCodeSignature && ![SUCodeSigningVerifier codeSignatureIsValidAtPath:newBundlePath error:&error]) {
if (isAppCodeSigned && ![SUCodeSigningVerifier codeSignatureIsValidAtPath:newBundlePath error:&error]) {
SULog(@"The application to update has an invalid code signature: %@. The update will be rejected.", error);
return NO;
}