0.27.5 (step 2, Phase 1): expose AACS inputs (uk_ro, mkb) on AacsState
scan now stashes the raw Unit_Key_RO.inf + MKB bytes on AacsState (via resolve_vid_only, the disable_keydb path), so an external key-resolver can derive unit keys from a resolved VUK without re-reading the disc — the foundation for moving lookup/derivation out of libfreemkv. Additive: the keydb path is untouched, all existing constructors default the new fields empty. 584 lib tests green. Builds on the KeyOrigin rename + the Key/decrypt_with API.
This commit is contained in:
+12
-1
@@ -893,6 +893,13 @@ pub struct AacsState {
|
||||
pub read_data_key: Option<[u8; 16]>,
|
||||
/// Volume ID (16 bytes) -- from SCSI handshake
|
||||
pub volume_id: [u8; 16],
|
||||
/// Raw `Unit_Key_RO.inf` bytes (encrypted unit keys + CPS map). Stashed at
|
||||
/// scan so an external resolver (key-resolver) can derive the unit keys
|
||||
/// from a VUK without re-reading the disc. Empty when not captured.
|
||||
pub uk_ro: Vec<u8>,
|
||||
/// Raw MKB bytes (`MKB_RO.inf`). Stashed at scan so an external resolver can
|
||||
/// walk it (device/processing key → media key). Empty when not captured.
|
||||
pub mkb: Vec<u8>,
|
||||
}
|
||||
|
||||
/// How AACS keys were resolved. Variants are ordered root-of-trust →
|
||||
@@ -1555,7 +1562,9 @@ impl Disc {
|
||||
unit_keys: keys,
|
||||
read_data_key: None,
|
||||
volume_id: [0u8; 16],
|
||||
});
|
||||
uk_ro: Vec::new(),
|
||||
mkb: Vec::new(),
|
||||
});
|
||||
// The prior resolution error (e.g. KeydbLoad) is now moot — we have
|
||||
// the decryption key. Clear it so callers don't treat the disc as
|
||||
// keyless on the stale error.
|
||||
@@ -2833,6 +2842,8 @@ mod tests {
|
||||
unit_keys,
|
||||
read_data_key: None,
|
||||
volume_id: [0u8; 16],
|
||||
uk_ro: Vec::new(),
|
||||
mkb: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user