Skip to content

Add a read-only pre-authority inventory contract - #25

Open
ksajan wants to merge 1 commit into
macintog:mainfrom
ksajan:preclient-inventory
Open

ksajan wants to merge 1 commit into
macintog:mainfrom
ksajan:preclient-inventory

Conversation

@ksajan

@ksajan ksajan commented Nov 14, 2026

Copy link
Copy Markdown

Summary

The full --full-inventory path is a post-install check: it requires protocol-v2 attestation and present Catacomb metadata. Before native first-run the same wire surface is legitimately empty, so that path correctly refuses it. This adds a separate, read-only pre-authority contract instead of weakening the full-inventory guard:

  • t2-touchid-inventory --preclient
  • bridge-xpc-probe.py --initialize --preclient-inventory

It reports state: absent-baseline or state: present, with authority: unknown and mutation_performed: false. It never creates, adopts, recovers, or enrolls authority.

Contract

The absent baseline is admitted only when all of these hold:

  • protocol v2 is attested by a successful v2-only identity command (0x51), not by command 1; the known kIOReturnBadArgument reply on command 1 is accepted only in that form;
  • per-user and global identity lists are status 0 and are either the exact fixed nil sentinel or valid record bytes;
  • Catacomb UUID/hash are status 22 with exact-sized all-zero payloads;
  • Catacomb state is the one-master-component baseline with no selected-user component;
  • capacity is status 0, 4 bytes each, and internally consistent;
  • the two snapshots are exactly equal and emit no service events.

Anything else fails closed. A present Catacomb is reported as present but is never adopted.

Tests

  • New parser tests: nil sentinel vs. malformed/identity-bearing baselines, exact-zero Catacomb metadata, v2 attestation, unstable snapshots, unexpected service events, capacity bounds, identifier redaction.
  • New wrapper tests: unknown authority, mutation, unknown state, live absent baseline, present state.
  • Full suite: 1682 tests, OK (skipped=1) with the project venv.
  • tools/privacy-check.sh and enrollment_research/scripts/check-public-tree.sh pass.

Hardware coverage

No live hardware run for this PR. The absent-baseline fixture is the shape reported from the Linux-only MacBookPro16,1 / bridgeOS 23P6068 capture in #17: command 1 rejected with 0xe00002c2, exact nil identity lists, and Catacomb UUID/hash status 22 with exact-sized zero payloads. The full-inventory refusal remains unchanged and is still exercised.

Risk and recovery

The full-inventory path requires protocol v2 and present Catacomb metadata, so it correctly refuses the absent baseline before native first-run. Add a separate read-only contract that admits only the exact empty-list sentinel and exact absent-Catacomb metadata, attests v2 via a v2-only identity command, and reports authority as unknown without creating or adopting it.

The installed inventory command exposes the mode as --preclient; the research probe exposes --preclient-inventory.
@ksajan
ksajan force-pushed the preclient-inventory branch from b949024 to 60beede Compare November 14, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant