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:
co-authored by
Claude Opus 5.5
parent
25ca63f231
commit
37824e8c46
@@ -42,7 +42,7 @@ export const sealedResourcesSchema = z.object({
|
||||
files: z.number().int().nullable(),
|
||||
});
|
||||
|
||||
/** Local `codesign --verify --strict` outcome for the signed code. */
|
||||
/** Local `codesign --verify --deep --strict` outcome for the signed code. */
|
||||
export const signatureVerificationSchema = z.object({
|
||||
path: z.string(),
|
||||
status: z.enum(["valid", "invalid", "unsigned"]),
|
||||
@@ -53,13 +53,15 @@ export const signatureVerificationSchema = z.object({
|
||||
|
||||
/** Presence of a notarization ticket stapled to an app bundle. */
|
||||
export const stapledTicketSchema = z.object({
|
||||
status: z.enum(["present", "absent", "not-applicable"]),
|
||||
status: z.enum(["present", "absent", "unreadable", "not-applicable"]),
|
||||
path: z.string().nullable(),
|
||||
sha256: z
|
||||
.string()
|
||||
.regex(/^[a-f0-9]{64}$/u)
|
||||
.nullable(),
|
||||
size: z.number().int().nonnegative().nullable(),
|
||||
/** Why an existing ticket file could not be read, such as EACCES. */
|
||||
reason: z.string().nullable(),
|
||||
});
|
||||
|
||||
const facetSchema = z.discriminatedUnion("facet", [
|
||||
|
||||
Reference in New Issue
Block a user