Adapt keydb test to segregated decrypt primitives; 1.4.2 changelog
The KEYDB-gated test that feeds real key material into libfreemkv's AACS crypto now composes decrypt_unit + is_clean (the removed decrypt_unit_try_keys wrapper's behaviour), unchanged semantics.
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.4.2] — 2026-07-15
|
||||||
|
|
||||||
|
Version sync with the workspace; inherits libfreemkv 1.4.2. The keydb test that
|
||||||
|
feeds real key material into the AACS crypto was adapted to the segregated
|
||||||
|
`decrypt_unit` + `is_clean` primitives (behaviour unchanged).
|
||||||
|
|
||||||
## [1.4.1] — 2026-07-14
|
## [1.4.1] — 2026-07-14
|
||||||
|
|
||||||
Version sync with the workspace; inherits libfreemkv 1.4.1.
|
Version sync with the workspace; inherits libfreemkv 1.4.1.
|
||||||
|
|||||||
+9
-9
@@ -1412,7 +1412,7 @@ mod tests {
|
|||||||
//
|
//
|
||||||
// These exercise the parser (KeyDb::load) end-to-end against a real
|
// These exercise the parser (KeyDb::load) end-to-end against a real
|
||||||
// keydb.cfg and feed its material into libfreemkv's AACS crypto
|
// keydb.cfg and feed its material into libfreemkv's AACS crypto
|
||||||
// (derive_vuk / decrypt_unit_try_keys). They live here now that the
|
// (derive_vuk, then decrypt_unit + is_clean_ts). They live here now that the
|
||||||
// parser lives here. All are KEYDB_PATH-env-gated and no-op in CI when
|
// parser lives here. All are KEYDB_PATH-env-gated and no-op in CI when
|
||||||
// the env is unset; they must still COMPILE.
|
// the env is unset; they must still COMPILE.
|
||||||
// ════════════════════════════════════════════════════════════════════
|
// ════════════════════════════════════════════════════════════════════
|
||||||
@@ -1485,22 +1485,22 @@ mod tests {
|
|||||||
|
|
||||||
eprintln!("Found {} entries with unit keys", candidate_entries.len());
|
eprintln!("Found {} entries with unit keys", candidate_entries.len());
|
||||||
|
|
||||||
// Try each entry's unit keys
|
// Try each entry's unit keys: apply the key, then ask whether it opened
|
||||||
|
// the unit (the segregated primitives — decrypt, then structural check).
|
||||||
for entry in &candidate_entries {
|
for entry in &candidate_entries {
|
||||||
let keys: Vec<[u8; 16]> = entry.unit_keys.iter().map(|(_, k)| *k).collect();
|
for (_, key) in &entry.unit_keys {
|
||||||
let mut unit = original.clone();
|
let mut unit = original.clone();
|
||||||
|
libfreemkv::aacs::content::decrypt_unit(&mut unit, key);
|
||||||
if let Some(res) = libfreemkv::aacs::content::decrypt_unit_try_keys(&mut unit, &keys) {
|
if libfreemkv::aacs::content::is_clean(&unit, libfreemkv::disc::ContentFormat::BdTs)
|
||||||
eprintln!(
|
{
|
||||||
"SUCCESS: Decrypted with entry {} ({res:?})",
|
eprintln!("SUCCESS: Decrypted with entry {}", entry.disc_hash);
|
||||||
entry.disc_hash
|
|
||||||
);
|
|
||||||
// Count TS sync bytes
|
// Count TS sync bytes
|
||||||
let ts = (0..32).filter(|&i| unit[4 + i * 192] == 0x47).count();
|
let ts = (0..32).filter(|&i| unit[4 + i * 192] == 0x47).count();
|
||||||
eprintln!(" TS sync bytes: {}/32", ts);
|
eprintln!(" TS sync bytes: {}/32", ts);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Expected: none work because this is AACS 2.0 and needs bus decryption first
|
// Expected: none work because this is AACS 2.0 and needs bus decryption first
|
||||||
eprintln!("No unit key worked (expected for AACS 2.0 BEE disc — needs read_data_key)");
|
eprintln!("No unit key worked (expected for AACS 2.0 BEE disc — needs read_data_key)");
|
||||||
|
|||||||
Reference in New Issue
Block a user