mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-26 04:57:54 +00:00
Adds an opt-in option (SUVerifyUpdateBeforeExtraction) to enforce verifying updates before extracting them for stronger security. EdDSA signing is required to use this option. As fallback in case EdDSA keys are lost, disk image archives's code signatures are validated assuming it's Developer ID signed. Key rotation is still possible. Apple Archives (aar, yaa) now require using this option.
43 lines
1.3 KiB
Objective-C
43 lines
1.3 KiB
Objective-C
//
|
|
// SUCodeSigningVerifier.h
|
|
// Sparkle
|
|
//
|
|
// Created by Andy Matuschak on 7/5/12.
|
|
//
|
|
//
|
|
|
|
#ifndef SUCODESIGNINGVERIFIER_H
|
|
#define SUCODESIGNINGVERIFIER_H
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
#ifndef BUILDING_SPARKLE_TESTS
|
|
#define SUCodeSigningVerifierDefinitionAttribute SPU_OBJC_DIRECT_MEMBERS
|
|
#else
|
|
#define SUCodeSigningVerifierDefinitionAttribute __attribute__((objc_runtime_name("SUTestCodeSigningVerifier")))
|
|
#endif
|
|
|
|
SUCodeSigningVerifierDefinitionAttribute
|
|
@interface SUCodeSigningVerifier : NSObject
|
|
|
|
+ (BOOL)codeSignatureIsValidAtBundleURL:(NSURL *)newBundleURL andMatchesSignatureAtBundleURL:(NSURL *)oldBundleURL error:(NSError **)error;
|
|
|
|
+ (BOOL)codeSignatureIsValidAtBundleURL:(NSURL *)bundleURL checkNestedCode:(BOOL)checkNestedCode error:(NSError **)error;
|
|
|
|
// Same as above except does not check for nested code. This method should be used by the framework.
|
|
+ (BOOL)codeSignatureIsValidAtBundleURL:(NSURL *)bundleURL error:(NSError *__autoreleasing *)error;
|
|
|
|
+ (BOOL)codeSignatureIsValidAtDownloadURL:(NSURL *)downloadURL andMatchesDeveloperIDTeamFromOldBundleURL:(NSURL *)oldBundleURL error:(NSError * __autoreleasing *)error;
|
|
|
|
+ (BOOL)bundleAtURLIsCodeSigned:(NSURL *)bundleURL;
|
|
|
|
+ (NSString * _Nullable)teamIdentifierAtURL:(NSURL *)url;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|
#endif
|