Disable key rotation fallback if signed feed failures don't expire

If SUSignedFeedFailureExpirationInterval is disabled (set to zero) this means a valid signed feed needs to always be present and no expiration is taken in place. In this case a developer must have access to their EdDSA signing keys, so it doesn't make sense to allow key rotation fallback on the update archive.
This commit is contained in:
Zorg committed 2026-11-29 19:31:56 -08:00
1 parent 86fd1c1c8a
commit e1f93ed4e7
1 file changed
+7 -3
+7 -3
View File
@@ -296,9 +296,13 @@ static const NSTimeInterval SUTerminationRequestTargetWaitDelay = 2.0;
if (![_updateValidator validateHostHasPublicKeys:&prevalidationError]) {
success = NO;
} else {
// Falling back on code signing for prevalidation requires SUVerifyUpdateBeforeExtraction
// and that update is a regular app update, and not a delta update
BOOL fallbackOnCodeSigning = (verifyBeforeExtraction && !archiveTypeMustValidateBeforeExtraction && [_installationType isEqualToString:SPUInstallationTypeApplication]);
// Falling back on code signing for prevalidation requires SUVerifyUpdateBeforeExtraction,
// SURequireSignedFeed is off or SUSignedFeedFailureExpirationInterval is not zero,
// the update is a regular app update, and not a delta update
NSNumber *signedFeedFailureExpirationInterval = [_host doubleNumberForInfoDictionaryKey:SUSignedFeedFailureExpirationIntervalKey];
BOOL signedFeedFailuresNeverExpire = _host.requiresSignedAppcast && signedFeedFailureExpirationInterval != nil && fpclassify(signedFeedFailureExpirationInterval.doubleValue) == FP_ZERO;
BOOL fallbackOnCodeSigning = (verifyBeforeExtraction && !archiveTypeMustValidateBeforeExtraction && [_installationType isEqualToString:SPUInstallationTypeApplication] && !signedFeedFailuresNeverExpire);
success = [_updateValidator validateDownloadPathWithFallbackOnCodeSigning:fallbackOnCodeSigning error:&prevalidationError];
}