Repository navigation
Conversation
|
HOLD on I reproduced these gaps using synthetic records against this exact helper:
Please make the keep path depend on an admitted, device-local provisioning record. A concrete implementation contract is:
A concrete readiness implementation is a root-private marker under Concrete control-flow change in The decision should be equivalent to: current = extract_current_source(admitted_isc) # not the PARTUUID-only cache
inputs = admit_current_device_handoff(live_identity, current_firmware)
expected = reseal(current, inputs.seal, inputs.current_trust)
validate(expected, current, inputs)
if installed == expected:
mark_biometric_ready()
else:
preserve_private_rollback(installed)
atomic_install(expected)Those names describe proposed interfaces, not functions already present in this repository. Any missing/stale admission must take the refresh-required path before this code runs. Simply raising an exception in this helper is insufficient because Add warm-cache source changes, manifest-only firmware changes, old bundle alongside current, wrong-device/missing-identity, opaque property bytes, malformed/duplicate DER properties, and valid replacement/failed replacement with byte-exact rollback tests. Keep all fixtures synthetic. The existing FSCl and sensorless paths need regression coverage too. Validation on this exact head: 98/98 source tests pass; eight additional synthetic cases reproduce the gaps above. These package/source gates do not clear the validity and freshness holds. No device test was performed in this review. Rerun affected gates on the corrected source and retain the owner's match-only runtime gate. No merge or contributor-branch change is part of this review. |
The enclave loads a standalone FSC2 calibration (J700, J713) only
resealed with the Mac's own factory records:
comb { fdrd: IMG4 { IM4P, [0] seal-<CHIP>-<ECID> }, secb: trust bundle }
prepare-sep-calibration cached the carved image by partition identity
and wrote it over that record at every start.
Every start now reads the factory cache read-only from the Hardware
volume of the iBoot System Container, and rebuilds the record from it.
The APFS reader is bounded: the newest checksummed checkpoint, the
object maps, the file-system tree and uncompressed regular files only.
The rebuild takes:
- the FSC2 calibration's IM4P;
- the one seal, which must name the running Mac's CHIP and ECID from
the boot's local policy manifest, carry its serial number, and list
the IM4P's SHA-384 as its FSC2 digest;
- the trust bundle whose named copy matches trustobject-current.
IM4M properties are walked as strict DER, with limits on size, depth
and element count.
The installed record is replaced only when it differs. The replacement
is written atomically with mode 0600 and read back, and the old bytes
are kept as private rollback evidence. When the records cannot be
admitted, the bare image is never installed, a wrong-device or
malformed record moves to private quarantine, and Touch ID stays
unready. An FSCl comb record is still installed as carved, checked as
the extractor checks it.
Readiness is a per-boot marker in /run/aurora-sep that names the
admitted digests. aurora-sep-ready.service and fprintd now also require
calibration-ready, which checks the installed bytes against the marker.
SEP trusted keys start either way. These are provenance and structure
checks; the enclave verifies the signatures.
de9ea1c to
0986e4c
Compare
|
Thanks for the counterexamples. All three PRs now have a new head, and the helper is identical in each. The body has the details; point by point:
Not run on this head: |
|
Please hold off on re-reviewing this for now. I'll update it with test results later today, including the full boot on the J713 with fprintd starting through the new readiness gate. |
|
Test results for 0986e4c, as promised: Nix. In
Packaged helper against the live boot container. In a throwaway container, with the J713's boot partition passed in read-only and empty state, run and firmware directories, the packaged helper:
The same container showed the identity guard: before the device tree was exposed, the helper refused ("the running Mac does not identify itself"), installed nothing and wrote no marker. J713 (M4 Air), real boot. This Mac runs the Arch package from aurora-silicon/alarm-aurora#26. Its
Gate. On this machine, transient units running the real Not tested: a NixOS system booted on Apple Silicon. |
|
Closing: Ryan cherry-picked this head into main as ce2c510 (helper, calibration-ready and tests), and #52's |
Keep the same candidate source across Fedora, Arch and NixOS. Upstream PR #27 retains the stricter J700 limit and re-arm margin alongside V/I smoothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This is the NixOS side of aurora-silicon/alarm-aurora#26 (Fedora: aurora-silicon/fedora-aurora#28).
sep/prepare-sep-calibrationhere is identical to alarm-aurora's, and so is the bug:aurora-sep.serviceruns it asExecStartPreto prepare the Touch ID calibration.The bug
On Macs whose calibration is a standalone FSC2 image (J700, J713), the enclave refuses the bare image (
LOAD_CALIBRATIONfails). It loads the calibration only resealed with the Mac's own factory records:The helper cached the carved bare image by partition identity, and every start wrote it over that sealed record.
The fix
Every start now rebuilds the sealed record from this Mac's factory cache, then installs it only if the installed bytes differ.
Source of truth. The helper reads
FactoryData/System/Library/Caches/com.apple.factorydataread-only from the Hardware volume of the iBoot System Container. The APFS reader in the helper is deliberately narrow:Every object it reads is checksummed. Anything else is refused, with bounds on block size, tree size and depth, file count and file size. On this J713 the whole read takes about 80 ms. There is no cache.
Admission. A record is rebuilt only when all of these hold:
seal-<CHIP>-<ECID>.MANPmust carry the device tree'sserial-numberasSrNm.FSC2-<sensor>record, an exactIMG4 { IM4P { FSC2, version, payload }, [0] IM4M }. The seal'sFSC2object must list the IM4P's SHA-384 as itsDGST.trustobject-<sha256>whose digest and bytes matchtrustobject-current. Withouttrustobject-current, the only named bundle is used, and it must match its own name. This follows aurora-installer'ssensor-root-key.md.DGST.Installation.
/var/lib/aurora-sep/rollback, the newest four). The rebuilt record is then written atomically with mode 0600, fsynced and read back.Refusal.
/var/lib/aurora-sep/quarantine), out of the firmware search path.Readiness.
/run/aurora-sep/calibration-ready, and it is written again only after a successful install. It names the target and the digests of the source, the IM4P, the seal, the trust bundle and the installed record.aurora-sep-ready.serviceand fprintd now also needaurora-sep-calibration-ready. That check re-reads the installed record without following links and compares its SHA-256 with the marker. A record changed later, or opened up to other users, is therefore not ready either.aurora-sep.servicestill starts for SEP trusted keys either way, so sensorless Macs are unaffected.FSCl Macs. When the factory cache has no FSC2 record, the carved FSCl
combrecord is installed as carved, as before. It now goes through the same replace-only-if-different, rollback and readiness path. It is checked only as far as the extractor checks it (no FSCl hardware here), and an FSCl record is never quarantined.Limits. These are provenance and structure checks. The enclave alone verifies the seal's signature chain and the sensor binding.
The same helper and gates ship in aurora-silicon/alarm-aurora#26 and aurora-silicon/fedora-aurora#28. In
modules/sep.nix,aurora-sep-readyandfprintdnow have bothsensor-presentandcalibration-readyasExecCondition.package.nixinstalls and wrapslibexec/aurora/calibration-ready.Testing
tests/test_sep_calibration.py): 35 tests, all on synthetic APFS images, manifests and records. They cover:nix buildandnix flake checkwere not run on this head.aurora-sep-calibration-readypassed.