From 54508d8ec26d6f988e8a3b0ab22c4fe775c46645 Mon Sep 17 00:00:00 2001 From: Matthew Jackson <1085847+MattJackson@users.noreply.github.com> Date: Mon, 28 Sep 2026 06:28:47 -0700 Subject: [PATCH] KU-E1 review minor 4 red: partial stored keys plus a Km still report NoVid A keydb entry with stored unit keys for some CPS units and a Media Key but no VID returns the stored keys with an empty miss path, so resolve cannot tell that the VID would derive the rest (J23). --- src/keydb.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/keydb.rs b/src/keydb.rs index a8f88e6..ff37c03 100644 --- a/src/keydb.rs +++ b/src/keydb.rs @@ -792,6 +792,19 @@ mod tests { assert!(!shape.vid_available); } + // KU J23: stored unit keys for SOME CPS units plus a Media Key with no VID. The stored + // keys come back, and the miss path still says `NoVid`: the VID would derive the rest. + #[test] + fn partial_stored_keys_with_a_media_key_and_no_vid_report_no_vid() { + let mut e = blank_entry(HASH); + e.media_key = Some([0x33u8; 16]); + e.unit_keys = vec![(1, [0x55u8; 16])]; + let db = db_with(e, Vec::new()); + let r = KeydbSource::resolve_from(&db, &ctx(HASH, vec![[0x44u8; 16]; 2], None)); + assert_eq!(r.keys.len(), 1, "the stored key"); + assert_eq!(r.miss_path, vec![KeyNode::NoVid]); + } + // A hash that is NOT in the keydb is the one true miss: not matched, no // shape, no miss path (the library renders this as `no entry`). #[test]