From 62d2dfe96abd2722283758f91d89274c3cae9f73 Mon Sep 17 00:00:00 2001 From: Matthew Jackson <1085847+MattJackson@users.noreply.github.com> Date: Thu, 25 Jun 2026 07:59:54 -0700 Subject: [PATCH] =?UTF-8?q?libfreemkv:=20align=20E7021=E2=86=92E7017=20in?= =?UTF-8?q?=20comments/test-names=20(keys-but-no-VID=20is=20AacsVidUnavail?= =?UTF-8?q?able)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/aacs/keys.rs | 6 +++--- src/disc/mod.rs | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/aacs/keys.rs b/src/aacs/keys.rs index e11ccec..4e2dcb7 100644 --- a/src/aacs/keys.rs +++ b/src/aacs/keys.rs @@ -1144,7 +1144,7 @@ pub enum ResolveFailure { /// Identical key derivation to the [`resolve_keys_v1`] / [`resolve_keys_v2`] / /// [`resolve_keys_v21`] chain (it calls straight through to them); the only /// addition is that an unresolved disc returns a typed [`ResolveFailure`] -/// instead of a bare `None`, so callers can report E7021 (material but no VID) +/// instead of a bare `None`, so callers can report E7017 (material but no VID) /// vs E7022 (no material). `version_u8` is the on-disc AACS major (1 → V10, /// anything else → the V20/V21 chain), matching `AacsState::version`. pub fn resolve_keys_with_reason( @@ -3172,7 +3172,7 @@ mod tests { // ── resolve_keys_with_reason / classify_resolve_failure ──────────────── // - // The rc.6 E7021/E7022 split is also exercised end-to-end through the + // The rc.6 E7017/E7022 split is also exercised end-to-end through the // `ensure_decryptable` gate in `disc/mod.rs`. These tests pin the // *classifier* directly at the keys.rs seam and cover the branches the // gate test does not: VID-present (must never be VidUnavailable), the @@ -3203,7 +3203,7 @@ mod tests { } /// Zero VID + PROCESSING keys (not device keys) is still "derivation - /// material present, VID missing" → VidUnavailable (E7021). The gate test + /// material present, VID missing" → VidUnavailable (E7017). The gate test /// only proves the device-keys arm of `has_derivation_material`; this pins /// the processing-keys arm of the same `||`. #[test] diff --git a/src/disc/mod.rs b/src/disc/mod.rs index 8f714ce..2e98f17 100644 --- a/src/disc/mod.rs +++ b/src/disc/mod.rs @@ -2048,7 +2048,7 @@ impl Disc { let needs_key = matches!(keys, crate::decrypt::DecryptKeys::None); if needs_key { if self.aacs.is_some() { - // E7021 vs E7022 split: when key resolution had derivation + // E7017 vs E7022 split: when key resolution had derivation // material (device / processing keys) but no Volume ID to derive // the unit key, the captured `aacs_error` is `AacsVidUnavailable` // — report THAT (the fix is recovering the VID, not adding keys), @@ -2278,7 +2278,7 @@ impl Disc { // stride; V20/V21 share the 64-byte stride, so try the classical V20 // paths first and fall back to the 2.1 variant chain. The // reason-preserving wrapper threads the no-key cause out so the - // decrypt gate can report E7021 (had derivation material but no VID) + // decrypt gate can report E7017 (had derivation material but no VID) // vs E7022 (no usable material) instead of a flat AacsKeyRejected. let resolved = crate::aacs::resolve_keys_with_reason(&ctx, version_u8) .map_err(|_reason| crate::error::Error::AacsKeyRejected)?; @@ -4003,15 +4003,15 @@ mod tests { ); } - /// E7021 vs E7022 split (rc.6 WS1). When key resolution HAD derivation + /// E7017 vs E7022 split (rc.6 WS1). When key resolution HAD derivation /// material (device / processing keys) but no Volume ID was available to /// derive the unit key, the captured `aacs_error` is `AacsVidUnavailable` - /// — the gate must surface THAT (E7021), not the generic `NoDiscKey` + /// — the gate must surface THAT (E7017), not the generic `NoDiscKey` /// (E7022). When there was no usable key material at all, the reason is /// absent and the gate keeps `NoDiscKey` (E7022). Both branches proven here. #[test] fn ensure_decryptable_aacs_vid_unavailable_vs_no_key() { - // Branch 1 — derivation material present, but no VID: E7021. + // Branch 1 — derivation material present, but no VID: E7017. // The resolver classifies a device-keys-but-zero-VID context as // `VidUnavailable`; that reason rides on `aacs_error`. let supplied = crate::aacs::provider::SuppliedKey { @@ -4045,17 +4045,17 @@ mod tests { "device keys + zero VID must classify as VidUnavailable" ); - let mut disc_e7021 = make_test_disc(1000, "UHD"); - disc_e7021.encrypted = true; - disc_e7021.aacs = Some(aacs_with(Vec::new())); // present but no unit keys - disc_e7021.aacs_error = Some(crate::error::Error::AacsVidUnavailable); - let err = disc_e7021 + let mut disc_e7017 = make_test_disc(1000, "UHD"); + disc_e7017.encrypted = true; + disc_e7017.aacs = Some(aacs_with(Vec::new())); // present but no unit keys + disc_e7017.aacs_error = Some(crate::error::Error::AacsVidUnavailable); + let err = disc_e7017 .ensure_decryptable(false) .expect_err("AACS disc, material-but-no-VID, !raw must error"); assert_eq!( err.code(), crate::error::Error::AacsVidUnavailable.code(), - "material-but-no-VID must surface E7021 (AacsVidUnavailable), not E7022" + "material-but-no-VID must surface E7017 (AacsVidUnavailable), not E7022" ); // Branch 2 — no key material at all: classified NoMaterial, gate E7022.