fix(native): verify nested code and keep ticket read failures local

Address review findings in inspect_signature:
- Verify with `codesign --verify --deep --strict`. Shallow verification
  misses a file added inside a nested XPC service, or a modified dylib
  inside a framework. verify:code-signature now tampers inside the
  nested XPC service and requires `invalid`.
- Classify verification as `unsigned` only when the top-level target is
  unsigned. Unsigned nested code inside a signed bundle is `invalid`.
- Report a stapled ticket that exists but cannot be read as
  `unreadable`, with the error code in a new `reason` field, instead of
  failing the whole signature inspection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-07 11:54:32 +00:00
co-authored by Claude Opus 5.5
parent 25ca63f231
commit 37824e8c46
12 changed files with 155 additions and 50 deletions
+17
View File
@@ -132,6 +132,22 @@ try {
assert.equal(platform.verification.status, "valid");
assert.equal(facets(platform)["library-validation"], "enforced");
// Only deep verification sees a file added inside nested code.
const nested = join(root, "Nested.app");
await exec("/usr/bin/ditto", [app, nested]);
await writeFile(
join(nested, "Contents/XPCServices/Svc.xpc/Contents/added.txt"),
"unsealed",
);
const nestedTamper = await artifactCli("inspect-signature", nested);
assert.equal(nestedTamper.verification.status, "invalid");
assert.ok(
nestedTamper.verification.diagnostics.some((line) =>
line.includes("Svc.xpc"),
),
JSON.stringify(nestedTamper.verification),
);
await mkdir(join(app, "Contents/Resources"), { recursive: true });
await writeFile(join(app, "Contents/Resources/added.txt"), "unsealed");
const tampered = await artifactCli("inspect-signature", app);
@@ -155,6 +171,7 @@ try {
],
platform_identifier: platform.code_directory.platform_identifier,
tampered_verification: tampered.verification.status,
nested_tamper_verification: nestedTamper.verification.status,
})}\n`,
);
} finally {