mirror of
https://github.com/freemkv/freemkv-unlock.git
synced 2026-10-07 18:13:11 +00:00
f0d936f4b69cf75e7d3bfac4ea0d206a27c8929f
Both are API renames rather than behaviour changes, but this is the AACS and CSS crypto path, so it is verified by output rather than by the fact that it compiles. rand: `RngCore` no longer sits at the crate root -- `fill_bytes` moved to the re-exported `Rng` trait -- and `thread_rng()` is now `rng()`. aes: the cipher traits gained their `BlockCipher` prefix and `generic_array::GenericArray` became `Array`. The obvious translation uses `Array::from_slice`, which is deprecated in the new version and would fail clippy's `-D warnings`; these use the `From<[T; N]>` conversion the crate points at instead. The proof this is byte-exact is `test_aes_cmac_nist_kat_full_block`, which checks the exact MAC from NIST SP 800-38B Appendix D.1 -- a wrong byte order or a mis-sized array cannot produce that value. All 95 tests pass in both debug and release.
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%