1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Sealed / signed-system-volume validation (the analyzer side).
//!
//! Recomputes file-info content hashes and compares them to the seal, and flags
//! a set `im_broken_xid`. `APFS-SEALED-VOLUME-HASH-MISMATCH` (High — reported as
//! a hash-metadata mismatch, NOT "the system volume was modified", which is a
//! trust-chain conclusion for the examiner), `APFS-SEALED-VOLUME-BROKEN` (High).
//!
//! The exact canonicalization Apple hashes is the least-documented, highest-FP
//! area; this is validated ONLY against a real SSV image + apfsck, never a
//! synthetic seal we compute ourselves (Tier-3 trap). Implemented last (P8/P9).
use crateAnomalyKind;
/// Validate a sealed volume's integrity metadata.
///
/// Flags a recorded broken seal (`im_broken_xid != 0`). Per-file hash
/// recomputation vs the seal (`APFS-SEALED-VOLUME-HASH-MISMATCH`) is **not**
/// performed here: Apple's exact content-canonicalization is the least-documented
/// and highest-false-positive area, and the design requires validating it only
/// against a real Signed System Volume image + `apfsck` (never a synthetic seal
/// we compute ourselves — the Tier-3 trap). It is gated on such a fixture.
/// Pure sealed-volume audit logic (Humble Object: testable without an
/// `IntegrityMeta`). A non-zero `im_broken_xid` records that the seal was broken
/// at a known transaction — reported as an observation, not a "system volume was
/// modified" verdict (that trust-chain conclusion is for the examiner).