From f55d2a4439cfd92fe41458121607119587b8b4fd Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 26 Apr 2015 16:28:17 -0400 Subject: [PATCH] Host app needn't be signed to verify signature of updated app --- Sparkle/SUBasicUpdateDriver.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 04c7e449..f2191999 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -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; }