Limit launch integrity checks to signed Dayu Color executables
这个提交包含在:
1 父节点
14afd3382c
当前提交
9f5f065977
3 个文件已更改
+19
-11
没有与搜索条件相匹配的文件
+3
-3
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.14.3</string>
|
||||
<string>1.14.4</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>94</string>
|
||||
<string>95</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>PlugInKit</key>
|
||||
@@ -71,7 +71,7 @@
|
||||
<key>uuid</key>
|
||||
<string>1C17B73B-F229-4C09-A434-EAF6DFF5F22A</string>
|
||||
<key>version</key>
|
||||
<string>1.14.3</string>
|
||||
<string>1.14.4</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>className</key>
|
||||
|
||||
@@ -39,22 +39,22 @@ static OSStatus DYValidateBundle(NSURL *url, NSString *identifier, SecCSFlags fl
|
||||
SecStaticCodeRef code = NULL;
|
||||
status = SecStaticCodeCreateWithPath((__bridge CFURLRef)url, kSecCSDefaultFlags, &code);
|
||||
if (status == errSecSuccess) {
|
||||
status = SecStaticCodeCheckValidity(code, flags | kSecCSStrictValidate | kSecCSCheckAllArchitectures,
|
||||
requirement);
|
||||
status = SecStaticCodeCheckValidity(code, flags, requirement);
|
||||
CFRelease(code);
|
||||
}
|
||||
CFRelease(requirement);
|
||||
return status;
|
||||
}
|
||||
|
||||
OSStatus DYValidateSignedInstallation(NSURL *wrapperURL, NSString **failedComponent) {
|
||||
static OSStatus DYValidateInstallation(NSURL *wrapperURL, SecCSFlags wrapperFlags, SecCSFlags serviceFlags,
|
||||
NSString **failedComponent) {
|
||||
if (failedComponent) *failedComponent = @"wrapper";
|
||||
OSStatus status = DYValidateBundle(wrapperURL, DYWrapperIdentifier, kSecCSDefaultFlags);
|
||||
OSStatus status = DYValidateBundle(wrapperURL, DYWrapperIdentifier, wrapperFlags);
|
||||
if (status != errSecSuccess) return status;
|
||||
|
||||
if (failedComponent) *failedComponent = @"service";
|
||||
NSURL *serviceURL = [wrapperURL URLByAppendingPathComponent:DYPluginRelativePath isDirectory:YES];
|
||||
status = DYValidateBundle(serviceURL, DYServiceIdentifier, kSecCSCheckNestedCode);
|
||||
status = DYValidateBundle(serviceURL, DYServiceIdentifier, serviceFlags);
|
||||
if (status != errSecSuccess) return status;
|
||||
|
||||
// A separately signed older service with the same identity must not be mixed into this build.
|
||||
@@ -68,6 +68,11 @@ OSStatus DYValidateSignedInstallation(NSURL *wrapperURL, NSString **failedCompon
|
||||
return errSecSuccess;
|
||||
}
|
||||
|
||||
OSStatus DYValidateSignedInstallation(NSURL *wrapperURL, NSString **failedComponent) {
|
||||
const SecCSFlags strict = kSecCSStrictValidate | kSecCSCheckAllArchitectures;
|
||||
return DYValidateInstallation(wrapperURL, strict, strict | kSecCSCheckNestedCode, failedComponent);
|
||||
}
|
||||
|
||||
OSStatus DYValidateRunningInstallation(DYCodeRole role, NSString **failedComponent) {
|
||||
BOOL isService = role == DYCodeRoleService;
|
||||
if (failedComponent) *failedComponent = isService ? @"running-service" : @"running-wrapper";
|
||||
@@ -84,5 +89,8 @@ OSStatus DYValidateRunningInstallation(DYCodeRole role, NSString **failedCompone
|
||||
if (![wrapperURL.pathExtension isEqualToString:@"app"] ||
|
||||
![bundleURL.path isEqualToString:expected.path]) return errSecCSBadBundleFormat;
|
||||
}
|
||||
return DYValidateSignedInstallation(wrapperURL, failedComponent);
|
||||
// At launch, verify both native executables and their signed identities.
|
||||
// Leave resource and nested-framework traversal to downloaded-package verification.
|
||||
return DYValidateInstallation(wrapperURL, kSecCSDoNotValidateResources, kSecCSDoNotValidateResources,
|
||||
failedComponent);
|
||||
}
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.14.3</string>
|
||||
<string>1.14.4</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>94</string>
|
||||
<string>95</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
在新工单中引用
屏蔽一个用户