refactor(native): extract signature verification from inspect_signature

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-07 11:55:05 +00:00
co-authored by Claude Opus 5.5
parent 37824e8c46
commit 94243fa5a1
+15 -7
View File
@@ -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,