mirror of
https://github.com/freemkv/freemkv-unlock.git
synced 2026-10-07 18:13:11 +00:00
b3d1b9946028a69297b6a7d08a3b2f29f6a049ed
Extends the fake ScsiTransport in css::mod to run the full CSS bus-auth happy path (variant brute-force, drive-challenge/Key2 exchange, best-effort disc-key REPORT KEY, DvdUnlocker::unlock_bus success) instead of only its failure branches. Covers mt1959's run_init retry loop (signature-mismatch abort, generic do_unlock failure with firmware-reload fallback, firmware-reload transport fault), run_probe's disc-type detection (capacity sense fallback, UHD vs BD init address, pass-2 early-end on a rejected probe), and the PlatformDriver guard clauses. Covers aacs/handshake's EC math edge cases (mod_inv/ec_add/ec_double/ec_mul defensive branches, off-curve pubkey rejection), the Debug redaction impls, the AACS 1.0 type-0x01 cert-verify gate, the P-256 thin wrapper + short-cert guard + step-6 bad-signature rejection, and drives run_cert_handshake to its full Ok(CertHandshake) success path via an extended drive emulator.
freemkv-unlock
The unlock layer for the freemkv toolchain.
An unlocker removes a drive-level bus-encryption barrier so the drive serves readable (de-bus'd / de-scrambled) sectors. Content-key decryption is a separate concern — the consumer's job.
This crate defines the Unlocker contract and a generic SCSI transport
contract, and holds the self-contained unlocker modules. The consumer
(libfreemkv) depends on this crate and
dispatches through all_unlockers(); it never names an individual unlocker, and
clients of libfreemkv are oblivious to unlockers entirely (as they are to the
SCSI layer).
use freemkv_unlock::UnlockError;
// Drive-prep: try each unlocker's feature unlock until one claims the drive.
// `NotApplicable` means "not this unlocker's drive" — move on; a transport
// error means a dead bus — abort. `unlock_bus` follows the same contract for
// removing per-disc bus encryption.
for u in freemkv_unlock::all_unlockers() {
match u.unlock_features(&mut scsi, &ctx) {
Ok(unlocked) => return Ok(unlocked),
Err(UnlockError::NotApplicable) => continue,
Err(e) => return Err(e),
}
}
To remove an unlocker, delete its module directory and its one line in
all_unlockers() — nothing else changes.
License: MIT.
Languages
Rust
100%