mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56e365d050 | ||
|
|
c983fa1548 | ||
|
|
ef1f03cf1e | ||
|
|
4d164ba4ab | ||
|
|
66c198932d | ||
|
|
24f0f3952d | ||
|
|
7e5ebca735 | ||
|
|
001d6d6a69 | ||
|
|
9e9830eb0f | ||
|
|
615043da2b | ||
|
|
485f0e661d | ||
|
|
f1daff840f | ||
|
|
b84c1b14ce | ||
|
|
0a92e049eb | ||
|
|
1a0b023e1c | ||
|
|
1e419c8c16 | ||
|
|
ac6c897dd5 | ||
|
|
5a708be2a5 | ||
|
|
82209831c0 | ||
|
|
70a9ad52ae | ||
|
|
a00fd1d323 |
No files matched your search
+12
-11
@@ -10,25 +10,28 @@ jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
xcode: ['xcode14.3.1', 'xcode15']
|
||||
xcode: ['xcode14.3.1', 'xcode15.2']
|
||||
include:
|
||||
- xcode: 'xcode15'
|
||||
xcode-path: '/Applications/Xcode_15.0.app/Contents/Developer'
|
||||
upload-dist: false
|
||||
- xcode: 'xcode15.2'
|
||||
xcode-path: '/Applications/Xcode_15.2.app/Contents/Developer'
|
||||
upload-dist: true
|
||||
run-analyzer: true
|
||||
macos: 'macos-13'
|
||||
- xcode: 'xcode14.3.1'
|
||||
xcode-path: '/Applications/Xcode_14.3.1.app/Contents/Developer'
|
||||
upload-dist: true
|
||||
upload-dist: false
|
||||
run-analyzer: false
|
||||
macos: 'macos-13'
|
||||
|
||||
name: Build and Test Sparkle
|
||||
runs-on: ${{ matrix.macos }}
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
@@ -80,11 +83,9 @@ jobs:
|
||||
|
||||
- name: Post Analyzed Warnings
|
||||
if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' && steps.findwarnings.outputs.analyzestatus == '0' }}
|
||||
uses: mshick/add-pr-comment@v1
|
||||
uses: mshick/add-pr-comment@v2
|
||||
with:
|
||||
allow-repeats: false
|
||||
repo-token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
|
||||
repo-token-user-login: 'Sparkle-Bot'
|
||||
message: "``` ${{ steps.warnings.outputs.content }} ```"
|
||||
|
||||
- name: Build Release Distribution
|
||||
@@ -94,13 +95,13 @@ jobs:
|
||||
xcodebuild build -project Sparkle.xcodeproj -scheme Distribution -configuration Release -derivedDataPath build
|
||||
- name: Archive Test Results
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-logs
|
||||
path: build/Logs
|
||||
- name: Upload Distribution
|
||||
if: ${{ success() && matrix.upload-dist }}
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Sparkle-distribution-${{ matrix.xcode }}.tar.xz
|
||||
path: build/Build/Products/Release/sparkle-dist.tar.xz
|
||||
@@ -2,7 +2,7 @@ name: "Create Draft Release"
|
||||
|
||||
env:
|
||||
BUILDDIR: "build"
|
||||
DEVELOPER_DIR: "/Applications/Xcode_14.3.1.app/Contents/Developer"
|
||||
DEVELOPER_DIR: "/Applications/Xcode_15.2.app/Contents/Developer"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: "Checkout sources"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
|
||||
submodules: true
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#import "SPUInstallerAgentProtocol.h"
|
||||
#import "SPUInstallationType.h"
|
||||
#import "SPULocalCacheDirectory.h"
|
||||
#import "SPUVerifierInformation.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
@@ -63,6 +64,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
SUSignatures *_signatures;
|
||||
NSString *_relaunchPath;
|
||||
NSString *_installationType;
|
||||
SPUVerifierInformation *_verifierInformation;
|
||||
|
||||
id<SUInstallerProtocol> _installer;
|
||||
|
||||
@@ -179,7 +181,15 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
|
||||
success = NO;
|
||||
} else {
|
||||
_updateValidator = [[SUUpdateValidator alloc] initWithDownloadPath:archivePath signatures:_signatures host:_host];
|
||||
NSError *fileAttributesError = nil;
|
||||
NSDictionary<NSFileAttributeKey, id> *archiveFileAttributes = [NSFileManager.defaultManager attributesOfItemAtPath:archivePath error:&fileAttributesError];
|
||||
if (archiveFileAttributes == nil) {
|
||||
SULog(SULogLevelError, @"Failed to retrieve file attributes from archive: %@.", fileAttributesError);
|
||||
} else {
|
||||
_verifierInformation.actualContentLength = (uint64_t)(archiveFileAttributes.fileSize);
|
||||
}
|
||||
|
||||
_updateValidator = [[SUUpdateValidator alloc] initWithDownloadPath:archivePath signatures:_signatures host:_host verifierInformation:_verifierInformation];
|
||||
|
||||
// Delta & package updates 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
|
||||
@@ -451,6 +461,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
self->_signatures = installationData.signatures;
|
||||
self->_updateDirectoryPath = cacheInstallationPath;
|
||||
self->_host = [[SUHost alloc] initWithBundle:hostBundle];
|
||||
self->_verifierInformation = [[SPUVerifierInformation alloc] initWithExpectedVersion:installationData.expectedVersion expectedContentLength:installationData.expectedContentLength];
|
||||
|
||||
[self extractAndInstallUpdate];
|
||||
});
|
||||
|
||||
@@ -21,8 +21,10 @@ SPU_OBJC_DIRECT_MEMBERS @interface SPUInstallationInputData : NSObject <NSSecure
|
||||
* downloadName - name of update archive in update directory
|
||||
* signatures - signatures for the update that came from the appcast item
|
||||
* decryptionPassword - optional decryption password for dmg archives
|
||||
* expectedVersion - optional expected version of the new update
|
||||
* expectedContentLength - optional expected content length of the new download archive
|
||||
*/
|
||||
- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateURLBookmarkData:(NSData *)updateURLBookmarkData installationType:(NSString *)installationType signatures:(SUSignatures * _Nullable)signatures decryptionPassword:(nullable NSString *)decryptionPassword;
|
||||
- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateURLBookmarkData:(NSData *)updateURLBookmarkData installationType:(NSString *)installationType signatures:(SUSignatures * _Nullable)signatures decryptionPassword:(nullable NSString *)decryptionPassword expectedVersion:(NSString *)expectedVersion expectedContentLength:(uint64_t)expectedContentLength;
|
||||
|
||||
@property (nonatomic, copy, readonly) NSString *relaunchPath;
|
||||
@property (nonatomic, copy, readonly) NSString *hostBundlePath;
|
||||
@@ -30,6 +32,8 @@ SPU_OBJC_DIRECT_MEMBERS @interface SPUInstallationInputData : NSObject <NSSecure
|
||||
@property (nonatomic, copy, readonly) NSString *installationType;
|
||||
@property (nonatomic, readonly, nullable) SUSignatures *signatures; // nullable because although not using signatures is deprecated, it's still supported
|
||||
@property (nonatomic, copy, readonly, nullable) NSString *decryptionPassword;
|
||||
@property (nonatomic, copy, readonly, nullable) NSString *expectedVersion;
|
||||
@property (nonatomic, readonly) uint64_t expectedContentLength;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ static NSString *SUUpdateURLBookmarkDataKey = @"SUUpdateURLBookmarkData";
|
||||
static NSString *SUSignaturesKey = @"SUSignatures";
|
||||
static NSString *SUDecryptionPasswordKey = @"SUDecryptionPassword";
|
||||
static NSString *SUInstallationTypeKey = @"SUInstallationType";
|
||||
static NSString *SUExpectedVersionKey = @"SUExpectedVersion";
|
||||
static NSString *SUExpectedContentLength = @"SUExpectedContentLength";
|
||||
|
||||
@implementation SPUInstallationInputData
|
||||
|
||||
@@ -27,8 +29,10 @@ static NSString *SUInstallationTypeKey = @"SUInstallationType";
|
||||
@synthesize signatures = _signatures;
|
||||
@synthesize decryptionPassword = _decryptionPassword;
|
||||
@synthesize installationType = _installationType;
|
||||
@synthesize expectedVersion = _expectedVersion;
|
||||
@synthesize expectedContentLength = _expectedContentLength;
|
||||
|
||||
- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateURLBookmarkData:(NSData *)updateURLBookmarkData installationType:(NSString *)installationType signatures:(SUSignatures * _Nullable)signatures decryptionPassword:(nullable NSString *)decryptionPassword
|
||||
- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateURLBookmarkData:(NSData *)updateURLBookmarkData installationType:(NSString *)installationType signatures:(SUSignatures * _Nullable)signatures decryptionPassword:(nullable NSString *)decryptionPassword expectedVersion:(nonnull NSString *)expectedVersion expectedContentLength:(uint64_t)expectedContentLength
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
@@ -41,6 +45,9 @@ static NSString *SUInstallationTypeKey = @"SUInstallationType";
|
||||
|
||||
_signatures = signatures;
|
||||
_decryptionPassword = [decryptionPassword copy];
|
||||
|
||||
_expectedVersion = [expectedVersion copy];
|
||||
_expectedContentLength = expectedContentLength;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -74,7 +81,10 @@ static NSString *SUInstallationTypeKey = @"SUInstallationType";
|
||||
|
||||
NSString *decryptionPassword = [decoder decodeObjectOfClass:[NSString class] forKey:SUDecryptionPasswordKey];
|
||||
|
||||
return [self initWithRelaunchPath:relaunchPath hostBundlePath:hostBundlePath updateURLBookmarkData:updateURLBookmarkData installationType:installationType signatures:signatures decryptionPassword:decryptionPassword];
|
||||
NSString *expectedVersion = [decoder decodeObjectOfClass:[NSString class] forKey:SUExpectedVersionKey];
|
||||
uint64_t expectedContentLength = (uint64_t)[decoder decodeInt64ForKey:SUExpectedContentLength];
|
||||
|
||||
return [self initWithRelaunchPath:relaunchPath hostBundlePath:hostBundlePath updateURLBookmarkData:updateURLBookmarkData installationType:installationType signatures:signatures decryptionPassword:decryptionPassword expectedVersion:expectedVersion expectedContentLength:expectedContentLength];
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)coder
|
||||
@@ -87,6 +97,10 @@ static NSString *SUInstallationTypeKey = @"SUInstallationType";
|
||||
if (_decryptionPassword != nil) {
|
||||
[coder encodeObject:_decryptionPassword forKey:SUDecryptionPasswordKey];
|
||||
}
|
||||
if (_expectedVersion != nil) {
|
||||
[coder encodeObject:_expectedVersion forKey:SUExpectedVersionKey];
|
||||
}
|
||||
[coder encodeInt64:(int64_t)_expectedContentLength forKey:SUExpectedContentLength];
|
||||
}
|
||||
|
||||
+ (BOOL)supportsSecureCoding
|
||||
|
||||
@@ -24,6 +24,9 @@ SPU_OBJC_DIRECT_MEMBERS
|
||||
+ (BOOL)codeSignatureIsValidAtBundleURL:(NSURL *)bundleURL error:(NSError *__autoreleasing *)error;
|
||||
|
||||
+ (BOOL)bundleAtURLIsCodeSigned:(NSURL *)bundleURL;
|
||||
|
||||
+ (BOOL)teamIdentifierAtURL:(NSURL *)url1 matchesTeamIdentifierAtURL:(NSURL *)url2;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -258,4 +258,43 @@ static id valueOrNSNull(id value) {
|
||||
return (result == 0);
|
||||
}
|
||||
|
||||
static NSString * _Nullable teamIdentifierAtURL(NSURL *url)
|
||||
{
|
||||
SecStaticCodeRef staticCode = NULL;
|
||||
OSStatus staticCodeResult = SecStaticCodeCreateWithPath((__bridge CFURLRef)url, kSecCSDefaultFlags, &staticCode);
|
||||
if (staticCodeResult != noErr) {
|
||||
SULog(SULogLevelError, @"Failed to get static code for retrieving team identifier: %d", staticCodeResult);
|
||||
return nil;
|
||||
}
|
||||
|
||||
CFDictionaryRef cfSigningInformation = NULL;
|
||||
OSStatus copySigningInfoCode = SecCodeCopySigningInformation(staticCode, kSecCSSigningInformation,
|
||||
&cfSigningInformation);
|
||||
|
||||
NSDictionary *signingInformation = CFBridgingRelease(cfSigningInformation);
|
||||
|
||||
if (copySigningInfoCode != noErr) {
|
||||
SULog(SULogLevelError, @"Failed to get signing information for retrieving team identifier: %d", copySigningInfoCode);
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Note this will return nil for ad-hoc or unsigned binaries
|
||||
return signingInformation[(NSString *)kSecCodeInfoTeamIdentifier];
|
||||
}
|
||||
|
||||
+ (BOOL)teamIdentifierAtURL:(NSURL *)url1 matchesTeamIdentifierAtURL:(NSURL *)url2
|
||||
{
|
||||
NSString *teamIdentifierForURL1 = teamIdentifierAtURL(url1);
|
||||
if (teamIdentifierForURL1 == nil) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
NSString *teamIdentifierForURL2 = teamIdentifierAtURL(url2);
|
||||
if (teamIdentifierForURL2 == nil) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [teamIdentifierForURL1 isEqualToString:teamIdentifierForURL2];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -14,6 +14,7 @@
|
||||
#import "SUErrors.h"
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
#import "SUStandardVersionComparator.h"
|
||||
#import "SUCodeSigningVerifier.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
@@ -41,7 +42,7 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)_performInitialInstallationWithFileManager:(SUFileManager *)fileManager oldBundleURL:(NSURL *)oldBundleURL newBundleURL:(NSURL *)newBundleURL progressBlock:(nullable void(^)(double))progress SPU_OBJC_DIRECT
|
||||
- (void)_performInitialInstallationWithFileManager:(SUFileManager *)fileManager oldBundleURL:(NSURL *)oldBundleURL newBundleURL:(NSURL *)newBundleURL skipGatekeeperScan:(BOOL)skipGatekeeperScan progressBlock:(nullable void(^)(double))progress SPU_OBJC_DIRECT
|
||||
{
|
||||
// Release our new app from quarantine
|
||||
NSError *quarantineError = nil;
|
||||
@@ -88,6 +89,47 @@
|
||||
if (progress) {
|
||||
progress(8/11.0);
|
||||
}
|
||||
|
||||
if (!skipGatekeeperScan) {
|
||||
// Perform a Gatekeeper scan to pre-warm the app launch
|
||||
// This avoids users seeing a "Verifying..." dialog when the installed update is launched
|
||||
// Note the tool we use to perform the Gatekeeper scan (gktool) is technically available on macOS 14.0,
|
||||
// however there are some potential bugs/issues with performing a Gatekeeper scan on versions before 14.4:
|
||||
// https://github.com/sparkle-project/Sparkle/issues/2491
|
||||
if (@available(macOS 14.4, *)) {
|
||||
// Only perform Gatekeeper scan if we're updating an app bundle
|
||||
NSString *newBundlePath = newBundleURL.path;
|
||||
if ([newBundlePath.pathExtension caseInsensitiveCompare:@"app"] == NSOrderedSame) {
|
||||
// We only invoke gktool if Autoupdate is signed with the same team identifier as the new update bundle
|
||||
// Otherwise we may unfortunately run into some Privacy & Security prompt bugs in the OS (note this is *not* a security check)
|
||||
// This does overall imply that for an app to test the gktool path, this path may often skipped for most common development workflows that don't
|
||||
// re-sign Sparkle's Autoupdate helper
|
||||
NSURL *mainExecutableURL = NSBundle.mainBundle.executableURL;
|
||||
if (mainExecutableURL != nil && [SUCodeSigningVerifier teamIdentifierAtURL:mainExecutableURL matchesTeamIdentifierAtURL:newBundleURL]) {
|
||||
NSURL *gktoolURL = [NSURL fileURLWithPath:@"/usr/bin/gktool" isDirectory:NO];
|
||||
if ([gktoolURL checkResourceIsReachableAndReturnError:NULL]) {
|
||||
NSTask *gatekeeperScanTask = [[NSTask alloc] init];
|
||||
gatekeeperScanTask.executableURL = gktoolURL;
|
||||
gatekeeperScanTask.arguments = @[@"scan", newBundlePath];
|
||||
|
||||
NSError *taskError;
|
||||
if (![gatekeeperScanTask launchAndReturnError:&taskError]) {
|
||||
// Not a fatal error
|
||||
SULog(SULogLevelError, @"Failed to perform GateKeeper scan on '%@' with error %@", newBundlePath, taskError);
|
||||
} else {
|
||||
[gatekeeperScanTask waitUntilExit];
|
||||
|
||||
if (gatekeeperScanTask.terminationStatus != 0) {
|
||||
SULog(SULogLevelError, @"gktool failed and returned exit status %d", gatekeeperScanTask.terminationStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
SULog(SULogLevelDefault, @"Skipping invocation of gktool because Autoupdate is not signed with same identity as the new update %@", newBundleURL.lastPathComponent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +231,9 @@
|
||||
}
|
||||
|
||||
if (!_newAndOldBundlesOnSameVolume) {
|
||||
[self _performInitialInstallationWithFileManager:fileManager oldBundleURL:oldURL newBundleURL:newFinalURL progressBlock:progress];
|
||||
// If we're updating a bundle on another volume, the install process can be pretty slow.
|
||||
// In this case let's get out of the way and skip the Gatekeeper scan
|
||||
[self _performInitialInstallationWithFileManager:fileManager oldBundleURL:oldURL newBundleURL:newFinalURL skipGatekeeperScan:YES progressBlock:progress];
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
@@ -312,7 +356,7 @@
|
||||
|
||||
// We can do a lot of the installation work ahead of time if the new app update does not need to be copied to another volume
|
||||
if (_newAndOldBundlesOnSameVolume) {
|
||||
[self _performInitialInstallationWithFileManager:fileManager oldBundleURL:_host.bundle.bundleURL newBundleURL:bundle.bundleURL progressBlock:NULL];
|
||||
[self _performInitialInstallationWithFileManager:fileManager oldBundleURL:_host.bundle.bundleURL newBundleURL:bundle.bundleURL skipGatekeeperScan:NO progressBlock:NULL];
|
||||
}
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -18,15 +18,22 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
@class SUSignatures;
|
||||
@class SUPublicKeys;
|
||||
@class SPUVerifierInformation;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
SPU_OBJC_DIRECT_MEMBERS @interface SUSignatureVerifier : NSObject
|
||||
|
||||
+ (BOOL)validatePath:(NSString *)path withSignatures:(SUSignatures *)signatures withPublicKeys:(SUPublicKeys *)pkeys error:(NSError * __autoreleasing *)error;
|
||||
+ (BOOL)validatePath:(NSString *)path withSignatures:(SUSignatures *)signatures withPublicKeys:(SUPublicKeys *)pkeys verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation error:(NSError * __autoreleasing *)error;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
- (instancetype)initWithPublicKeys:(SUPublicKeys *)pkeys;
|
||||
|
||||
- (BOOL)verifyFileAtPath:(NSString *)path signatures:(SUSignatures *)signatures error:(NSError * __autoreleasing *)error;
|
||||
- (BOOL)verifyFileAtPath:(NSString *)path signatures:(SUSignatures *)signatures verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation error:(NSError * __autoreleasing *)error;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif
|
||||
@@ -16,6 +16,8 @@
|
||||
#import "SULog.h"
|
||||
#import "SUSignatures.h"
|
||||
#import "SUErrors.h"
|
||||
#import "SPUVerifierInformation.h"
|
||||
#import "SUConstants.h"
|
||||
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
|
||||
#include <CommonCrypto/CommonDigest.h>
|
||||
#endif
|
||||
@@ -29,7 +31,7 @@
|
||||
SUPublicKeys *_pubKeys;
|
||||
}
|
||||
|
||||
+ (BOOL)validatePath:(NSString *)path withSignatures:(SUSignatures *)signatures withPublicKeys:(SUPublicKeys *)pkeys error:(NSError * __autoreleasing *)error
|
||||
+ (BOOL)validatePath:(NSString *)path withSignatures:(SUSignatures *)signatures withPublicKeys:(SUPublicKeys *)pkeys verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation error:(NSError * __autoreleasing *)error
|
||||
{
|
||||
SUSignatureVerifier *verifier = [(SUSignatureVerifier *)[self alloc] initWithPublicKeys:pkeys];
|
||||
|
||||
@@ -40,7 +42,7 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [verifier verifyFileAtPath:path signatures:signatures error:error];
|
||||
return [verifier verifyFileAtPath:path signatures:signatures verifierInformation:verifierInformation error:error];
|
||||
}
|
||||
|
||||
- (instancetype)initWithPublicKeys:(SUPublicKeys *)pubkeys
|
||||
@@ -90,7 +92,7 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
- (BOOL)verifyFileAtPath:(NSString *)path signatures:(SUSignatures *)signatures error:(NSError * __autoreleasing *)error
|
||||
- (BOOL)verifyFileAtPath:(NSString *)path signatures:(SUSignatures *)signatures verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation error:(NSError * __autoreleasing *)error
|
||||
{
|
||||
if (!path || !path.length) {
|
||||
if (error != NULL) {
|
||||
@@ -176,9 +178,31 @@
|
||||
return YES;
|
||||
}
|
||||
} else {
|
||||
NSString *message = @"EdDSA signature does not match. Data of the update file being checked is different than data that has been signed, or the public key and the private key are not from the same set.";
|
||||
NSMutableString *message = [NSMutableString stringWithString:@"EdDSA signature does not match. Data of the update file being checked is different than data that has been signed, or the public key and the private key are not from the same set."];
|
||||
|
||||
SULog(SULogLevelError, @"%@", message);
|
||||
// Elaborate on the error message if we have more information about the download archive
|
||||
if (verifierInformation != nil) {
|
||||
BOOL reportedDiscrepancy = NO;
|
||||
|
||||
if (verifierInformation.expectedContentLength > 0 && verifierInformation.actualContentLength > 0) {
|
||||
if (verifierInformation.expectedContentLength != verifierInformation.actualContentLength) {
|
||||
[message appendFormat:@" The downloaded update (%@) is likely different than the signed archive because the expected content length from the appcast item (%llu bytes) differs from the downloaded archive length (%llu bytes).", path.lastPathComponent, verifierInformation.expectedContentLength, verifierInformation.actualContentLength];
|
||||
reportedDiscrepancy = YES;
|
||||
}
|
||||
}
|
||||
|
||||
NSString *actualVersion = verifierInformation.actualVersion;
|
||||
if (actualVersion != nil && ![verifierInformation.expectedVersion isEqualToString:actualVersion]) {
|
||||
[message appendFormat:@" The downloaded update (%@) also has a CFBundleVersion (%@) which differs from the %@ in the appcast item (%@).", path.lastPathComponent, actualVersion, SUAppcastAttributeVersion, verifierInformation.expectedVersion];
|
||||
reportedDiscrepancy = YES;
|
||||
}
|
||||
|
||||
if (!reportedDiscrepancy && verifierInformation.expectedContentLength > 0) {
|
||||
[message appendFormat:@" The downloaded update (%@) is likely not signed correctly because the archive has the expected content length (%llu bytes)%@ which matches the appcast item.", path.lastPathComponent, verifierInformation.actualContentLength, (actualVersion == nil ? @"" : [NSString stringWithFormat:@" and CFBundleVersion (%@)", actualVersion])];
|
||||
}
|
||||
}
|
||||
|
||||
SULog(SULogLevelError, @"%@", [message copy]);
|
||||
|
||||
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
|
||||
if (signatures.dsaSignatureStatus != SUSigningInputStatusAbsent) {
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
# 2.6.0
|
||||
|
||||
* Perform Gatekeeper scan to pre-warm app launch (#2505) (Zorg)
|
||||
* Disable sandboxing for the Downloader XPC service by default to fix downloader prompt warnings (#2511) (Zorg)
|
||||
* Store private seed as the secret for newly generated keys (#2472) (Zorg)
|
||||
* Improve signing error message to developers (#2471) (Zorg)
|
||||
* Update Korean localization (#2504) (CheolHyun Mun)
|
||||
* Use $PROJECT_DIR instead of $SRCROOT (#2489) (Zorg)
|
||||
* Set Package.swift minimum deployment to macOS 10.13 (#2481) (Zorg)
|
||||
* Fix false positive analyzer warning about resumableUpdate type (#2454) (Zorg)
|
||||
|
||||
# 2.5.2
|
||||
|
||||
* Don't clean up update directory when Autoupdate receives SIGTERM (#2479) (Zorg)
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "2.2.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0/Sparkle-2.2.0.tar.xz", "2.2.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.1/Sparkle-2.2.1.tar.xz", "2.2.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.2/Sparkle-2.2.2.tar.xz", "2.3.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.1/Sparkle-2.3.0-beta.1.tar.xz", "2.3.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.2/Sparkle-2.3.0-beta.2.tar.xz", "2.3.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0/Sparkle-2.3.0.tar.xz", "2.3.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.1/Sparkle-2.3.1.tar.xz", "2.3.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.2/Sparkle-2.3.2.tar.xz", "2.4.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.1/Sparkle-2.4.0-beta.1.tar.xz", "2.4.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.2/Sparkle-2.4.0-beta.2.tar.xz", "2.4.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0/Sparkle-2.4.0.tar.xz", "2.4.1-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1-beta.1/Sparkle-2.4.1-beta.1.tar.xz", "2.4.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1/Sparkle-2.4.1.tar.xz", "2.4.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz", "2.5.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.1/Sparkle-2.5.0-beta.1.tar.xz", "2.5.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.2/Sparkle-2.5.0-beta.2.tar.xz", "2.5.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0/Sparkle-2.5.0.tar.xz", "2.5.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.1/Sparkle-2.5.1.tar.xz", "2.5.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.2/Sparkle-2.5.2.tar.xz"}
|
||||
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "2.2.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0/Sparkle-2.2.0.tar.xz", "2.2.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.1/Sparkle-2.2.1.tar.xz", "2.2.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.2/Sparkle-2.2.2.tar.xz", "2.3.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.1/Sparkle-2.3.0-beta.1.tar.xz", "2.3.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.2/Sparkle-2.3.0-beta.2.tar.xz", "2.3.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0/Sparkle-2.3.0.tar.xz", "2.3.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.1/Sparkle-2.3.1.tar.xz", "2.3.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.2/Sparkle-2.3.2.tar.xz", "2.4.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.1/Sparkle-2.4.0-beta.1.tar.xz", "2.4.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.2/Sparkle-2.4.0-beta.2.tar.xz", "2.4.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0/Sparkle-2.4.0.tar.xz", "2.4.1-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1-beta.1/Sparkle-2.4.1-beta.1.tar.xz", "2.4.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1/Sparkle-2.4.1.tar.xz", "2.4.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz", "2.5.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.1/Sparkle-2.5.0-beta.1.tar.xz", "2.5.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.2/Sparkle-2.5.0-beta.2.tar.xz", "2.5.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0/Sparkle-2.5.0.tar.xz", "2.5.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.1/Sparkle-2.5.1.tar.xz", "2.5.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.2/Sparkle-2.5.2.tar.xz", "2.6.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0-beta.1/Sparkle-2.6.0-beta.1.tar.xz"}
|
||||
@@ -76,7 +76,27 @@ XPC_SERVICE_BUNDLE_ID_PREFIX = org.sparkle-project
|
||||
INSTALLER_CONNECTION_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.InstallerConnection
|
||||
INSTALLER_STATUS_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.InstallerStatus
|
||||
INSTALLER_LAUNCHER_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.InstallerLauncher
|
||||
DOWNLOADER_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.Downloader
|
||||
DOWNLOADER_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.DownloaderService
|
||||
|
||||
// Initialize sandboxed entitlements variables to use no entitlements
|
||||
// Don't modify these. See commented out section below instead.
|
||||
DOWNLOADER_SANDBOXED_ENTITLEMENTS =
|
||||
INSTALLER_CONNECTION_ENTITLEMENTS =
|
||||
INSTALLER_STATUS_ENTITLEMENTS =
|
||||
|
||||
// The Downloader XPC Service is not sandboxed by default.
|
||||
// Uncomment this line to enable Sandboxing for this service.
|
||||
// If this is done, you *must* set a custom XPC_SERVICE_BUNDLE_ID_PREFIX for your app above.
|
||||
// Otherwise sandboxed apps that use the same sandboxed Downloader Service may conflict with each other.
|
||||
|
||||
//DOWNLOADER_SANDBOXED_ENTITLEMENTS = Downloader/Downloader.entitlements
|
||||
|
||||
// Similar to the Downloader XPC Service, uncomment these lines if you want to sandbox the Connection/Status services
|
||||
// If this is done, you *must* set a custom XPC_SERVICE_BUNDLE_ID_PREFIX for your app above.
|
||||
|
||||
//INSTALLER_CONNECTION_ENTITLEMENTS = InstallerConnection/InstallerConnection.entitlements
|
||||
//INSTALLER_STATUS_ENTITLEMENTS = InstallerStatus/InstallerStatus.entitlements
|
||||
|
||||
|
||||
// If your app file on disk is named "MyApp 1.1b4", Sparkle usually updates it
|
||||
// in place, giving you an app named 1.1b4 that is actually 1.2. Turn the
|
||||
@@ -91,13 +111,13 @@ SPARKLE_ICON_NAME = AppIcon
|
||||
// If you change any of these version details, you must increase CURRENT_PROJECT_VERSION
|
||||
// These variables must have a space after the '=' too
|
||||
SPARKLE_VERSION_MAJOR = 2
|
||||
SPARKLE_VERSION_MINOR = 5
|
||||
SPARKLE_VERSION_PATCH = 2
|
||||
SPARKLE_VERSION_MINOR = 6
|
||||
SPARKLE_VERSION_PATCH = 0
|
||||
|
||||
// This should be in SemVer format or empty, ie. "-beta.1"
|
||||
// These variables must have a space after the '=' too
|
||||
SPARKLE_VERSION_SUFFIX =
|
||||
CURRENT_PROJECT_VERSION = 2033
|
||||
SPARKLE_VERSION_SUFFIX = -beta.1
|
||||
CURRENT_PROJECT_VERSION = 2034
|
||||
|
||||
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
|
||||
@@ -4,6 +4,6 @@ INFOPLIST_FILE = Downloader/Info.plist
|
||||
WRAPPER_EXTENSION = xpc
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ${DOWNLOADER_BUNDLE_ID}
|
||||
PRODUCT_NAME = ${DOWNLOADER_NAME}
|
||||
CODE_SIGN_ENTITLEMENTS = Downloader/org.sparkle-project.Downloader.entitlements
|
||||
CODE_SIGN_ENTITLEMENTS = $(DOWNLOADER_SANDBOXED_ENTITLEMENTS)
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE_SOURCES_EXTERNALLY=1
|
||||
CLANG_MODULES_AUTOLINK = NO
|
||||
@@ -4,5 +4,6 @@ INFOPLIST_FILE = InstallerConnection/Info.plist
|
||||
WRAPPER_EXTENSION = xpc
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ${INSTALLER_CONNECTION_BUNDLE_ID}
|
||||
PRODUCT_NAME = ${INSTALLER_CONNECTION_NAME}
|
||||
CODE_SIGN_ENTITLEMENTS = $(INSTALLER_CONNECTION_ENTITLEMENTS)
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE_SOURCES_EXTERNALLY=1
|
||||
CLANG_MODULES_AUTOLINK = NO
|
||||
@@ -4,5 +4,6 @@ INFOPLIST_FILE = InstallerStatus/Info.plist
|
||||
WRAPPER_EXTENSION = xpc
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ${INSTALLER_STATUS_BUNDLE_ID}
|
||||
PRODUCT_NAME = ${INSTALLER_STATUS_NAME}
|
||||
CODE_SIGN_ENTITLEMENTS = $(INSTALLER_STATUS_ENTITLEMENTS)
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE=0 BUILDING_SPARKLE_SOURCES_EXTERNALLY=1
|
||||
CLANG_MODULES_AUTOLINK = NO
|
||||
@@ -34,9 +34,9 @@ if [ "$ACTION" = "" ] ; then
|
||||
|
||||
mkdir -p "$CONFIGURATION_BUILD_DIR/staging"
|
||||
mkdir -p "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/INSTALL" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/INSTALL" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
cp -R "$SRCROOT/bin" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp "$PROJECT_DIR/CHANGELOG" "$PROJECT_DIR/LICENSE" "$PROJECT_DIR/INSTALL" "$PROJECT_DIR/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp "$PROJECT_DIR/CHANGELOG" "$PROJECT_DIR/LICENSE" "$PROJECT_DIR/INSTALL" "$PROJECT_DIR/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
cp -R "$PROJECT_DIR/bin" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp "$CONFIGURATION_BUILD_DIR/generate_appcast" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp "$CONFIGURATION_BUILD_DIR/generate_keys" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
@@ -45,14 +45,6 @@ if [ "$ACTION" = "" ] ; then
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/sparkle.app" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.xcframework" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
|
||||
if [[ "$SPARKLE_EMBED_DOWNLOADER_XPC_SERVICE" -eq 1 ]]; then
|
||||
mkdir -p "$CONFIGURATION_BUILD_DIR/staging/Entitlements"
|
||||
mkdir -p "$CONFIGURATION_BUILD_DIR/staging-spm/Entitlements"
|
||||
|
||||
cp -R "$SRCROOT/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging/Entitlements/$DOWNLOADER_NAME.entitlements"
|
||||
cp -R "$SRCROOT/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging-spm/Entitlements/$DOWNLOADER_NAME.entitlements"
|
||||
fi
|
||||
|
||||
mkdir -p "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||
|
||||
@@ -119,7 +111,7 @@ if [ "$ACTION" = "" ] ; then
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
|
||||
|
||||
# Get latest git tag
|
||||
cd "$SRCROOT"
|
||||
cd "$PROJECT_DIR"
|
||||
latest_git_tag=$( git describe --tags --abbrev=0 || true )
|
||||
|
||||
if [ -n "$latest_git_tag" ] ; then
|
||||
@@ -138,7 +130,7 @@ if [ "$ACTION" = "" ] ; then
|
||||
rm -rf "/tmp/sparkle-spm-extract"
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
|
||||
cd "$SRCROOT"
|
||||
cd "$PROJECT_DIR"
|
||||
|
||||
# Check semantic versioning
|
||||
if [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then
|
||||
@@ -150,9 +142,9 @@ if [ "$ACTION" = "" ] ; then
|
||||
|
||||
# Generate new Package manifest, podspec, and carthage files
|
||||
cd "$CONFIGURATION_BUILD_DIR"
|
||||
cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"
|
||||
cp "$SRCROOT/Sparkle.podspec" "$CONFIGURATION_BUILD_DIR"
|
||||
cp "$SRCROOT/Carthage-dev.json" "$CONFIGURATION_BUILD_DIR"
|
||||
cp "$PROJECT_DIR/Package.swift" "$CONFIGURATION_BUILD_DIR"
|
||||
cp "$PROJECT_DIR/Sparkle.podspec" "$CONFIGURATION_BUILD_DIR"
|
||||
cp "$PROJECT_DIR/Carthage-dev.json" "$CONFIGURATION_BUILD_DIR"
|
||||
fi
|
||||
|
||||
if [ -z "$latest_git_tag" ] ; then
|
||||
@@ -162,7 +154,7 @@ if [ "$ACTION" = "" ] ; then
|
||||
spm_checksum=$(swift package compute-checksum "Sparkle-for-Swift-Package-Manager.zip")
|
||||
rm -rf ".build"
|
||||
sed -E -i '' -e "/let tag/ s/\".+\"/\"$latest_git_tag\"/" -e "/let version/ s/\".+\"/\"$MARKETING_VERSION\"/" -e "/let checksum/ s/[[:xdigit:]]{64}/$spm_checksum/" "Package.swift"
|
||||
cp "Package.swift" "$SRCROOT"
|
||||
cp "Package.swift" "$PROJECT_DIR"
|
||||
echo "Package.swift updated with the following values:"
|
||||
echo "Version: $MARKETING_VERSION"
|
||||
echo "Tag: $latest_git_tag"
|
||||
@@ -170,10 +162,10 @@ if [ "$ACTION" = "" ] ; then
|
||||
|
||||
sed -E -i '' -e "/s\.version.+=/ s/\".+\"/\"$MARKETING_VERSION\"/" "Sparkle.podspec"
|
||||
|
||||
"$SRCROOT/Configurations/update-carthage.py" "Carthage-dev.json" "$MARKETING_VERSION"
|
||||
cp "Sparkle.podspec" "$SRCROOT"
|
||||
"$PROJECT_DIR/Configurations/update-carthage.py" "Carthage-dev.json" "$MARKETING_VERSION"
|
||||
cp "Sparkle.podspec" "$PROJECT_DIR"
|
||||
# Note the Carthage-dev.json file will finally be copied to the website repo in Carthage/Sparkle.json in the end
|
||||
cp "Carthage-dev.json" "$SRCROOT"
|
||||
cp "Carthage-dev.json" "$PROJECT_DIR"
|
||||
echo "Sparkle.podspec and Carthage-dev.json updated with following values:"
|
||||
echo "Version: $MARKETING_VERSION"
|
||||
else
|
||||
|
||||
@@ -5,7 +5,7 @@ if ! which -s git ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "$SRCROOT" ] || \
|
||||
if [ -z "$PROJECT_DIR" ] || \
|
||||
[ -z "$BUILT_PRODUCTS_DIR" ] || \
|
||||
[ -z "$INFOPLIST_PATH" ] || \
|
||||
[ -z "$MARKETING_VERSION" ]; then
|
||||
@@ -16,7 +16,7 @@ fi
|
||||
version="$MARKETING_VERSION"
|
||||
|
||||
# Get version in format 1.x.x-commits-hash
|
||||
gitversion=$( cd "$SRCROOT"; git describe --tags --match '[12].*' || true )
|
||||
gitversion=$( cd "$PROJECT_DIR"; git describe --tags --match '[12].*' || true )
|
||||
if [ -z "$gitversion" ] ; then
|
||||
echo "$0: Can't find a Git hash!" 1>&2
|
||||
exit 0
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+4
-4
@@ -2,15 +2,15 @@
|
||||
import PackageDescription
|
||||
|
||||
// Version is technically not required here, SPM doesn't check
|
||||
let version = "2.5.2"
|
||||
let version = "2.6.0-beta.1"
|
||||
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
|
||||
let tag = "2.5.2"
|
||||
let checksum = "48ffac5d4477bf8be814c369b5c1b5a6b35e05f5e4fa473bd5b5c41d90846a99"
|
||||
let tag = "2.6.0-beta.1"
|
||||
let checksum = "450c7ac8c23a343423967d6b83a80525f3ac6830b1179971e1d229bd96a9ae25"
|
||||
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
|
||||
|
||||
let package = Package(
|
||||
name: "Sparkle",
|
||||
platforms: [.macOS(.v10_11)],
|
||||
platforms: [.macOS(.v10_13)], // leaving "10.13" as a breadcrumb for searching
|
||||
products: [
|
||||
.library(
|
||||
name: "Sparkle",
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ Please visit [Sparkle's website](http://sparkle-project.org) for up to date docu
|
||||
|
||||
## Requirements
|
||||
|
||||
* Runtime: macOS 10.13 or greater for 2.3, macOS 10.11 or greater for 2.2.x
|
||||
* Runtime: macOS 10.13 or later.
|
||||
* Build: Latest major Xcode (stable or beta, whichever is latest) and one major version less.
|
||||
* HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/))
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Sparkle"
|
||||
s.version = "2.5.2"
|
||||
s.version = "2.6.0-beta.1"
|
||||
s.summary = "A software update framework for macOS"
|
||||
s.description = "Sparkle is an easy-to-use software update framework for macOS."
|
||||
s.homepage = "https://sparkle-project.org"
|
||||
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
|
||||
s.source = { :http => "https://github.com/sparkle-project/Sparkle/releases/download/#{s.version}/Sparkle-#{s.version}.tar.xz" }
|
||||
s.source_files = 'Sparkle.framework/Versions/B/Headers/*.h'
|
||||
|
||||
s.preserve_paths = ['bin/*', 'Entitlements', 'Symbols']
|
||||
s.preserve_paths = ['bin/*', 'Symbols']
|
||||
s.public_header_files = 'Sparkle.framework/Versions/B/Headers/*.h'
|
||||
s.vendored_frameworks = 'Sparkle.framework'
|
||||
s.xcconfig = {
|
||||
|
||||
@@ -247,6 +247,9 @@
|
||||
725F97841C8AA90000265BE4 /* SUPopUpTitlebarUserDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 725F97831C8AA90000265BE4 /* SUPopUpTitlebarUserDriver.m */; };
|
||||
725F97A51C8B304D00265BE4 /* SUInstallUpdateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 725F97A31C8B304D00265BE4 /* SUInstallUpdateViewController.m */; };
|
||||
725F97A61C8B304D00265BE4 /* SUInstallUpdateViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 725F97A41C8B304D00265BE4 /* SUInstallUpdateViewController.xib */; };
|
||||
72666DC62B0B28F4001511B0 /* secret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72666DC52B0B28F4001511B0 /* secret.swift */; };
|
||||
72666DC72B0B28F4001511B0 /* secret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72666DC52B0B28F4001511B0 /* secret.swift */; };
|
||||
72666DC82B0B28F4001511B0 /* secret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72666DC52B0B28F4001511B0 /* secret.swift */; };
|
||||
7267E5751D3D895B00D1BF90 /* SUBinaryDeltaApply.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E56F1D3D895B00D1BF90 /* SUBinaryDeltaApply.m */; };
|
||||
7267E5761D3D895B00D1BF90 /* SUBinaryDeltaApply.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E56F1D3D895B00D1BF90 /* SUBinaryDeltaApply.m */; };
|
||||
7267E5771D3D895B00D1BF90 /* SUBinaryDeltaCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5711D3D895B00D1BF90 /* SUBinaryDeltaCommon.m */; };
|
||||
@@ -392,6 +395,8 @@
|
||||
72BC6C3D275027BF0083F14B /* SparkleTestCodeSign_apfs.dmg in Resources */ = {isa = PBXBuildFile; fileRef = 72BC6C3C275027BF0083F14B /* SparkleTestCodeSign_apfs.dmg */; };
|
||||
72BEBFEF1D7287570019146B /* SUSpotlightImporterTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72BEBFEE1D7287560019146B /* SUSpotlightImporterTest.swift */; };
|
||||
72CCDEBE27421FD500B53718 /* SparkleTestCodeSignApp_bad_header.zip in Resources */ = {isa = PBXBuildFile; fileRef = 72CCDEBD27421FD500B53718 /* SparkleTestCodeSignApp_bad_header.zip */; };
|
||||
72D04F3D2B094C8400A6DEAA /* SPUVerifierInformation.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D04F3C2B094C8400A6DEAA /* SPUVerifierInformation.m */; };
|
||||
72D04F3E2B097D4300A6DEAA /* SPUVerifierInformation.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D04F3C2B094C8400A6DEAA /* SPUVerifierInformation.m */; };
|
||||
72D60CD928C2BAE900189AB8 /* SPUStandardUserDriver+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 72D60CD828C2BA2100189AB8 /* SPUStandardUserDriver+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
72D954811CBACC35006F28BD /* InstallerProgressAppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D954801CBACC35006F28BD /* InstallerProgressAppController.m */; };
|
||||
72D954831CBAD34F006F28BD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D954821CBAD34F006F28BD /* main.m */; };
|
||||
@@ -1050,8 +1055,8 @@
|
||||
7214B8851D45AD9A00CB5CED /* SPUInstallationType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPUInstallationType.h; sourceTree = "<group>"; };
|
||||
72162B071C82C9600013C1C5 /* SULocalizations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SULocalizations.h; sourceTree = "<group>"; };
|
||||
721652671D3C8FED00FD13D8 /* SUInstallerLauncherStatus.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SUInstallerLauncherStatus.h; path = InstallerLauncher/SUInstallerLauncherStatus.h; sourceTree = SOURCE_ROOT; };
|
||||
7218EC362623F31C008FECF3 /* org.sparkle-project.InstallerConnection.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "org.sparkle-project.InstallerConnection.entitlements"; sourceTree = "<group>"; };
|
||||
7218EC372623F32E008FECF3 /* org.sparkle-project.InstallerStatus.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "org.sparkle-project.InstallerStatus.entitlements"; sourceTree = "<group>"; };
|
||||
7218EC362623F31C008FECF3 /* InstallerConnection.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = InstallerConnection.entitlements; sourceTree = "<group>"; };
|
||||
7218EC372623F32E008FECF3 /* InstallerStatus.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = InstallerStatus.entitlements; sourceTree = "<group>"; };
|
||||
721AB11626C777D900D34A86 /* SPUDownloadDataPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPUDownloadDataPrivate.h; sourceTree = "<group>"; };
|
||||
721BC2061D17A532002BC71E /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
|
||||
721BC2081D17A553002BC71E /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
|
||||
@@ -1197,6 +1202,7 @@
|
||||
723B5DA51CF7AB0100365F95 /* SPUDownloaderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SPUDownloaderProtocol.h; path = Downloader/SPUDownloaderProtocol.h; sourceTree = SOURCE_ROOT; };
|
||||
723C8A521E2D60DB00C14942 /* SUTouchBarButtonGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUTouchBarButtonGroup.h; sourceTree = "<group>"; };
|
||||
723C8A531E2D60DB00C14942 /* SUTouchBarButtonGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUTouchBarButtonGroup.m; sourceTree = "<group>"; };
|
||||
723DFF962B3DFF6E00628E6C /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
|
||||
723EDC3E26885A8E000BCBA4 /* testappcast_channels.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = testappcast_channels.xml; sourceTree = "<group>"; };
|
||||
7246E0A11C83B685003B4E75 /* SPUStandardUpdaterController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUStandardUpdaterController.h; sourceTree = "<group>"; };
|
||||
7246E0A21C83B685003B4E75 /* SPUStandardUpdaterController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUStandardUpdaterController.m; sourceTree = "<group>"; };
|
||||
@@ -1246,6 +1252,7 @@
|
||||
725F97A21C8B304D00265BE4 /* SUInstallUpdateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUInstallUpdateViewController.h; sourceTree = "<group>"; };
|
||||
725F97A31C8B304D00265BE4 /* SUInstallUpdateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstallUpdateViewController.m; sourceTree = "<group>"; };
|
||||
725F97A41C8B304D00265BE4 /* SUInstallUpdateViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SUInstallUpdateViewController.xib; sourceTree = "<group>"; };
|
||||
72666DC52B0B28F4001511B0 /* secret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = secret.swift; sourceTree = "<group>"; };
|
||||
7267E56E1D3D895B00D1BF90 /* SUBinaryDeltaApply.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUBinaryDeltaApply.h; path = Autoupdate/SUBinaryDeltaApply.h; sourceTree = SOURCE_ROOT; };
|
||||
7267E56F1D3D895B00D1BF90 /* SUBinaryDeltaApply.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUBinaryDeltaApply.m; path = Autoupdate/SUBinaryDeltaApply.m; sourceTree = SOURCE_ROOT; };
|
||||
7267E5701D3D895B00D1BF90 /* SUBinaryDeltaCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUBinaryDeltaCommon.h; path = Autoupdate/SUBinaryDeltaCommon.h; sourceTree = SOURCE_ROOT; };
|
||||
@@ -1336,7 +1343,7 @@
|
||||
728ED349277DA23400D9238F /* SPUSparkleDeltaArchive.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SPUSparkleDeltaArchive.m; path = Autoupdate/SPUSparkleDeltaArchive.m; sourceTree = SOURCE_ROOT; };
|
||||
729924921DF4A45000DBCDF5 /* SUUpdateValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUUpdateValidator.h; path = Sparkle/SUUpdateValidator.h; sourceTree = SOURCE_ROOT; };
|
||||
729924931DF4A45000DBCDF5 /* SUUpdateValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUUpdateValidator.m; path = Sparkle/SUUpdateValidator.m; sourceTree = SOURCE_ROOT; };
|
||||
729BB3D11D503826007C4276 /* org.sparkle-project.Downloader.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = "org.sparkle-project.Downloader.entitlements"; path = "Downloader/org.sparkle-project.Downloader.entitlements"; sourceTree = SOURCE_ROOT; };
|
||||
729BB3D11D503826007C4276 /* Downloader.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = Downloader.entitlements; path = Downloader/Downloader.entitlements; sourceTree = SOURCE_ROOT; };
|
||||
729F10FD1C65A9B500DFCCC5 /* ConfigUITest.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITest.xcconfig; sourceTree = "<group>"; };
|
||||
729F10FE1C65A9B500DFCCC5 /* ConfigUITestCoverage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITestCoverage.xcconfig; sourceTree = "<group>"; };
|
||||
729F7EAB27366353004592DC /* test-links.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "test-links.xml"; sourceTree = "<group>"; };
|
||||
@@ -1384,6 +1391,8 @@
|
||||
72BC6C3C275027BF0083F14B /* SparkleTestCodeSign_apfs.dmg */ = {isa = PBXFileReference; lastKnownFileType = file; path = SparkleTestCodeSign_apfs.dmg; sourceTree = "<group>"; };
|
||||
72BEBFEE1D7287560019146B /* SUSpotlightImporterTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUSpotlightImporterTest.swift; sourceTree = "<group>"; };
|
||||
72CCDEBD27421FD500B53718 /* SparkleTestCodeSignApp_bad_header.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = SparkleTestCodeSignApp_bad_header.zip; sourceTree = "<group>"; };
|
||||
72D04F3B2B094C8400A6DEAA /* SPUVerifierInformation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPUVerifierInformation.h; sourceTree = "<group>"; };
|
||||
72D04F3C2B094C8400A6DEAA /* SPUVerifierInformation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SPUVerifierInformation.m; sourceTree = "<group>"; };
|
||||
72D60CD828C2BA2100189AB8 /* SPUStandardUserDriver+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SPUStandardUserDriver+Private.h"; sourceTree = "<group>"; };
|
||||
72D9547F1CBACC35006F28BD /* InstallerProgressAppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstallerProgressAppController.h; path = Sparkle/InstallerProgress/InstallerProgressAppController.h; sourceTree = SOURCE_ROOT; };
|
||||
72D954801CBACC35006F28BD /* InstallerProgressAppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = InstallerProgressAppController.m; path = Sparkle/InstallerProgress/InstallerProgressAppController.m; sourceTree = SOURCE_ROOT; };
|
||||
@@ -1700,6 +1709,7 @@
|
||||
0867D691FE84028FC02AAC07 /* Sparkle */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
723DFF962B3DFF6E00628E6C /* Package.swift */,
|
||||
1495006D195FBBBD00BC5B5B /* Sparkle */,
|
||||
EA1E288122B6688A004AA304 /* Command Line Tools */,
|
||||
14732BB81960EEB600593899 /* Resources */,
|
||||
@@ -2096,6 +2106,8 @@
|
||||
7267E5991D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m */,
|
||||
7267E59A1D3D8A5A00D1BF90 /* SUSignatureVerifier.h */,
|
||||
7267E59B1D3D8A5A00D1BF90 /* SUSignatureVerifier.m */,
|
||||
72D04F3B2B094C8400A6DEAA /* SPUVerifierInformation.h */,
|
||||
72D04F3C2B094C8400A6DEAA /* SPUVerifierInformation.m */,
|
||||
);
|
||||
name = Verifiers;
|
||||
path = ..;
|
||||
@@ -2221,7 +2233,7 @@
|
||||
724BB36E1D31D0B7005D534A /* SUInstallerConnectionProtocol.h */,
|
||||
724BB3851D32A167005D534A /* SUXPCInstallerConnection.h */,
|
||||
724BB3861D32A167005D534A /* SUXPCInstallerConnection.m */,
|
||||
7218EC362623F31C008FECF3 /* org.sparkle-project.InstallerConnection.entitlements */,
|
||||
7218EC362623F31C008FECF3 /* InstallerConnection.entitlements */,
|
||||
);
|
||||
name = InstallerConnection;
|
||||
path = ../InstallerConnection;
|
||||
@@ -2238,7 +2250,7 @@
|
||||
7267E5DD1D3D8F5A00D1BF90 /* SUStatusInfoProtocol.h */,
|
||||
724BB3A61D33461B005D534A /* SUXPCInstallerStatus.h */,
|
||||
724BB3A71D33461B005D534A /* SUXPCInstallerStatus.m */,
|
||||
7218EC372623F32E008FECF3 /* org.sparkle-project.InstallerStatus.entitlements */,
|
||||
7218EC372623F32E008FECF3 /* InstallerStatus.entitlements */,
|
||||
);
|
||||
name = InstallerStatus;
|
||||
path = ../InstallerStatus;
|
||||
@@ -2262,6 +2274,14 @@
|
||||
name = "User Driver";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
72666DC42B0B28D4001511B0 /* common_cli */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
72666DC52B0B28F4001511B0 /* secret.swift */,
|
||||
);
|
||||
path = common_cli;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
726B2B5E1C645FC900388755 /* UI Tests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -2292,7 +2312,7 @@
|
||||
children = (
|
||||
723B5D9F1CF7AB0100365F95 /* Info.plist */,
|
||||
723B5DA01CF7AB0100365F95 /* main.m */,
|
||||
729BB3D11D503826007C4276 /* org.sparkle-project.Downloader.entitlements */,
|
||||
729BB3D11D503826007C4276 /* Downloader.entitlements */,
|
||||
723B5DA21CF7AB0100365F95 /* SPUDownloader.h */,
|
||||
723B5DA31CF7AB0100365F95 /* SPUDownloader.m */,
|
||||
723B5DA41CF7AB0100365F95 /* SPUDownloaderDelegate.h */,
|
||||
@@ -2436,6 +2456,7 @@
|
||||
EA1E288122B6688A004AA304 /* Command Line Tools */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
72666DC42B0B28D4001511B0 /* common_cli */,
|
||||
7205C43F1E13049400E370AE /* generate_appcast */,
|
||||
EA1E285F22B66487004AA304 /* generate_keys */,
|
||||
EA1E287722B666EB004AA304 /* sign_update */,
|
||||
@@ -2593,7 +2614,7 @@
|
||||
/* Begin PBXLegacyTarget section */
|
||||
14732BC51960F69300593899 /* Distribution */ = {
|
||||
isa = PBXLegacyTarget;
|
||||
buildArgumentsString = "$(SRCROOT)/Configurations/make-release-package.sh $(ACTION)";
|
||||
buildArgumentsString = "$(PROJECT_DIR)/Configurations/make-release-package.sh $(ACTION)";
|
||||
buildConfigurationList = 14732BC61960F69300593899 /* Build configuration list for PBXLegacyTarget "Distribution" */;
|
||||
buildPhases = (
|
||||
);
|
||||
@@ -3262,7 +3283,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"$SRCROOT/Configurations/set-git-version-info.sh\"\n";
|
||||
shellScript = "\"$PROJECT_DIR/Configurations/set-git-version-info.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
72045CE626FEE8CC004F96E5 /* Strip Framework */ = {
|
||||
@@ -3282,7 +3303,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"$SRCROOT/Configurations/strip-framework.sh\"\n";
|
||||
shellScript = "\"$PROJECT_DIR/Configurations/strip-framework.sh\"\n";
|
||||
};
|
||||
720B4C2125EBFAA5005A0592 /* Run Script: Link Tools */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
@@ -3301,7 +3322,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"$SRCROOT/Configurations/link-tools.sh\"\n";
|
||||
shellScript = "\"$PROJECT_DIR/Configurations/link-tools.sh\"\n";
|
||||
};
|
||||
895C5DC524D78E460058A82D /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
@@ -3318,7 +3339,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"$SRCROOT/Configurations/make-xcframework.sh\"\n";
|
||||
shellScript = "\"$PROJECT_DIR/Configurations/make-xcframework.sh\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -3344,6 +3365,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
72D04F3E2B097D4300A6DEAA /* SPUVerifierInformation.m in Sources */,
|
||||
72266A8C29464D0200645376 /* SUSignatures.m in Sources */,
|
||||
72266A8B29464CEA00645376 /* SUHost.m in Sources */,
|
||||
72266A8A2946493C00645376 /* SUCodeSigningVerifier.m in Sources */,
|
||||
@@ -3434,6 +3456,7 @@
|
||||
7205C4571E13061F00E370AE /* SUUnarchiver.m in Sources */,
|
||||
7205C4581E13061F00E370AE /* SUUnarchiverNotifier.m in Sources */,
|
||||
7205C4501E1304CE00E370AE /* Unarchive.swift in Sources */,
|
||||
72666DC62B0B28F4001511B0 /* secret.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -3557,6 +3580,7 @@
|
||||
7267E57F1D3D896700D1BF90 /* SUBinaryDeltaUnarchiver.m in Sources */,
|
||||
7267E59C1D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m in Sources */,
|
||||
7267E5CC1D3D8C6B00D1BF90 /* SUConstants.m in Sources */,
|
||||
72D04F3D2B094C8400A6DEAA /* SPUVerifierInformation.m in Sources */,
|
||||
7267E5861D3D89B300D1BF90 /* SUDiskImageUnarchiver.m in Sources */,
|
||||
7267E59D1D3D8A5A00D1BF90 /* SUSignatureVerifier.m in Sources */,
|
||||
7267E5E71D3D90AA00D1BF90 /* SUFileManager.m in Sources */,
|
||||
@@ -3693,6 +3717,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
EA1E286122B66487004AA304 /* main.swift in Sources */,
|
||||
72666DC72B0B28F4001511B0 /* secret.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -3701,6 +3726,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
EA1E287922B666EB004AA304 /* main.swift in Sources */,
|
||||
72666DC82B0B28F4001511B0 /* secret.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
Vendored
+3
-2
@@ -190,8 +190,9 @@
|
||||
|
||||
- (void)extractDownloadedUpdate
|
||||
{
|
||||
assert(_resumableUpdate != nil);
|
||||
[self extractUpdate:_resumableUpdate];
|
||||
id<SPUResumableUpdate> resumableUpdate = _resumableUpdate;
|
||||
assert(resumableUpdate != nil && [resumableUpdate isKindOfClass:[SPUDownloadedUpdate class]]);
|
||||
[self extractUpdate:(SPUDownloadedUpdate *)resumableUpdate];
|
||||
}
|
||||
|
||||
- (void)clearDownloadedUpdate
|
||||
|
||||
Vendored
+1
-1
@@ -249,7 +249,7 @@
|
||||
|
||||
id<SPUInstallerDriverDelegate> delegate = _delegate;
|
||||
|
||||
SPUInstallationInputData *installationData = [[SPUInstallationInputData alloc] initWithRelaunchPath:pathToRelaunch hostBundlePath:_host.bundlePath updateURLBookmarkData:_updateURLBookmarkData installationType:_updateItem.installationType signatures:_updateItem.signatures decryptionPassword:decryptionPassword];
|
||||
SPUInstallationInputData *installationData = [[SPUInstallationInputData alloc] initWithRelaunchPath:pathToRelaunch hostBundlePath:_host.bundlePath updateURLBookmarkData:_updateURLBookmarkData installationType:_updateItem.installationType signatures:_updateItem.signatures decryptionPassword:decryptionPassword expectedVersion:_updateItem.versionString expectedContentLength:_updateItem.contentLength];
|
||||
|
||||
NSData *archivedData = SPUArchiveRootObjectSecurely(installationData);
|
||||
if (archivedData == nil) {
|
||||
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// SPUVerifierInformation.h
|
||||
// Autoupdate
|
||||
//
|
||||
// Copyright © 2023 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
SPU_OBJC_DIRECT_MEMBERS @interface SPUVerifierInformation : NSObject
|
||||
|
||||
- (instancetype)initWithExpectedVersion:(NSString * _Nullable)expectedVersion expectedContentLength:(uint64_t)expectedContentLength;
|
||||
|
||||
@property (nonatomic, readonly, copy, nullable) NSString *expectedVersion;
|
||||
@property (nonatomic, readonly) uint64_t expectedContentLength;
|
||||
|
||||
@property (nonatomic, copy, nullable) NSString *actualVersion;
|
||||
@property (nonatomic) uint64_t actualContentLength;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// SPUVerifierInformation.m
|
||||
// Autoupdate
|
||||
//
|
||||
// Copyright © 2023 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SPUVerifierInformation.h"
|
||||
|
||||
@implementation SPUVerifierInformation
|
||||
|
||||
@synthesize expectedVersion = _expectedVersion;
|
||||
@synthesize expectedContentLength = _expectedContentLength;
|
||||
@synthesize actualVersion = _actualVersion;
|
||||
@synthesize actualContentLength = _actualContentLength;
|
||||
|
||||
- (instancetype)initWithExpectedVersion:(NSString *)expectedVersion expectedContentLength:(uint64_t)expectedContentLength
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_expectedVersion = [expectedVersion copy];
|
||||
_expectedContentLength = expectedContentLength;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+1
@@ -10,6 +10,7 @@
|
||||
#define SUAppcastItem_Private_h
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Sparkle/SUAppcastItem.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
Vendored
-2
@@ -62,7 +62,6 @@ static SUSigningInputStatus decode(NSString *str, NSData * __strong *outData) {
|
||||
NSData *data = nil;
|
||||
_ed25519SignatureStatus = decode(maybeEd25519, &data);
|
||||
if (data) {
|
||||
assert(64 == sizeof(_ed25519_signature));
|
||||
if ([data length] == sizeof(_ed25519_signature)) {
|
||||
[data getBytes:_ed25519_signature length:sizeof(_ed25519_signature)];
|
||||
} else {
|
||||
@@ -163,7 +162,6 @@ static BOOL decodeStatus(NSCoder *decoder, NSString *key, SUSigningInputStatus *
|
||||
NSData *ed = nil;
|
||||
_ed25519PubKeyStatus = decode(maybeEd25519, &ed);
|
||||
if (ed) {
|
||||
assert(32 == sizeof(_ed25519_public_key));
|
||||
if ([ed length] == sizeof(_ed25519_public_key)) {
|
||||
[ed getBytes:_ed25519_public_key length:sizeof(_ed25519_public_key)];
|
||||
} else {
|
||||
|
||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
||||
Vendored
+4
-1
@@ -10,6 +10,7 @@
|
||||
|
||||
@class SUHost;
|
||||
@class SUSignatures;
|
||||
@class SPUVerifierInformation;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -18,7 +19,9 @@ SPU_OBJC_DIRECT_MEMBERS
|
||||
#endif
|
||||
@interface SUUpdateValidator : NSObject
|
||||
|
||||
- (instancetype)initWithDownloadPath:(NSString *)downloadPath signatures:(SUSignatures *)signatures host:(SUHost *)host;
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
- (instancetype)initWithDownloadPath:(NSString *)downloadPath signatures:(SUSignatures *)signatures host:(SUHost *)host verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation;
|
||||
|
||||
// This is "pre" validation, before the archive has been extracted
|
||||
- (BOOL)validateDownloadPathWithError:(NSError **)error;
|
||||
|
||||
Vendored
+10
-5
@@ -14,6 +14,7 @@
|
||||
#import "SULog.h"
|
||||
#import "SUSignatures.h"
|
||||
#import "SUErrors.h"
|
||||
#import "SPUVerifierInformation.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
@@ -23,17 +24,19 @@
|
||||
SUHost *_host;
|
||||
SUSignatures *_signatures;
|
||||
NSString *_downloadPath;
|
||||
SPUVerifierInformation *_verifierInformation;
|
||||
|
||||
BOOL _prevalidatedSignature;
|
||||
}
|
||||
|
||||
- (instancetype)initWithDownloadPath:(NSString *)downloadPath signatures:(SUSignatures *)signatures host:(SUHost *)host
|
||||
- (instancetype)initWithDownloadPath:(NSString *)downloadPath signatures:(SUSignatures *)signatures host:(SUHost *)host verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_downloadPath = [downloadPath copy];
|
||||
_signatures = signatures;
|
||||
_host = host;
|
||||
_verifierInformation = verifierInformation;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -49,7 +52,7 @@
|
||||
}
|
||||
} else {
|
||||
NSError *innerError = nil;
|
||||
if ([SUSignatureVerifier validatePath:_downloadPath withSignatures:signatures withPublicKeys:publicKeys error:&innerError]) {
|
||||
if ([SUSignatureVerifier validatePath:_downloadPath withSignatures:signatures withPublicKeys:publicKeys verifierInformation:_verifierInformation error:&innerError]) {
|
||||
_prevalidatedSignature = YES;
|
||||
return YES;
|
||||
}
|
||||
@@ -94,7 +97,7 @@
|
||||
// For package type updates, all we do is check if the EdDSA signature is valid
|
||||
NSError *innerError = nil;
|
||||
SUPublicKeys *publicKeys = host.publicKeys;
|
||||
BOOL validationCheckSuccess = [SUSignatureVerifier validatePath:downloadPath withSignatures:signatures withPublicKeys:publicKeys error:&innerError];
|
||||
BOOL validationCheckSuccess = [SUSignatureVerifier validatePath:downloadPath withSignatures:signatures withPublicKeys:publicKeys verifierInformation:_verifierInformation error:&innerError];
|
||||
if (!validationCheckSuccess) {
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUValidationError userInfo:@{ NSLocalizedDescriptionKey: @"EdDSA signature validation of the package failed. The update contains an installer package, and valid EdDSA signatures are mandatory for all installer packages. The update will be rejected. Sign the installer with a valid EdDSA key or use an .app bundle update instead.", NSUnderlyingErrorKey: innerError }];
|
||||
@@ -156,6 +159,8 @@
|
||||
SUHost *newHost = [[SUHost alloc] initWithBundle:newBundle];
|
||||
SUPublicKeys *newPublicKeys = newHost.publicKeys;
|
||||
|
||||
_verifierInformation.actualVersion = newHost.version;
|
||||
|
||||
BOOL oldHasLegacyDSAKey = publicKeys.dsaPubKeyStatus != SUSigningInputStatusAbsent;
|
||||
BOOL oldHasEdDSAKey = publicKeys.ed25519PubKeyStatus != SUSigningInputStatusAbsent;
|
||||
BOOL oldHasAnyDSAKey = oldHasLegacyDSAKey || oldHasEdDSAKey;
|
||||
@@ -181,7 +186,7 @@
|
||||
NSError *dsaError = nil;
|
||||
if (oldHasAnyDSAKey) {
|
||||
// it's critical to check against the old public key, rather than the new key
|
||||
passedDSACheck = [SUSignatureVerifier validatePath:downloadedPath withSignatures:signatures withPublicKeys:publicKeys error:&dsaError];
|
||||
passedDSACheck = [SUSignatureVerifier validatePath:downloadedPath withSignatures:signatures withPublicKeys:publicKeys verifierInformation:_verifierInformation error:&dsaError];
|
||||
}
|
||||
|
||||
NSError *codeSignedError = nil;
|
||||
@@ -194,7 +199,7 @@
|
||||
// In that case, the check ensures that the app author has correctly used DSA keys, so that the app will be updateable in the next version.
|
||||
if (!passedDSACheck && newHasAnyDSAKey) {
|
||||
NSError *innerError = nil;
|
||||
if (![SUSignatureVerifier validatePath:downloadedPath withSignatures:signatures withPublicKeys:newPublicKeys error:&innerError]) {
|
||||
if (![SUSignatureVerifier validatePath:downloadedPath withSignatures:signatures withPublicKeys:newPublicKeys verifierInformation:_verifierInformation error:&innerError]) {
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUValidationError userInfo:@{ NSLocalizedDescriptionKey: @"The update has a public (Ed)DSA key, but the public key shipped with the update doesn't match the signature. To prevent future problems, the update will be rejected.", NSUnderlyingErrorKey: innerError }];
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
/* Class = "NSWindow"; title = "Software Update"; ObjectID = "5"; */
|
||||
"5.title" = "Software Update";
|
||||
"5.title" = "소프트웨어 업데이트";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Release Notes:"; ObjectID = "170"; */
|
||||
"170.title" = "배포 정보:";
|
||||
"170.title" = "릴리즈 노트:";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Remind Me Later"; ObjectID = "171"; */
|
||||
"171.title" = "나중에";
|
||||
@@ -14,4 +14,4 @@
|
||||
"173.title" = "업데이트 설치";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Automatically download and install updates in the future"; ObjectID = "175"; */
|
||||
"175.title" = "나중에 업데이트 자동으로 다운로드 및 설치";
|
||||
"175.title" = "향후 업데이트 자동 다운로드 및 설치";
|
||||
+11
-8
@@ -4,17 +4,20 @@
|
||||
/* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "45"; */
|
||||
"45.title" = "Text Cell";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Anonymous system profile information is used to help us plan future development work. Please contact us if you have any questions about this.\n\nThis is the information that would be sent:"; ObjectID = "183"; */
|
||||
"183.title" = "익명으로 보내지는 시스템 정보로 차후 프로그램 개발에 도움이 될 수 있습니다. 질문이 있으시면 연락 주십시오.\n\n아래 정보가 전송될 것입니다.";
|
||||
/* Class = "NSButtonCell"; title = "Check Automatically"; ObjectID = "176"; */
|
||||
"OhZ-1K-DmA.title" = "자동으로 확인";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Don’t Check"; ObjectID = "cCJ-V0-aTi"; */
|
||||
/* Class = "NSButtonCell"; title = "Don’t Check"; ObjectID = "177"; */
|
||||
"cCJ-V0-aTi.title" = "취소";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Check for updates automatically?"; ObjectID = "gmh-T4-BO0"; */
|
||||
"gmh-T4-BO0.title" = "자동으로 업데이트 확인할까요?";
|
||||
/* Class = "NSTextFieldCell"; title = "Check for updates automatically?"; ObjectID = "178"; */
|
||||
"gmh-T4-BO0.title" = "업데이트를 자동으로 확인할까요?";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Include anonymous system profile"; ObjectID = "gz7-LM-gNf"; */
|
||||
/* Class = "NSButtonCell"; title = "Include anonymous system profile"; ObjectID = "180"; */
|
||||
"gz7-LM-gNf.title" = "익명 시스템 정보 포함";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Check Automatically"; ObjectID = "OhZ-1K-DmA"; */
|
||||
"OhZ-1K-DmA.title" = "자동으로 확인";
|
||||
/* Class = "NSButtonCell"; title = "Automatically download and install updates"; ObjectID = "AUc-33-qGN"; */
|
||||
"AUc-33-qGN.title" = "업데이트 자동 다운로드 및 설치";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Anonymous system profile information is used to help us plan future development work. Please contact us if you have any questions about this.\n\nThis is the information that would be sent:"; ObjectID = "183"; */
|
||||
"183.title" = "익명으로 보내지는 시스템 정보로 차후 프로그램 개발에 도움이 될 수 있습니다. 질문이 있으시면 연락 주십시오.\n\n아래 정보가 전송될 것입니다.";
|
||||
Vendored
+89
-17
@@ -1,23 +1,47 @@
|
||||
/* No comment provided by engineer. */
|
||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@이(가) 현재 최신 버전입니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@이(가) 현재 최신 버전입니다.\n(You are currently running version %3$@.)";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update is downloadable. */
|
||||
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@이(가) 업데이트 되었습니다. (현재 버전 : %3$@) 다운로드 하시겠습니까?";
|
||||
|
||||
/* The download progress in a unit of bytes, e.g. 100 KB */
|
||||
"%@ downloaded" = "%@ 다운로드 완료";
|
||||
|
||||
/* The download progress in units of bytes, e.g. 100 KB of 1,0 MB */
|
||||
"%@ of %@" = "%1$@ / %2$@";
|
||||
/* Description text for SUUpdateAlert when the critical update has already been downloaded and ready to install. */
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ 이(가) 다운로드 되었습니다. 프로그램을 업데이트하고 재실행 하시겠습니까?\n이 업데이트는 중요한 업데이트입니다.";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update has already been downloaded and ready to install. */
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@이(가) 다운로드 되었습니다. 프로그램을 업데이트하고 재실행 하시겠습니까?";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@이(가) 디스크 이미지나 CD 드라이브 같은 읽기 전용 볼륨에서 실행되고 있으므로 업데이트 할 수 없습니다.";
|
||||
"%1$@ %2$@ is available but your macOS version is too new for this update. This update only supports up to macOS %3$@." = "%1$@ %2$@ 업데이트는 macOS %3$@ 버전까지만 지원합니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required." = "%1$@ %2$@ 업데이트는 최소 macOS %3$@ 버전을 요구합니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ 이(가) 다운로드된 위치에서 실행 중인 경우에는 업데이트할 수 없습니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ 이(가) 디스크 이미지나 CD 드라이브 같은 읽기 전용 볼륨에서 실행되고 있으므로 업데이트할 수 없습니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@ 이(가) 현재 최신 버전입니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ 이(가) 현재 최신 버전입니다.\n(현재 실행 중인 버전 : %3$@)";
|
||||
|
||||
/* Description text for SUUpdateAlert when the critical update is downloadable. */
|
||||
"%@ %@ is now available—you have %@. This is an important update; would you like to download it now?" = "%1$@ %2$@ 업데이트를 설치할 수 있습니다. 다운로드 하시겠습니까?\n이 업데이트는 중요한 업데이트입니다. (현재 버전 : %3$@)";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update is downloadable. */
|
||||
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ 이(가) 업데이트 되었습니다. 다운로드 하시겠습니까? (현재 버전 : %3$@)";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update informational with no download. */
|
||||
"%@ %@ is now available—you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ 이(가) 업데이트 되었습니다. 업데이트에 대한 더 많은 정보를 확인하시겠습니까? (현재 버전 : %3$@)";
|
||||
|
||||
/* The download progress in a unit of bytes, e.g. 100 KB */
|
||||
"%@ downloaded" = "%@ 다운로드 완료";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%@ is now updated to version %@!" = "%1$@ 이(가) %2$@ 버전으로 업데이트 되었습니다!";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%@ is now updated!" = "%@ 이(가) 업데이트 되었습니다!";
|
||||
|
||||
/* The download progress in units of bytes, e.g. 100 KB of 1,0 MB */
|
||||
"%@ of %@" = "%1$@ / %2$@";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"A new version of %@ is available!" = "%@ 새 버전이 있습니다.";
|
||||
@@ -28,15 +52,30 @@
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred in retrieving update information. Please try again later." = "업데이트 정보를 수집하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred while connecting to the installer. Please try again later." = "설치 프로그램에 연결하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred while downloading the update. Please try again later." = "업데이트를 다운로드 하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred while extracting the archive. Please try again later." = "압축 파일을 푸는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred while launching the installer. Please try again later." = "설치 프로그램을 실행하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred while parsing the update feed." = "업데이트 피드를 분석하는 중 오류가 발생하였습니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred while running the updater. Please try again later." = "업데이트를 진행하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred while starting the installer. Please try again later." = "설치 프로그램을 시작하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An important update to %@ is ready to install" = "(중요 업데이트) %@ 을(를) 설치할 준비가 완료되었습니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Cancel" = "취소";
|
||||
|
||||
@@ -52,29 +91,62 @@
|
||||
/* Take care not to overflow the status window. */
|
||||
"Extracting update…" = "압축 푸는 중…";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Failed to resume installing update." = "업데이트 설치를 재개하지 못했습니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Install and Relaunch" = "설치 & 재실행";
|
||||
|
||||
/* Alternate title for 'Remind Me Later' button when downloaded updates can be resumed */
|
||||
"Install on Quit" = "종료 시 설치";
|
||||
|
||||
/* Take care not to overflow the status window. */
|
||||
"Installing update…" = "설치 중…";
|
||||
|
||||
/* Alternate title for 'Install Update' button when there's no download in RSS feed. */
|
||||
"Learn More…" = "더 알아보기…";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"OK" = "확인";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again." = "%1$@ 을(를) 종료하고, 응용 프로그램 폴더로 옮긴 다음 다시 실행해 주십시오.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Ready to Install" = "설치 준비 완료";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "%1$@ 업데이트 확인을 자동으로 할까요? %1$@ 메뉴에서 수동 설정을 할 수 있습니다.";
|
||||
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "%1$@ 업데이트 확인을 자동으로 할까요? %1$@ 메뉴에서 수동으로 변경 할 수 있습니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"The update checker failed to start correctly. You should contact the app developer to report this issue and verify that you have the latest version." = "업데이트 확인 도구가 올바르게 시작되지 않았습니다. 이 문제를 앱 개발자에게 알려주고 사용 중인 버전이 최신 버전인지 확인해주세요.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"The update is improperly signed and could not be validated. Please try again later or contact the app developer." = "업데이트가 잘못 서명되어 유효성 검사를 할 수 없습니다. 나중에 다시 시도하거나 앱 개발자에게 문의해주세요.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Unable to Check For Updates" = "업데이트를 확인할 수 없습니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Update Error!" = "업데이트 오류!";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Update Installed" = "업데이트가 설치되었습니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Updating %@" = "%@ 업데이트 중";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@을(를) 응용프로그램 폴더로 이동하여 다시 실행해 주십시오.";
|
||||
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ 을(를) 응용 프로그램 폴더로 옮긴 다음 다시 실행해 주십시오.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Version History" = "버전 기록";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Your macOS version is too new" = "사용 중인 macOS 버전이 너무 높습니다.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Your macOS version is too old" = "사용 중인 macOS 버전이 너무 낮습니다.";
|
||||
|
||||
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
|
||||
"You’re up to date!" = "최신 버전입니다.";
|
||||
@@ -140,7 +140,7 @@
|
||||
#endif
|
||||
];
|
||||
|
||||
return [v verifyFileAtPath:aFile signatures:sig error:error];
|
||||
return [v verifyFileAtPath:aFile signatures:sig verifierInformation:nil error:error];
|
||||
}
|
||||
|
||||
static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
@@ -167,7 +167,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
|
||||
SUSignatures *sig = _createSignatures(sigString, nil);
|
||||
|
||||
return [v verifyFileAtPath:aFile signatures:sig error:error];
|
||||
return [v verifyFileAtPath:aFile signatures:sig verifierInformation:nil error:error];
|
||||
}
|
||||
|
||||
- (void)testVerifyFileWithBothKeys
|
||||
@@ -180,10 +180,10 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
NSError *error = nil;
|
||||
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(nil, nil) error:&error],
|
||||
signatures:_createSignatures(nil, nil) verifierInformation:nil error:&error],
|
||||
@"Fail if no signatures are provided: %@", error);
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(@"lol", @"lol") error:&error],
|
||||
signatures:_createSignatures(@"lol", @"lol") verifierInformation:nil error:&error],
|
||||
@"Fail if both signatures are invalid: %@", error);
|
||||
|
||||
NSString *dsaSig = @"MCwCFCIHCIYYkfZavNzTitTW5tlRp/k5AhQ40poFytqcVhIYdCxQznaXeJPJDQ==";
|
||||
@@ -192,27 +192,27 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
NSString *wrongEdSig = @"wTcpXCgWoa4NrJpsfzS61FXJIbv963//12U2ef9xstzVOLPHYK2N4/ojgpDV5N1/NGG1uWMBgK+kEWp0Z5zMDQ==";
|
||||
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(nil, dsaSig) error:&error],
|
||||
signatures:_createSignatures(nil, dsaSig) verifierInformation:nil error:&error],
|
||||
@"EdDSA signature must be present if app has EdDSA key: %@", error);
|
||||
|
||||
XCTAssertTrue([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(edSig, nil) error:&error],
|
||||
signatures:_createSignatures(edSig, nil) verifierInformation:nil error:&error],
|
||||
@"Allow just an EdDSA signature if that's all that's available: %@", error);
|
||||
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(wrongEdSig, dsaSig) error:&error],
|
||||
signatures:_createSignatures(wrongEdSig, dsaSig) verifierInformation:nil error:&error],
|
||||
@"Fail on a bad Ed25519 signature regardless: %@", error);
|
||||
XCTAssertTrue([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(edSig, wrongDSASig) error:&error],
|
||||
signatures:_createSignatures(edSig, wrongDSASig) verifierInformation:nil error:&error],
|
||||
@"Allow bad DSA signature if EdDSA signature is good: %@", error);
|
||||
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(@"lol", dsaSig) error:&error],
|
||||
signatures:_createSignatures(@"lol", dsaSig) verifierInformation:nil error:&error],
|
||||
@"Fail if the Ed25519 signature is invalid: %@", error);
|
||||
|
||||
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(edSig, @"lol") error:&error],
|
||||
signatures:_createSignatures(edSig, @"lol") verifierInformation:nil error:&error],
|
||||
@"Fail if invalid DSA signature is used even if EdDSA signature is good: %@", error);
|
||||
#else
|
||||
XCTAssertTrue([v verifyFileAtPath:_testFile
|
||||
@@ -221,7 +221,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
#endif
|
||||
|
||||
XCTAssertTrue([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(edSig, dsaSig) error:&error],
|
||||
signatures:_createSignatures(edSig, dsaSig) verifierInformation:nil error:&error],
|
||||
@"Pass if both are valid: %@", error);
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
SUSignatureVerifier *dsaOnlyVerifier = [[SUSignatureVerifier alloc] initWithPublicKeys:dsaOnlyKeys];
|
||||
|
||||
XCTAssertFalse([dsaOnlyVerifier verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(edSig, nil) error:&error],
|
||||
signatures:_createSignatures(edSig, nil) verifierInformation:nil error:&error],
|
||||
@"DSA cannot verify an Ed signature: %@", error);
|
||||
|
||||
SUPublicKeys *edOnlyKeys = [[SUPublicKeys alloc] initWithEd:_pubEdKey
|
||||
@@ -250,6 +250,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
SUSignatures *signatures = _createSignatures(nil, dsaSig);
|
||||
XCTAssertFalse([edOnlyVerifier verifyFileAtPath:_testFile
|
||||
signatures:signatures
|
||||
verifierInformation:nil
|
||||
error:&error],
|
||||
@"Ed cannot verify an DSA signature: %@", error);
|
||||
}
|
||||
@@ -272,9 +273,9 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
|
||||
NSError *error = nil;
|
||||
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
|
||||
XCTAssertTrue([SUSignatureVerifier validatePath:_testFile withSignatures:sig withPublicKeys:pubkeys error:&error], @"Expected valid signature: %@", error);
|
||||
XCTAssertTrue([SUSignatureVerifier validatePath:_testFile withSignatures:sig withPublicKeys:pubkeys verifierInformation:nil error:&error], @"Expected valid signature: %@", error);
|
||||
#else
|
||||
XCTAssertFalse([SUSignatureVerifier validatePath:_testFile withSignatures:sig withPublicKeys:pubkeys error:&error], @"Expected verification to fail due to disabling DSA: %@", error);
|
||||
XCTAssertFalse([SUSignatureVerifier validatePath:_testFile withSignatures:sig withPublicKeys:pubkeys verifierInformation:nil error:&error], @"Expected verification to fail due to disabling DSA: %@", error);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class SUUpdateValidatorTest: XCTestCase {
|
||||
func testPrevalidation(bundle bundleConfig: BundleConfig, signatures signatureConfig: SignatureConfig, expectedResult: Bool, line: UInt = #line) {
|
||||
let host = SUHost(bundle: self.bundle(bundleConfig))
|
||||
let signatures = self.signatures(signatureConfig)
|
||||
let validator = SUUpdateValidator(downloadPath: self.signedTestFilePath, signatures: signatures, host: host)
|
||||
let validator = SUUpdateValidator(downloadPath: self.signedTestFilePath, signatures: signatures, host: host, verifierInformation: nil)
|
||||
|
||||
let result = (try? validator.validateDownloadPath()) != nil
|
||||
XCTAssertEqual(result, expectedResult, "bundle: \(bundleConfig), signatures: \(signatureConfig)", line: line)
|
||||
@@ -136,7 +136,7 @@ class SUUpdateValidatorTest: XCTestCase {
|
||||
let host = SUHost(bundle: oldBundle)
|
||||
let signatures = self.signatures(signatureConfig)
|
||||
|
||||
let validator = SUUpdateValidator(downloadPath: self.signedTestFilePath, signatures: signatures, host: host)
|
||||
let validator = SUUpdateValidator(downloadPath: self.signedTestFilePath, signatures: signatures, host: host, verifierInformation: nil)
|
||||
|
||||
let updateDirectory = temporaryDirectory("SUUpdateValidatorTest")!
|
||||
defer { try! FileManager.default.removeItem(atPath: updateDirectory) }
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
#import "SUStandardVersionComparator.h"
|
||||
#import "SUUpdateValidator.h"
|
||||
#import "SPUVerifierInformation.h"
|
||||
#import "SUHost.h"
|
||||
#import "SPUSkippedUpdate.h"
|
||||
#import "SUSignatures.h"
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// secret.swift
|
||||
// Sparkle
|
||||
//
|
||||
// Created on 11/19/23.
|
||||
// Copyright © 2023 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
func secretUsesRegularSeed(secret: Data) -> Bool {
|
||||
return (secret.count == 32)
|
||||
}
|
||||
|
||||
func secretUsesOldHashedSeed(secret: Data) -> Bool {
|
||||
return (secret.count == 64 + 32)
|
||||
}
|
||||
|
||||
// Secret is the data we store in the keychain
|
||||
// For newer generated keys, secret is the private seed
|
||||
// For older generated keys, secret is the private orlp/Ed25519 key concatenated with the public key
|
||||
// If the secret is of invalid length, this returns nil
|
||||
func decodePrivateAndPublicKeys(secret: Data) -> (privateKey: Data, publicKey: Data)? {
|
||||
let privateKey: Data
|
||||
let publicKey: Data
|
||||
|
||||
if secretUsesRegularSeed(secret: secret) {
|
||||
let seed = secret
|
||||
|
||||
var privateEdKey = Array<UInt8>(repeating: 0, count: 64)
|
||||
var publicEdKey = Array<UInt8>(repeating: 0, count: 32)
|
||||
seed.withUnsafeBytes { seedBytes in
|
||||
let seedBuffer: UnsafePointer<UInt8> = seedBytes.baseAddress!.assumingMemoryBound(to: UInt8.self)
|
||||
ed25519_create_keypair(&publicEdKey, &privateEdKey, seedBuffer)
|
||||
}
|
||||
|
||||
privateKey = Data(privateEdKey)
|
||||
publicKey = Data(publicEdKey)
|
||||
} else if secretUsesOldHashedSeed(secret: secret) {
|
||||
privateKey = secret[0..<64]
|
||||
publicKey = secret[64...]
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return (privateKey, publicKey)
|
||||
}
|
||||
+40
-14
@@ -9,18 +9,29 @@
|
||||
import Foundation
|
||||
import ArgumentParser
|
||||
|
||||
func loadPrivateKeys(_ account: String, _ privateDSAKey: SecKey?, _ privateEdString: String?) -> PrivateKeys {
|
||||
func loadPrivateKeys(_ account: String, _ privateDSAKey: SecKey?, _ privateEdString: String?, allowNewPrivateKey: Bool) -> PrivateKeys? {
|
||||
var privateEdKey: Data?
|
||||
var publicEdKey: Data?
|
||||
var item: CFTypeRef?
|
||||
var keys: Data?
|
||||
var secret: Data?
|
||||
|
||||
// private + public key is provided as argument
|
||||
if let privateEdString = privateEdString {
|
||||
if privateEdString.count == 128, let data = Data(base64Encoded: privateEdString) {
|
||||
keys = data
|
||||
// private + public key is provided as argument (for older format)
|
||||
if let privateEdString {
|
||||
if let data = Data(base64Encoded: privateEdString) {
|
||||
if allowNewPrivateKey || secretUsesOldHashedSeed(secret: data) {
|
||||
// We always allow the old format without private seed
|
||||
secret = data
|
||||
} else if !allowNewPrivateKey && secretUsesRegularSeed(secret: data) {
|
||||
// Don't support deprecated option for newly generated keys
|
||||
print("Error: specifying private key as the argument is no longer supported.")
|
||||
return nil
|
||||
} else {
|
||||
print("Error: Private key not found in decoded argument, which has \(data.count) bytes. Please provide a valid key.")
|
||||
return nil
|
||||
}
|
||||
} else {
|
||||
print("Warning: Private key not found in the argument. Please provide a valid key.")
|
||||
print("Error: Private key not found in the argument. Please provide a valid key.")
|
||||
return nil
|
||||
}
|
||||
}
|
||||
// get keys from kechain instead
|
||||
@@ -32,16 +43,25 @@ func loadPrivateKeys(_ account: String, _ privateDSAKey: SecKey?, _ privateEdStr
|
||||
kSecAttrProtocol as String: kSecAttrProtocolSSH,
|
||||
kSecReturnData as String: kCFBooleanTrue!,
|
||||
] as CFDictionary, &item)
|
||||
if res == errSecSuccess, let encoded = item as? Data, let data = Data(base64Encoded: encoded) {
|
||||
keys = data
|
||||
if res == errSecSuccess, let encoded = item as? Data {
|
||||
if let data = Data(base64Encoded: encoded) {
|
||||
secret = data
|
||||
} else {
|
||||
print("Error: Failed to base64 decode secret data from keychain")
|
||||
return nil
|
||||
}
|
||||
} else {
|
||||
print("Warning: Private key for account \(account) not found in the Keychain (\(res)). Please run the generate_keys tool")
|
||||
}
|
||||
}
|
||||
|
||||
if let keys = keys {
|
||||
privateEdKey = keys[0..<64]
|
||||
publicEdKey = keys[64...]
|
||||
if let secret {
|
||||
guard let (privateKey, publicKey) = decodePrivateAndPublicKeys(secret: secret) else {
|
||||
print("Error: Failed to decode private and public keys from secret data")
|
||||
return nil
|
||||
}
|
||||
privateEdKey = privateKey
|
||||
publicEdKey = publicKey
|
||||
}
|
||||
return PrivateKeys(privateDSAKey: privateDSAKey, privateEdKey: privateEdKey, publicEdKey: publicEdKey)
|
||||
}
|
||||
@@ -71,7 +91,7 @@ struct GenerateAppcast: ParsableCommand {
|
||||
var privateDSAKeyName: String?
|
||||
#endif
|
||||
|
||||
@Option(name: .customShort("s"), help: ArgumentHelp("(DEPRECATED): The private EdDSA string (128 characters). This option is deprecated. Please use the Keychain, or pass the key as standard input when using the --ed-key-file - option instead.", valueName: "private-EdDSA-key"))
|
||||
@Option(name: .customShort("s"), help: ArgumentHelp("(DEPRECATED): The private EdDSA string (128 characters). This option is deprecated. Please use the Keychain, or pass the key as standard input when using the --ed-key-file - option instead. This option is no longer supported for newly generated keys.", valueName: "private-EdDSA-key"))
|
||||
var privateEdString : String?
|
||||
|
||||
#if GENERATE_APPCAST_BUILD_LEGACY_DSA_SUPPORT
|
||||
@@ -252,11 +272,13 @@ struct GenerateAppcast: ParsableCommand {
|
||||
privateDSAKey = nil
|
||||
#endif
|
||||
|
||||
let allowNewPrivateKey: Bool
|
||||
let privateEdKeyString: String?
|
||||
if let privateEdString = privateEdString {
|
||||
privateEdKeyString = privateEdString
|
||||
|
||||
print("Warning: The -s option for passing the private EdDSA key is insecure and deprecated. Please see its help usage for more information.")
|
||||
allowNewPrivateKey = false
|
||||
} else if let privateEdKeyPath = privateEdKeyPath {
|
||||
do {
|
||||
let privateKeyString: String
|
||||
@@ -272,15 +294,19 @@ struct GenerateAppcast: ParsableCommand {
|
||||
}
|
||||
|
||||
privateEdKeyString = privateKeyString
|
||||
allowNewPrivateKey = true
|
||||
} catch {
|
||||
print("Unable to load EdDSA private key from", privateEdKeyPath, "\n", error)
|
||||
throw ExitCode(1)
|
||||
}
|
||||
} else {
|
||||
privateEdKeyString = nil
|
||||
allowNewPrivateKey = true
|
||||
}
|
||||
|
||||
let keys = loadPrivateKeys(account, privateDSAKey, privateEdKeyString)
|
||||
guard let keys = loadPrivateKeys(account, privateDSAKey, privateEdKeyString, allowNewPrivateKey: allowNewPrivateKey) else {
|
||||
throw ExitCode(1)
|
||||
}
|
||||
|
||||
do {
|
||||
let appcastsByFeed = try makeAppcasts(archivesSourceDir: archivesSourceDir, outputPathURL: outputPathURL, cacheDirectory: GenerateAppcast.cacheDirectory, keys: keys, versions: versions, maxVersionsPerBranchInFeed: maxVersionsPerBranchInFeed, newChannel: channel, majorVersion: majorVersion, maximumDeltas: maximumDeltas, deltaCompressionModeDescription: deltaCompression, deltaCompressionLevel: deltaCompressionLevel, disableNestedCodeCheck: disableNestedCodeCheck, downloadURLPrefix: downloadURLPrefix, releaseNotesURLPrefix: releaseNotesURLPrefix, verbose: verbose)
|
||||
|
||||
+31
-27
@@ -40,7 +40,7 @@ private func failure(_ message: String) -> Never {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
func findKeyPair(account: String) -> Data? {
|
||||
func findSecret(account: String) -> Data? {
|
||||
var item: CFTypeRef?
|
||||
let res = SecItemCopyMatching(commonKeychainItemAttributes(account: account).merging([
|
||||
/// Return a matched item's value as a CFData object.
|
||||
@@ -49,8 +49,8 @@ func findKeyPair(account: String) -> Data? {
|
||||
|
||||
switch res {
|
||||
case errSecSuccess:
|
||||
if let keys = (item as? Data).flatMap({ Data(base64Encoded: $0) }) {
|
||||
return keys
|
||||
if let secret = (item as? Data).flatMap({ Data(base64Encoded: $0) }) {
|
||||
return secret
|
||||
} else {
|
||||
failure("""
|
||||
Item found, but is corrupt or has been overwritten!
|
||||
@@ -89,7 +89,7 @@ func findKeyPair(account: String) -> Data? {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
func generateKeyPair() -> (publicEdKey: Data, privateEdKey: Data) {
|
||||
func generatePublicKeyAndSeed() -> (publicEdKey: Data, seed: Data) {
|
||||
var seed = Array<UInt8>(repeating: 0, count: 32)
|
||||
var publicEdKey = Array<UInt8>(repeating: 0, count: 32)
|
||||
var privateEdKey = Array<UInt8>(repeating: 0, count: 64)
|
||||
@@ -99,10 +99,10 @@ func generateKeyPair() -> (publicEdKey: Data, privateEdKey: Data) {
|
||||
}
|
||||
ed25519_create_keypair(&publicEdKey, &privateEdKey, seed)
|
||||
|
||||
return (Data(publicEdKey), Data(privateEdKey))
|
||||
return (Data(publicEdKey), Data(seed))
|
||||
}
|
||||
|
||||
func storeKeyPair(account: String, publicEdKey: Data, privateEdKey: Data) {
|
||||
func storeSecret(account: String, publicEdKey: Data, secret: Data) {
|
||||
let query = commonKeychainItemAttributes(account: account).merging([
|
||||
/// Mark the new item as sensitive (requires keychain password to export - e.g. a private key).
|
||||
kSecAttrIsSensitive as String: kCFBooleanTrue!,
|
||||
@@ -121,7 +121,7 @@ func storeKeyPair(account: String, publicEdKey: Data, privateEdKey: Data) {
|
||||
kSecAttrDescription as String: "private key",
|
||||
|
||||
/// The actual data content of the new item.
|
||||
kSecValueData as String: (privateEdKey + publicEdKey).base64EncodedData() as CFData
|
||||
kSecValueData as String: secret.base64EncodedData() as CFData
|
||||
|
||||
], uniquingKeysWith: { $1 }) as CFDictionary
|
||||
|
||||
@@ -163,7 +163,7 @@ struct GenerateKeys: ParsableCommand {
|
||||
@Flag(name: .customShort("p"), help: ArgumentHelp("Looks up and just prints the existing public key stored in the Keychain."))
|
||||
var lookUpPublicKey: Bool = false
|
||||
|
||||
@Option(name: .customShort("x"), help: ArgumentHelp("Exports your private key from your login keychain and writes it to private-key-file. Note the contents of this sensitive exported file are the same as the password to the \"\(PRIVATE_KEY_LABEL)\" item in your keychain.", valueName: "private-key-file"))
|
||||
@Option(name: .customShort("x"), help: ArgumentHelp("Exports your private key from your login keychain and writes it to private-key-file. Note the contents of this sensitive exported file are the same as the password to the \"\(PRIVATE_KEY_LABEL)\" item in your keychain. For advanced usage if the private key is generated in the new format (i.e. the key file after base64 decoding is 32 bytes), then the exported key file is the base64 encoding of the private seed. The seed can be used to create the private/public keypair with other tools that support EdDSA signing.", valueName: "private-key-file"))
|
||||
var exportedPrivateKeyFile: String?
|
||||
|
||||
@Option(name: .customShort("f"), help: ArgumentHelp("Imports the private key from private-key-file into your keychain instead of generating a new key. This file has likely been exported via -x option from another machine. Any existing \"\(PRIVATE_KEY_LABEL)\" items listed in Keychain Access may need to be removed manually first before proceeding.", valueName: "private-key-file"))
|
||||
@@ -206,8 +206,10 @@ struct GenerateKeys: ParsableCommand {
|
||||
func run() throws {
|
||||
if lookUpPublicKey {
|
||||
/// Lookup mode - print just the pubkey and exit
|
||||
if let keyPair = findKeyPair(account: account) {
|
||||
let pubKey = keyPair[64...]
|
||||
if let secret = findSecret(account: account) {
|
||||
guard let (_, pubKey) = decodePrivateAndPublicKeys(secret: secret) else {
|
||||
failure("Stored private key must be 32 or 96 bytes (for the older format) decoded. Instead it is \(secret.count) bytes decoded.")
|
||||
}
|
||||
print(pubKey.base64EncodedString())
|
||||
} else {
|
||||
failure("No existing signing key found!")
|
||||
@@ -219,45 +221,45 @@ struct GenerateKeys: ParsableCommand {
|
||||
failure("private-key-file already exists: \(exportURL.path)")
|
||||
}
|
||||
|
||||
guard let keyPair = findKeyPair(account: account) else {
|
||||
guard let secret = findSecret(account: account) else {
|
||||
failure("No existing signing key found!")
|
||||
}
|
||||
|
||||
do {
|
||||
try keyPair.base64EncodedString().write(to: exportURL, atomically: true, encoding: .utf8)
|
||||
try secret.base64EncodedString().write(to: exportURL, atomically: true, encoding: .utf8)
|
||||
} catch {
|
||||
failure("Failed to write exported file: \(error)")
|
||||
}
|
||||
} else if let importedPrivateKeyFile = importedPrivateKeyFile {
|
||||
/// Import mode - import the specifed key-pair file
|
||||
let privateAndPublicBase64KeyFile = importedPrivateKeyFile
|
||||
let privateAndPublicBase64Key: String
|
||||
let secretBase64File = importedPrivateKeyFile
|
||||
let secretBase64: String
|
||||
do {
|
||||
privateAndPublicBase64Key = try String(contentsOfFile: privateAndPublicBase64KeyFile)
|
||||
secretBase64 = try String(contentsOfFile: secretBase64File)
|
||||
} catch {
|
||||
failure("Failed to read private-key-file: \(error)")
|
||||
}
|
||||
|
||||
guard let privateAndPublicKey = Data(base64Encoded: privateAndPublicBase64Key.trimmingCharacters(in: .whitespacesAndNewlines), options: .init()) else {
|
||||
failure("Failed to decode base64 encoded key data from: \(privateAndPublicBase64Key)")
|
||||
guard let secret = Data(base64Encoded: secretBase64.trimmingCharacters(in: .whitespacesAndNewlines), options: .init()) else {
|
||||
failure("Failed to decode base64 encoded key data from: \(secretBase64)")
|
||||
}
|
||||
|
||||
guard privateAndPublicKey.count == 64 + 32 else {
|
||||
failure("Imported key must be 96 bytes decoded. Instead it is \(privateAndPublicKey.count) bytes decoded.")
|
||||
guard let (_, publicKey) = decodePrivateAndPublicKeys(secret: secret) else {
|
||||
failure("Imported key must be 32 or 96 bytes (for the older format) decoded. Instead it is \(secret.count) bytes decoded.")
|
||||
}
|
||||
|
||||
print("Importing signing key..\n")
|
||||
|
||||
let publicKey = privateAndPublicKey[64...]
|
||||
let privateKey = privateAndPublicKey[0..<64]
|
||||
|
||||
storeKeyPair(account: account, publicEdKey: publicKey, privateEdKey: privateKey)
|
||||
storeSecret(account: account, publicEdKey: publicKey, secret: secret)
|
||||
|
||||
printNewPublicKeyUsage(publicKey)
|
||||
} else {
|
||||
/// Default mode - find an existing public key and print its usage, or generate new keys
|
||||
if let keyPair = findKeyPair(account: account) {
|
||||
let pubKey = keyPair[64...]
|
||||
if let secret = findSecret(account: account) {
|
||||
guard let (_, pubKey) = decodePrivateAndPublicKeys(secret: secret) else {
|
||||
failure("Stored private key must be 32 or 96 bytes (for the older format) decoded. Instead it is \(secret.count) bytes decoded.")
|
||||
}
|
||||
|
||||
print("""
|
||||
A pre-existing signing key was found. This is how it should appear in your Info.plist:
|
||||
|
||||
@@ -268,8 +270,10 @@ struct GenerateKeys: ParsableCommand {
|
||||
} else {
|
||||
print("Generating a new signing key. This may take a moment, depending on your machine.")
|
||||
|
||||
let (pubKey, privKey) = generateKeyPair()
|
||||
storeKeyPair(account: account, publicEdKey: pubKey, privateEdKey: privKey)
|
||||
let (pubKey, seed) = generatePublicKeyAndSeed()
|
||||
// New keys that are generated only store the seed as the secret
|
||||
// Old keys store private orlp/Ed25519 key + public key
|
||||
storeSecret(account: account, publicEdKey: pubKey, secret: seed)
|
||||
|
||||
printNewPublicKeyUsage(pubKey)
|
||||
}
|
||||
|
||||
+34
-17
@@ -19,8 +19,23 @@ func findKeysInKeychain(account: String) throws -> (Data, Data) {
|
||||
kSecAttrProtocol as String: kSecAttrProtocolSSH,
|
||||
kSecReturnData as String: kCFBooleanTrue!,
|
||||
] as CFDictionary, &item)
|
||||
if res == errSecSuccess, let encoded = item as? Data, let keys = Data(base64Encoded: encoded) {
|
||||
return (keys[0..<64], keys[64..<(64+32)])
|
||||
if res == errSecSuccess {
|
||||
guard let encoded = item as? Data else {
|
||||
print("ERROR! Unable to decode data from Keychain")
|
||||
throw ExitCode.failure
|
||||
}
|
||||
|
||||
guard let secret = Data(base64Encoded: encoded) else {
|
||||
print("ERROR! Unable to decode data from Keychain as base64")
|
||||
throw ExitCode.failure
|
||||
}
|
||||
|
||||
guard let (privateKey, publicKey) = decodePrivateAndPublicKeys(secret: secret) else {
|
||||
print("ERROR! Key pair data stored in keychain has \(secret.count) bytes which is invalid")
|
||||
throw ExitCode.failure
|
||||
}
|
||||
|
||||
return (privateKey, publicKey)
|
||||
} else if res == errSecItemNotFound {
|
||||
print("ERROR! Signing key not found for account \(account). Please run generate_keys tool first or provide key with --ed-key-file <private_key_file>")
|
||||
} else if res == errSecAuthFailed {
|
||||
@@ -36,34 +51,36 @@ func findKeysInKeychain(account: String) throws -> (Data, Data) {
|
||||
throw ExitCode.failure
|
||||
}
|
||||
|
||||
func findKeys(inFile privateAndPublicBase64KeyFile: String) throws -> (Data, Data) {
|
||||
let privateAndPublicBase64Key: String
|
||||
if privateAndPublicBase64KeyFile == "-" && !FileManager.default.fileExists(atPath: privateAndPublicBase64KeyFile) {
|
||||
func findKeys(inFile secretFile: String) throws -> (Data, Data) {
|
||||
let secretString: String
|
||||
if secretFile == "-" && !FileManager.default.fileExists(atPath: secretFile) {
|
||||
if let line = readLine(strippingNewline: true) {
|
||||
privateAndPublicBase64Key = line
|
||||
secretString = line
|
||||
} else {
|
||||
print("ERROR! Unable to read EdDSA private key from standard input")
|
||||
throw ExitCode(1)
|
||||
}
|
||||
} else {
|
||||
privateAndPublicBase64Key = try String(contentsOfFile: privateAndPublicBase64KeyFile)
|
||||
secretString = try String(contentsOfFile: secretFile)
|
||||
}
|
||||
return try findKeys(inString: privateAndPublicBase64Key)
|
||||
return try findKeys(inString: secretString, allowNewFormat: true)
|
||||
}
|
||||
|
||||
func findKeys(inString privateAndPublicBase64Key: String) throws -> (Data, Data) {
|
||||
guard let privateAndPublicKey = Data(base64Encoded: privateAndPublicBase64Key.trimmingCharacters(in: .whitespacesAndNewlines), options: .init()) else {
|
||||
print("ERROR! Failed to decode base64 encoded key data from: \(privateAndPublicBase64Key)")
|
||||
func findKeys(inString secretBase64String: String, allowNewFormat: Bool) throws -> (Data, Data) {
|
||||
guard let secret = Data(base64Encoded: secretBase64String.trimmingCharacters(in: .whitespacesAndNewlines), options: .init()) else {
|
||||
print("ERROR! Failed to decode base64 encoded key data from: \(secretBase64String)")
|
||||
throw ExitCode.failure
|
||||
}
|
||||
|
||||
guard privateAndPublicKey.count == 64 + 32 else {
|
||||
print("ERROR! Imported key must be 96 bytes decoded. Instead it is \(privateAndPublicKey.count) bytes decoded.")
|
||||
guard allowNewFormat || !secretUsesRegularSeed(secret: secret) else {
|
||||
print("ERROR! Specifying private key as an argument is no longer supported.")
|
||||
throw ExitCode.failure
|
||||
}
|
||||
|
||||
let publicKey = privateAndPublicKey[64...]
|
||||
let privateKey = privateAndPublicKey[0..<64]
|
||||
guard let (privateKey, publicKey) = decodePrivateAndPublicKeys(secret: secret) else {
|
||||
print("ERROR! Imported key must be 64 bytes or 96 bytes (for the older format) decoded. Instead it is \(secret.count) bytes decoded.")
|
||||
throw ExitCode.failure
|
||||
}
|
||||
|
||||
return (privateKey, publicKey)
|
||||
}
|
||||
@@ -100,7 +117,7 @@ struct SignUpdate: ParsableCommand {
|
||||
@Argument(help: "The signature to verify when --verify is passed.")
|
||||
var verifySignature: String?
|
||||
|
||||
@Option(name: .customShort("s"), help: ArgumentHelp("(DEPRECATED): The private EdDSA (ed25519) key. Please use the Keychain, or pass the key as standard input when using --ed-key-file - instead.", valueName: "private-key"))
|
||||
@Option(name: .customShort("s"), help: ArgumentHelp("(DEPRECATED): The private EdDSA (ed25519) key. Please use the Keychain, or pass the key as standard input when using --ed-key-file - instead. This option is no longer supported for newly generated keys. ", valueName: "private-key"))
|
||||
var privateKey: String?
|
||||
|
||||
static var configuration: CommandConfiguration = CommandConfiguration(
|
||||
@@ -127,7 +144,7 @@ struct SignUpdate: ParsableCommand {
|
||||
if let privateKey = privateKey {
|
||||
fputs("Warning: The -s option for passing the private EdDSA key is insecure and deprecated. Please see its help usage for more information.\n", stderr)
|
||||
|
||||
(priv, pub) = try findKeys(inString: privateKey)
|
||||
(priv, pub) = try findKeys(inString: privateKey, allowNewFormat: false)
|
||||
} else if let privateKeyFile = privateKeyFile {
|
||||
(priv, pub) = try findKeys(inFile: privateKeyFile)
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user