aacs: handshake primitives operate on &mut dyn ScsiTransport

The AACS cert-auth primitives (aacs_authenticate, the AACS 2.0 P-256
variants, read_volume_id, read_data_keys) and their scsi_read/scsi_write
helpers touched the drive ONLY through Drive::scsi_execute — a pure
pass-through to the transport. Thread &mut dyn ScsiTransport instead of
&mut Drive so these primitives are transport-level, matching the firmware
Unlocker seam (which hands out &mut dyn ScsiTransport for testability).
Pure mechanical signature change, no logic change; the cert orchestrator
(do_handshake_cert) keeps &mut Drive for the OEM-VID shortcut and passes
session.scsi_mut() into the primitives. Step toward making the cert
handshake a uniform registry unlocker.
This commit is contained in:
Matthew Jackson
2026-06-29 15:47:30 -07:00
parent 93fbfac6f0
commit f682405973
2 changed files with 34 additions and 26 deletions
+21 -15
View File
@@ -118,23 +118,29 @@ impl AacsCertUnlocker<'_> {
if idx > 0 {
std::thread::sleep(std::time::Duration::from_millis(PER_CERT_BACKOFF_MS));
}
match aacs::handshake::aacs_authenticate(session, &hc.private_key, &hc.certificate) {
match aacs::handshake::aacs_authenticate(
session.scsi_mut(),
&hc.private_key,
&hc.certificate,
) {
Ok(mut auth) => {
let volume_id = match aacs::handshake::read_volume_id(session, &mut auth) {
Ok(vid) => vid,
Err(e) => {
tracing::warn!(
target: "freemkv::disc",
phase = "handshake_vid_read_failed",
cert_index = idx,
error_code = e.code(),
"auth ok but volume ID read failed"
);
return Err(UnlockError::VidUnavailable);
}
};
let volume_id =
match aacs::handshake::read_volume_id(session.scsi_mut(), &mut auth) {
Ok(vid) => vid,
Err(e) => {
tracing::warn!(
target: "freemkv::disc",
phase = "handshake_vid_read_failed",
cert_index = idx,
error_code = e.code(),
"auth ok but volume ID read failed"
);
return Err(UnlockError::VidUnavailable);
}
};
let (read_data_key, read_data_key_err) = match aacs::handshake::read_data_keys(
session, &mut auth,
session.scsi_mut(),
&mut auth,
) {
Ok((rdk, _)) => (Some(rdk), None),
Err(e) => {