unlock: Unlocked carries the bus-key gate nuance; route_unlock returns it

Extend Unlocked with drive_unlocked + read_data_key_err so the registry result
carries everything the downstream bus-key gate needs — a firmware unlocker sets
drive_unlocked=true (bus encryption removed at the drive, no bus key), the cert
route will set read_data_key (+ read_data_key_err on a failed bus-key read).
route_unlock now returns the full Unlocked rather than just a Vid, so a single
dispatch can fold the firmware, cert, and CSS results uniformly. Prep for the
AACS cert handshake becoming a registry unlocker.
This commit is contained in:
Matthew Jackson
2026-06-29 16:59:04 -07:00
parent bac105a022
commit 326d17c2f4
2 changed files with 25 additions and 14 deletions
+7 -4
View File
@@ -418,11 +418,14 @@ impl Drive {
);
self.init_ran = true;
let r = match r {
Ok(Some((name, vid))) => {
Ok(Some((name, unlocked))) => {
self.unlocker_name = Some(name);
// Stash the OEM Volume ID the unlocker returned for the AACS
// handshake phase (do_handshake reads it via `oem_vid()`).
self.oem_vid = Some(vid.0);
// Stash the OEM Volume ID the firmware unlocker returned for the
// AACS handshake phase (do_handshake reads it via `oem_vid()`).
// A drive-prep unlocker always carries a VID; guard anyway.
if let Some(vid) = unlocked.vid {
self.oem_vid = Some(vid.0);
}
// The matched unlocker may also be able to raise the drive to
// its maximum read speed. Best-effort: a failure here must NOT
// fail the rip — a slow drive still rips. Log and continue.