mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-30 05:28:50 +00:00
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:
1 parent
86fd1c1c8a
commit
e1f93ed4e7
1 file changed
+7
-3
@@ -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];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user