1.3.2: carry UnitKey.variant_number (all sources emit 0)

Construct unit keys via UnitKey::new; ordinary content is variant 0. Inherits libfreemkv 1.3.2. No behaviour change.
This commit is contained in:
Matthew Jackson
2026-07-10 14:00:28 -07:00
parent 46fecaeef1
commit 4f6029e4d4
6 changed files with 14 additions and 14 deletions
+1 -4
View File
@@ -184,10 +184,7 @@ impl KeydbSource {
// 1. Terminal Unit Keys stored in the entry — directly usable, no
// derivation. Preserve the keydb's CPS numbering (idx = num - 1).
for (num, key) in &entry.unit_keys {
keys.push(UnitKey {
idx: num.saturating_sub(1),
key: *key,
});
keys.push(UnitKey::new(num.saturating_sub(1), *key));
}
// The disc's encrypted title keys (from Unit_Key_RO.inf) — what every
+1 -4
View File
@@ -47,10 +47,7 @@ pub(crate) fn uks_from_vuk(vuk: &[u8; 16], enc_title_keys: &[[u8; 16]]) -> Vec<U
enc_title_keys
.iter()
.enumerate()
.map(|(i, e)| UnitKey {
idx: i as u32,
key: libfreemkv::aacs::derive::decrypt_unit_key(vuk, e),
})
.map(|(i, e)| UnitKey::new(i as u32, libfreemkv::aacs::derive::decrypt_unit_key(vuk, e)))
.collect()
}
+1 -1
View File
@@ -306,7 +306,7 @@ impl OnlineSource {
// A terminal UK is used directly (CPS unit 0 → committed cps 1, matching
// the old `Key::Unit(vec![(1, uk)])`).
if let Some(uk) = json.get("UK").and_then(|u| u.as_str()).and_then(parse_uk) {
return vec![UnitKey { idx: 0, key: uk }];
return vec![UnitKey::new(0, uk)];
}
// A VUK is derived to the terminal keys locally, via the disc's
// encrypted title keys from the context — the library owns the crypto.