From 6487cffcaf73309f090197de6eefe2ccb0a1dbbc Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 8 Sep 2024 18:54:11 -0700 Subject: [PATCH 1/6] Improve robustness around extracting disk images * Handle failing to extract password protected disk images even when a decryption password isn't provided. * Propagate error with more information when hdiutil attach fails. * Wait for detaching disk images for unit tests (fixes not being able to run tests repeatably). * Fix some duplicate obj-c class warnings in test target. --- Autoupdate/AppInstaller.m | 2 +- Autoupdate/SUBinaryDeltaUnarchiver.m | 2 +- Autoupdate/SUDiskImageUnarchiver.m | 70 ++++++++++++++++++++-------- Autoupdate/SUFlatPackageUnarchiver.m | 2 +- Autoupdate/SUPipedUnarchiver.m | 2 +- Autoupdate/SUUnarchiverProtocol.h | 2 +- Sparkle.xcodeproj/project.pbxproj | 14 ------ Tests/SUUnarchiverTest.swift | 29 +++++++++++- 8 files changed, 82 insertions(+), 41 deletions(-) diff --git a/Autoupdate/AppInstaller.m b/Autoupdate/AppInstaller.m index 9ecd2f239..924dfa65b 100644 --- a/Autoupdate/AppInstaller.m +++ b/Autoupdate/AppInstaller.m @@ -236,7 +236,7 @@ - (void)extractAndInstallUpdate SPU_OBJC_DIRECT [self->_communicator handleMessageWithIdentifier:SPUExtractedArchiveWithProgress data:data]; } - }]; + } waitForCleanup:NO]; } } diff --git a/Autoupdate/SUBinaryDeltaUnarchiver.m b/Autoupdate/SUBinaryDeltaUnarchiver.m index 79cd61fb9..cb3336d37 100644 --- a/Autoupdate/SUBinaryDeltaUnarchiver.m +++ b/Autoupdate/SUBinaryDeltaUnarchiver.m @@ -83,7 +83,7 @@ - (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory: return self; } -- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock +- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock waitForCleanup:(BOOL)__unused waitForCleanup { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ @autoreleasepool { diff --git a/Autoupdate/SUDiskImageUnarchiver.m b/Autoupdate/SUDiskImageUnarchiver.m index c75caf1ae..c95a6ff43 100644 --- a/Autoupdate/SUDiskImageUnarchiver.m +++ b/Autoupdate/SUDiskImageUnarchiver.m @@ -11,6 +11,7 @@ #import "SUDiskImageUnarchiver.h" #import "SUUnarchiverNotifier.h" #import "SULog.h" +#import "SUErrors.h" #include "AppKitPrevention.h" @@ -50,11 +51,11 @@ - (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory: return self; } -- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock +- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock waitForCleanup:(BOOL)waitForCleanup { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ SUUnarchiverNotifier *notifier = [[SUUnarchiverNotifier alloc] initWithCompletionBlock:completionBlock progressBlock:progressBlock]; - [self extractDMGWithNotifier:notifier]; + [self extractDMGWithNotifier:notifier waitForCleanup:waitForCleanup]; }); } @@ -78,7 +79,7 @@ - (BOOL)fileManager:(NSFileManager *)fileManager shouldCopyItemAtURL:(NSURL *)sr } // Called on a non-main thread. -- (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier SPU_OBJC_DIRECT +- (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier waitForCleanup:(BOOL)waitForCleanup SPU_OBJC_DIRECT { @autoreleasepool { BOOL mountedSuccessfully = NO; @@ -95,25 +96,32 @@ - (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier SPU_OBJC_DIRECT // Note: this check does not follow symbolic links, which is what we want while ([[NSURL fileURLWithPath:mountPoint] checkResourceIsReachableAndReturnError:NULL]); - NSData *promptData = [NSData dataWithBytes:"yes\n" length:4]; + NSMutableData *inputData = [NSMutableData data]; - // Finder doesn't verify disk images anymore beyond the code signing signature (if available) - // Opt out of the old CRC checksum checks - NSMutableArray *arguments = [@[@"attach", _archivePath, @"-mountpoint", mountPoint, @"-noverify", @"-nobrowse", @"-noautoopen"] mutableCopy]; - - if (_decryptionPassword) { - NSMutableData *passwordData = [[_decryptionPassword dataUsingEncoding:NSUTF8StringEncoding] mutableCopy]; + // Prepare stdin data for passwords and license agreements + { + NSData *decryptionPasswordData = [_decryptionPassword dataUsingEncoding:NSUTF8StringEncoding]; + if (decryptionPasswordData != nil) { + [inputData appendData:decryptionPasswordData]; + } else { + [inputData appendBytes:"y" length:1]; + } + // From the hdiutil docs: // read a null-terminated passphrase from standard input // - // Add the null terminator, then the newline - [passwordData appendData:[NSData dataWithBytes:"\0" length:1]]; - [passwordData appendData:promptData]; - promptData = passwordData; + // Add the null terminator + [inputData appendBytes:"\0" length:1]; - [arguments addObject:@"-stdinpass"]; + // Append prompt data for license agreements + [inputData appendBytes:"yes\n" length:4]; } + // Finder doesn't verify disk images anymore beyond the code signing signature (if available) + // Opt out of the old CRC checksum checks + // Also always pass -stdinpass so we gracefully handle password protected disk images even if we aren't expecting them + NSArray *arguments = @[@"attach", _archivePath, @"-mountpoint", mountPoint, @"-noverify", @"-nobrowse", @"-noautoopen", @"-stdinpass"]; + NSData *output = nil; NSInteger taskResult = -1; @@ -153,7 +161,7 @@ - (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier SPU_OBJC_DIRECT } if (@available(macOS 10.15, *)) { - if (![inputPipe.fileHandleForWriting writeData:promptData error:&error]) { + if (![inputPipe.fileHandleForWriting writeData:inputData error:&error]) { goto reportError; } } @@ -161,7 +169,7 @@ - (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier SPU_OBJC_DIRECT else { @try { - [inputPipe.fileHandleForWriting writeData:promptData]; + [inputPipe.fileHandleForWriting writeData:inputData]; } @catch (NSException *) { goto reportError; } @@ -175,12 +183,16 @@ - (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier SPU_OBJC_DIRECT taskResult = task.terminationStatus; } - + if (taskResult != 0) { NSString *resultStr = output ? [[NSString alloc] initWithData:output encoding:NSUTF8StringEncoding] : nil; SULog(SULogLevelError, @"hdiutil failed with code: %ld data: <<%@>>", (long)taskResult, resultStr); + + error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed due to hdiutil returning %ld status: %@", (long)taskResult, resultStr]}]; + goto reportError; } + mountedSuccessfully = YES; // Mounting can take some time, so increment progress @@ -271,13 +283,21 @@ - (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier SPU_OBJC_DIRECT [notifier notifyProgress:1.0]; - [notifier notifySuccess]; + BOOL success = YES; goto finally; reportError: - [notifier notifyFailureWithError:error]; + success = NO; finally: + if (!waitForCleanup) { + if (success) { + [notifier notifySuccess]; + } else { + [notifier notifyFailureWithError:error]; + } + } + if (mountedSuccessfully) { NSTask *task = [[NSTask alloc] init]; task.launchPath = @"/usr/bin/hdiutil"; @@ -289,10 +309,20 @@ - (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier SPU_OBJC_DIRECT if (![task launchAndReturnError:&launchCleanupError]) { SULog(SULogLevelError, @"Failed to unmount %@", mountPoint); SULog(SULogLevelError, @"Error: %@", launchCleanupError); + } else if (waitForCleanup) { + [task waitUntilExit]; } } else { SULog(SULogLevelError, @"Can't mount DMG %@", _archivePath); } + + if (waitForCleanup) { + if (success) { + [notifier notifySuccess]; + } else { + [notifier notifyFailureWithError:error]; + } + } } } diff --git a/Autoupdate/SUFlatPackageUnarchiver.m b/Autoupdate/SUFlatPackageUnarchiver.m index db6facf32..ba99c4ae8 100644 --- a/Autoupdate/SUFlatPackageUnarchiver.m +++ b/Autoupdate/SUFlatPackageUnarchiver.m @@ -44,7 +44,7 @@ - (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath extractionDi return self; } -- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock +- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock waitForCleanup:(BOOL)__unused waitForCleanup { SUUnarchiverNotifier *notifier = [[SUUnarchiverNotifier alloc] initWithCompletionBlock:completionBlock progressBlock:progressBlock]; diff --git a/Autoupdate/SUPipedUnarchiver.m b/Autoupdate/SUPipedUnarchiver.m index b7297617e..22bdec4d4 100644 --- a/Autoupdate/SUPipedUnarchiver.m +++ b/Autoupdate/SUPipedUnarchiver.m @@ -96,7 +96,7 @@ - (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory: return self; } -- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock +- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock waitForCleanup:(BOOL)__unused waitForCleanup { NSString *command = nil; NSArray *arguments = _argumentsConformingToTypeOfPath(_archivePath, YES, &command); diff --git a/Autoupdate/SUUnarchiverProtocol.h b/Autoupdate/SUUnarchiverProtocol.h index 15e92ee06..1c3ce6c56 100644 --- a/Autoupdate/SUUnarchiverProtocol.h +++ b/Autoupdate/SUUnarchiverProtocol.h @@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN + (BOOL)mustValidateBeforeExtractionWithArchivePath:(NSString *)archivePath; -- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock; +- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock waitForCleanup:(BOOL)waitForCleanup; - (NSString *)description; diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 04afdb88b..f2a7a47a0 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -171,12 +171,6 @@ 721D8A861D4ADFEB0032E472 /* SPULocalCacheDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = 721BC20D1D1CDE55002BC71E /* SPULocalCacheDirectory.m */; }; 721D8A871D4C5BF10032E472 /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; }; 722545B626805FF80036465C /* testappcast_info_updates.xml in Resources */ = {isa = PBXBuildFile; fileRef = 722545B526805FF80036465C /* testappcast_info_updates.xml */; }; - 72266A872946359600645376 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5E41D3D90AA00D1BF90 /* SUFileManager.m */; }; - 72266A88294635BA00645376 /* SUAppcastDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B767C91C9B707000A07552 /* SUAppcastDriver.m */; }; - 72266A89294636FB00645376 /* SUStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */; }; - 72266A8A2946493C00645376 /* SUCodeSigningVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5991D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m */; }; - 72266A8B29464CEA00645376 /* SUHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 61EF67550E25B58D00F754E0 /* SUHost.m */; }; - 72266A8C29464D0200645376 /* SUSignatures.m in Sources */ = {isa = PBXBuildFile; fileRef = EA1E286D22B665E8004AA304 /* SUSignatures.m */; }; 7229E1B61C97C91100CB50D0 /* SPUUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7229E1B51C97C91100CB50D0 /* SPUUpdateDriver.h */; }; 7229E1B91C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7229E1B71C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.h */; }; 7229E1BA1C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7229E1B81C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.m */; }; @@ -312,7 +306,6 @@ 7267E5FD1D3DD1B700D1BF90 /* SPUResumableUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7267E5FB1D3DD1B700D1BF90 /* SPUResumableUpdate.h */; }; 7269E494264798200088C213 /* SPUSkippedUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7269E492264798200088C213 /* SPUSkippedUpdate.h */; }; 7269E496264798200088C213 /* SPUSkippedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7269E493264798200088C213 /* SPUSkippedUpdate.m */; }; - 7269E4982648D3460088C213 /* SPUSkippedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7269E493264798200088C213 /* SPUSkippedUpdate.m */; }; 7269E49A2648F7C00088C213 /* SPUUserUpdateState.m in Sources */ = {isa = PBXBuildFile; fileRef = 7269E4992648F7C00088C213 /* SPUUserUpdateState.m */; }; 726DF88E1C84277600188804 /* SPUUserUpdateState.h in Headers */ = {isa = PBXBuildFile; fileRef = 726DF88D1C84277500188804 /* SPUUserUpdateState.h */; settings = {ATTRIBUTES = (Public, ); }; }; 726E075C1CA3A6D6001A286B /* SPUSecureCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E075A1CA3A6D6001A286B /* SPUSecureCoding.h */; }; @@ -3383,15 +3376,8 @@ buildActionMask = 2147483647; files = ( 72D04F3E2B097D4300A6DEAA /* SPUVerifierInformation.m in Sources */, - 72266A8C29464D0200645376 /* SUSignatures.m in Sources */, - 72266A8B29464CEA00645376 /* SUHost.m in Sources */, - 72266A8A2946493C00645376 /* SUCodeSigningVerifier.m in Sources */, - 72266A89294636FB00645376 /* SUStandardVersionComparator.m in Sources */, - 72266A88294635BA00645376 /* SUAppcastDriver.m in Sources */, - 72266A872946359600645376 /* SUFileManager.m in Sources */, 725EE488277D398100D820CE /* SPUDeltaArchive.m in Sources */, 725EE483277C767A00D820CE /* SPUXarDeltaArchive.m in Sources */, - 7269E4982648D3460088C213 /* SPUSkippedUpdate.m in Sources */, 721D5ABC25C680A300D23BEA /* SUFlatPackageUnarchiver.m in Sources */, 725F97771C8A62F500265BE4 /* SUAdHocCodeSigning.m in Sources */, 5A4094481C74EA5200983BE0 /* SUAppcastTest.swift in Sources */, diff --git a/Tests/SUUnarchiverTest.swift b/Tests/SUUnarchiverTest.swift index f337902ed..754af2030 100644 --- a/Tests/SUUnarchiverTest.swift +++ b/Tests/SUUnarchiverTest.swift @@ -50,7 +50,7 @@ class SUUnarchiverTest: XCTestCase unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in XCTAssertNotNil(error) testExpectation.fulfill() - }, progressBlock: nil) + }, progressBlock: nil, waitForCleanup: true) } // swiftlint:disable function_parameter_count @@ -65,7 +65,7 @@ class SUUnarchiverTest: XCTestCase XCTAssertNotNil(error) } testExpectation.fulfill() - }, progressBlock: nil) + }, progressBlock: nil, waitForCleanup: true) } func testUnarchivingZip() @@ -132,11 +132,36 @@ class SUUnarchiverTest: XCTestCase self.unarchiveTestAppWithExtension("enc.nolicense.dmg", password: "testpass") } + func testUnarchivingEncryptedDmgWithLicenseAndWithIncorrectPassword() + { + self.unarchiveTestAppWithExtension("enc.dmg", password: "moo", expectingSuccess: false) + } + + func testUnarchivingEncryptedDmgWithLicenseAndWithoutPassword() + { + self.unarchiveTestAppWithExtension("enc.dmg", expectingSuccess: false) + } + + func testUnarchivingEncryptedDmgWithoutLicenseAndWithIncorrectPassword() + { + self.unarchiveTestAppWithExtension("enc.nolicense.dmg", password: "moo", expectingSuccess: false) + } + + func testUnarchivingEncryptedDmgWithoutLicenseAndWithoutPassword() + { + self.unarchiveTestAppWithExtension("enc.nolicense.dmg", expectingSuccess: false) + } + func testUnarchivingAPFSDMG() { self.unarchiveTestAppWithExtension("dmg", resourceName: "SparkleTestCodeSign_apfs") } + func testUnarchivingAPFSDMGWithBogusPassword() + { + self.unarchiveTestAppWithExtension("dmg", password: "moo", resourceName: "SparkleTestCodeSign_apfs") + } + func testUnarchivingAPFSAdhocSignedDMGWithAuxFiles() { self.unarchiveTestAppWithExtension("dmg", resourceName: "SparkleTestCodeSign_apfs_lzma_aux_files") From 1dd0d276b0461cb75c09e60bd3994e2f24f8da92 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 14 Sep 2024 12:30:08 -0700 Subject: [PATCH 2/6] Move notifying success/failure after detaching dmg in all cases --- Autoupdate/SUDiskImageUnarchiver.m | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Autoupdate/SUDiskImageUnarchiver.m b/Autoupdate/SUDiskImageUnarchiver.m index c95a6ff43..e3b2ccabc 100644 --- a/Autoupdate/SUDiskImageUnarchiver.m +++ b/Autoupdate/SUDiskImageUnarchiver.m @@ -290,14 +290,6 @@ - (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier waitForCleanup:( success = NO; finally: - if (!waitForCleanup) { - if (success) { - [notifier notifySuccess]; - } else { - [notifier notifyFailureWithError:error]; - } - } - if (mountedSuccessfully) { NSTask *task = [[NSTask alloc] init]; task.launchPath = @"/usr/bin/hdiutil"; @@ -316,12 +308,10 @@ - (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier waitForCleanup:( SULog(SULogLevelError, @"Can't mount DMG %@", _archivePath); } - if (waitForCleanup) { - if (success) { - [notifier notifySuccess]; - } else { - [notifier notifyFailureWithError:error]; - } + if (success) { + [notifier notifySuccess]; + } else { + [notifier notifyFailureWithError:error]; } } } From 5bfaf1ef6e5af36d35547668d3ba800db6d2a58a Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 14 Sep 2024 20:01:16 -0700 Subject: [PATCH 3/6] Fix compile error in generate_appcast --- generate_appcast/Unarchive.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_appcast/Unarchive.swift b/generate_appcast/Unarchive.swift index bf02f5796..5d2303a86 100644 --- a/generate_appcast/Unarchive.swift +++ b/generate_appcast/Unarchive.swift @@ -25,7 +25,7 @@ func unarchive(itemPath: URL, archiveDestDir: URL, callback: @escaping (Error?) } catch { callback(error) } - }, progressBlock: nil) + }, progressBlock: nil, waitForCleanup: true) } else { callback(makeError(code: .unarchivingError, "Not a supported archive format: \(itemPath.path)")) } From c571a48633da5d2aa39886c67f4ddd253945b18a Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 14 Sep 2024 20:09:05 -0700 Subject: [PATCH 4/6] Respond with empty password when no password is specified --- Autoupdate/SUDiskImageUnarchiver.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Autoupdate/SUDiskImageUnarchiver.m b/Autoupdate/SUDiskImageUnarchiver.m index e3b2ccabc..f05e72b74 100644 --- a/Autoupdate/SUDiskImageUnarchiver.m +++ b/Autoupdate/SUDiskImageUnarchiver.m @@ -100,11 +100,11 @@ - (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier waitForCleanup:( // Prepare stdin data for passwords and license agreements { + // If no password is supplied, we will still be asked a password. + // In that case we respond with an empty password. NSData *decryptionPasswordData = [_decryptionPassword dataUsingEncoding:NSUTF8StringEncoding]; if (decryptionPasswordData != nil) { [inputData appendData:decryptionPasswordData]; - } else { - [inputData appendBytes:"y" length:1]; } // From the hdiutil docs: From 0d138b55869717802a051d3993c2ec8dd557a54e Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 14 Sep 2024 20:41:13 -0700 Subject: [PATCH 5/6] Fix decryption password not being passed to installer correctly --- Autoupdate/AppInstaller.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Autoupdate/AppInstaller.m b/Autoupdate/AppInstaller.m index 924dfa65b..49a76a9fd 100644 --- a/Autoupdate/AppInstaller.m +++ b/Autoupdate/AppInstaller.m @@ -499,6 +499,7 @@ - (void)handleMessageWithIdentifier:(int32_t)identifier data:(NSData *)data self->_signatures = installationData.signatures; self->_updateDirectoryPath = cacheInstallationPath; self->_extractionDirectory = extractionDirectory; + self->_decryptionPassword = installationData.decryptionPassword; self->_host = [[SUHost alloc] initWithBundle:hostBundle]; self->_verifierInformation = [[SPUVerifierInformation alloc] initWithExpectedVersion:installationData.expectedVersion expectedContentLength:installationData.expectedContentLength]; From 1e3716f6f9f0c4ecd3e34aeee2b5e322a4282387 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 14 Sep 2024 21:13:11 -0700 Subject: [PATCH 6/6] Undo unrelated project setting changes for unit tests target --- Sparkle.xcodeproj/project.pbxproj | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index f2a7a47a0..04afdb88b 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -171,6 +171,12 @@ 721D8A861D4ADFEB0032E472 /* SPULocalCacheDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = 721BC20D1D1CDE55002BC71E /* SPULocalCacheDirectory.m */; }; 721D8A871D4C5BF10032E472 /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; }; 722545B626805FF80036465C /* testappcast_info_updates.xml in Resources */ = {isa = PBXBuildFile; fileRef = 722545B526805FF80036465C /* testappcast_info_updates.xml */; }; + 72266A872946359600645376 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5E41D3D90AA00D1BF90 /* SUFileManager.m */; }; + 72266A88294635BA00645376 /* SUAppcastDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B767C91C9B707000A07552 /* SUAppcastDriver.m */; }; + 72266A89294636FB00645376 /* SUStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */; }; + 72266A8A2946493C00645376 /* SUCodeSigningVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5991D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m */; }; + 72266A8B29464CEA00645376 /* SUHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 61EF67550E25B58D00F754E0 /* SUHost.m */; }; + 72266A8C29464D0200645376 /* SUSignatures.m in Sources */ = {isa = PBXBuildFile; fileRef = EA1E286D22B665E8004AA304 /* SUSignatures.m */; }; 7229E1B61C97C91100CB50D0 /* SPUUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7229E1B51C97C91100CB50D0 /* SPUUpdateDriver.h */; }; 7229E1B91C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7229E1B71C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.h */; }; 7229E1BA1C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7229E1B81C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.m */; }; @@ -306,6 +312,7 @@ 7267E5FD1D3DD1B700D1BF90 /* SPUResumableUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7267E5FB1D3DD1B700D1BF90 /* SPUResumableUpdate.h */; }; 7269E494264798200088C213 /* SPUSkippedUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7269E492264798200088C213 /* SPUSkippedUpdate.h */; }; 7269E496264798200088C213 /* SPUSkippedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7269E493264798200088C213 /* SPUSkippedUpdate.m */; }; + 7269E4982648D3460088C213 /* SPUSkippedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7269E493264798200088C213 /* SPUSkippedUpdate.m */; }; 7269E49A2648F7C00088C213 /* SPUUserUpdateState.m in Sources */ = {isa = PBXBuildFile; fileRef = 7269E4992648F7C00088C213 /* SPUUserUpdateState.m */; }; 726DF88E1C84277600188804 /* SPUUserUpdateState.h in Headers */ = {isa = PBXBuildFile; fileRef = 726DF88D1C84277500188804 /* SPUUserUpdateState.h */; settings = {ATTRIBUTES = (Public, ); }; }; 726E075C1CA3A6D6001A286B /* SPUSecureCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E075A1CA3A6D6001A286B /* SPUSecureCoding.h */; }; @@ -3376,8 +3383,15 @@ buildActionMask = 2147483647; files = ( 72D04F3E2B097D4300A6DEAA /* SPUVerifierInformation.m in Sources */, + 72266A8C29464D0200645376 /* SUSignatures.m in Sources */, + 72266A8B29464CEA00645376 /* SUHost.m in Sources */, + 72266A8A2946493C00645376 /* SUCodeSigningVerifier.m in Sources */, + 72266A89294636FB00645376 /* SUStandardVersionComparator.m in Sources */, + 72266A88294635BA00645376 /* SUAppcastDriver.m in Sources */, + 72266A872946359600645376 /* SUFileManager.m in Sources */, 725EE488277D398100D820CE /* SPUDeltaArchive.m in Sources */, 725EE483277C767A00D820CE /* SPUXarDeltaArchive.m in Sources */, + 7269E4982648D3460088C213 /* SPUSkippedUpdate.m in Sources */, 721D5ABC25C680A300D23BEA /* SUFlatPackageUnarchiver.m in Sources */, 725F97771C8A62F500265BE4 /* SUAdHocCodeSigning.m in Sources */, 5A4094481C74EA5200983BE0 /* SUAppcastTest.swift in Sources */,