mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-28 05:14:34 +00:00
Require signing validation for apple archives before extraction (#2588)
This commit is contained in:
7 files changed
+9
-9
No files matched your search
@@ -193,9 +193,9 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
|
||||
_updateValidator = [[SUUpdateValidator alloc] initWithDownloadPath:archivePath signatures:_signatures host:_host verifierInformation:_verifierInformation];
|
||||
|
||||
// Delta & package updates will require validation before extraction
|
||||
// Delta, package updates, and .aar/.yaa archives will require validation before extraction
|
||||
// Normal application updates are a bit more lenient allowing developers to change one of apple dev ID or EdDSA keys
|
||||
BOOL needsPrevalidation = [[unarchiver class] mustValidateBeforeExtraction] || ![_installationType isEqualToString:SPUInstallationTypeApplication];
|
||||
BOOL needsPrevalidation = [[unarchiver class] mustValidateBeforeExtractionWithArchivePath:archivePath] || ![_installationType isEqualToString:SPUInstallationTypeApplication];
|
||||
|
||||
if (needsPrevalidation) {
|
||||
success = [_updateValidator validateDownloadPathWithError:&unarchiverError];
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
return [[path pathExtension] isEqualToString:@"delta"];
|
||||
}
|
||||
|
||||
+ (BOOL)mustValidateBeforeExtraction
|
||||
+ (BOOL)mustValidateBeforeExtractionWithArchivePath:(NSString *)archivePath
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
return [[path pathExtension] isEqualToString:@"dmg"];
|
||||
}
|
||||
|
||||
+ (BOOL)mustValidateBeforeExtraction
|
||||
+ (BOOL)mustValidateBeforeExtractionWithArchivePath:(NSString *)archivePath
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
return [path.pathExtension isEqualToString:@"pkg"] || [path.pathExtension isEqualToString:@"mpkg"];
|
||||
}
|
||||
|
||||
+ (BOOL)mustValidateBeforeExtraction
|
||||
+ (BOOL)mustValidateBeforeExtractionWithArchivePath:(NSString *)archivePath
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ static NSArray <NSString *> * _Nullable _commandAndArgumentsConformingToTypeOfPa
|
||||
return _commandAndArgumentsConformingToTypeOfPath(path) != nil;
|
||||
}
|
||||
|
||||
+ (BOOL)mustValidateBeforeExtraction
|
||||
+ (BOOL)mustValidateBeforeExtractionWithArchivePath:(NSString *)archivePath
|
||||
{
|
||||
return NO;
|
||||
return ([archivePath hasSuffix:@".aar"] || [archivePath hasSuffix:@".yaa"]);
|
||||
}
|
||||
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory
|
||||
|
||||
@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol SUUnarchiverProtocol <NSObject>
|
||||
|
||||
+ (BOOL)mustValidateBeforeExtraction;
|
||||
+ (BOOL)mustValidateBeforeExtractionWithArchivePath:(NSString *)archivePath;
|
||||
|
||||
- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -121,7 +121,7 @@
|
||||
{
|
||||
// Because we already validated the EdDSA signature, this is just a consistency check to see
|
||||
// if the developer signed their application properly with their Apple ID
|
||||
// Currently, this case only gets hit for binary delta updates
|
||||
// Currently, this case gets hit for binary delta updates and .aar/.yaa archives
|
||||
|
||||
NSError *innerError = nil;
|
||||
if ([SUCodeSigningVerifier bundleAtURLIsCodeSigned:installSourceURL] && ![SUCodeSigningVerifier codeSignatureIsValidAtBundleURL:installSourceURL error:&innerError]) {
|
||||
|
||||
Reference in new issue
Block a user