refactor(native): extract signature verification from inspect_signature
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
37824e8c46
commit
94243fa5a1
@@ -343,13 +343,7 @@ class NativeMacOSClient implements AnalysisClient {
|
||||
// Entitlements XML is printed to stdout; stderr echoes the path.
|
||||
const entitlementValue = parseEntitlements(entitlements.value.stdout);
|
||||
const verifyPath = signedCodePath(this.target);
|
||||
const verify = await this.#run(
|
||||
"inspect_signature",
|
||||
"codesign",
|
||||
// --deep verifies nested frameworks, helpers, extensions and XPC services.
|
||||
["--verify", "--deep", "--strict", "--verbose=2", verifyPath],
|
||||
{ signal, acceptNonZero: true },
|
||||
);
|
||||
const verify = await this.#verifySignature(verifyPath, signal);
|
||||
if (!verify.ok) return verify;
|
||||
const captures = [
|
||||
display.value,
|
||||
@@ -409,6 +403,20 @@ class NativeMacOSClient implements AnalysisClient {
|
||||
});
|
||||
}
|
||||
|
||||
/** Local verification of the opened code, including nested code. */
|
||||
#verifySignature(
|
||||
path: string,
|
||||
signal?: AbortSignal,
|
||||
): Promise<Result<NativeCommandCapture, AnalysisError>> {
|
||||
// --deep verifies nested frameworks, helpers, extensions and XPC services.
|
||||
return this.#run(
|
||||
"inspect_signature",
|
||||
"codesign",
|
||||
["--verify", "--deep", "--strict", "--verbose=2", path],
|
||||
{ signal, acceptNonZero: true },
|
||||
);
|
||||
}
|
||||
|
||||
async #inspectMixedSignatureSlices(
|
||||
format: string | null,
|
||||
requirementsUnavailable: boolean,
|
||||
|
||||
Reference in New Issue
Block a user