Rename to the generic Unlocker contract; add set_max_read_speed

Track libfreemkv's finalized 3-capability Unlocker trait:

  - unlock(...)   -> unlock_drive(...)
  - read_vid(...) -> read_volume_id(...)
  - add set_max_read_speed(...)

set_max_read_speed issues the matched profile's set_speed_max_cdb
(0xBB SET CD SPEED, to max) over the raw transport; a profile without a
set_speed_max_cdb (or no matching profile) is a no-op so the drive stays at
its current speed. read_disc_keys_cdb is left untouched — inert profile data,
never issued, no trait method.

README: document the 3-method contract, the delete-to-comply fallback, and the
#2-only boundary (freemkv uploads RAM microcode to an already-bootloader-flashed
drive; the permanent bootloader flash #1 is the owner's one-time manual step,
never automated). Left a marked MakeMKV attribution placeholder for the
maintainer to author.

Tests: renamed read_vid tests; added set_max_read_speed tests (issues the CDB
when present, no-op when the profile carries none).
This commit is contained in:
Matthew Jackson
2026-06-22 11:05:30 -07:00
parent d6d79fc74c
commit 47d5d1e0b9
2 changed files with 124 additions and 7 deletions
+28 -1
View File
@@ -20,4 +20,31 @@ That single line is the whole plug. Any drive whose identity matches a bundled
profile is firmware-unlocked at drive-prep; everything else falls through to
libfreemkv's host-certificate AACS handshake.
<!-- TODO(owner): add MakeMKV / LibreDrive attribution. -->
## The `Unlocker` contract
This crate is the LibreDrive unlocker — an implementation of libfreemkv's
`Unlocker` trait. The trait is a 3-method capability contract:
- `unlock_drive` — put the drive into extended-access mode. The one required
capability.
- `read_volume_id` — read the disc Volume ID directly, bypassing the AACS cert
handshake. `None` → libfreemkv falls back to the cert-based read. No-op
default.
- `set_max_read_speed` — raise the drive to its maximum read speed. No-op
default.
libfreemkv's AACS layer is the always-present baseline; it uses an unlocker's
capabilities when one matches, and does the full cert handshake when none do.
Remove this crate and libfreemkv still compiles and rips — every capability
falls back to the OEM/baseline path.
## Scope: RAM microcode only (`#2`), never the bootloader flash (`#1`)
freemkv uploads the RAM microcode to an **already-bootloader-flashed** drive.
The permanent bootloader flash (`#1`) is the drive owner's one-time manual
step; it is **never** automated by freemkv. This crate only performs the
non-persistent `#2` step — the microcode lives in RAM and is gone on power
cycle.
<!-- TODO(owner): MakeMKV attribution + thanks -->