mirror of
https://github.com/freemkv/freemkv-unlock.git
synced 2026-10-07 18:13:11 +00:00
freemkv-unlock: de-expose HRL wipe-once — deferred, removed from public ABI
Remove the HRL_WIPE_ONCE const, the wipe_hrl_once() setter, and their tests/doc references from the host library so wipe-once is no longer part of the host-facing firmware ABI. HRL exposes only skip (0x01).
This commit is contained in:
+3
-14
@@ -79,10 +79,6 @@ pub const STATE_ON: u8 = 0x01;
|
||||
/// Any other non-passthrough value is treated as an explicit speed-cap byte.
|
||||
pub const SPEED_MAX: u8 = 0x01;
|
||||
|
||||
/// [`Feature::Hrl`] state: one-time PERMANENT wipe of the flash HRL to
|
||||
/// valid-empty. Destructive; NOT undone by [`Verb::Reset`]. `0x02`.
|
||||
pub const HRL_WIPE_ONCE: u8 = 0x02;
|
||||
|
||||
/// [`Feature::Bd`] state: force-refuse BD (AACS 1.0) discs (`0x02`). A distinct
|
||||
/// sentinel — NOT [`STATE_OFF`] (`0x00`, the SRAM boot value) — so an unarmed image
|
||||
/// leaves BD engaged (OEM). Mirrors the firmware ABI `STATE_BD_DISABLE`.
|
||||
@@ -133,8 +129,8 @@ pub enum Feature {
|
||||
/// force-refuse BD discs; passthrough/`0x00` boot/[`STATE_ON`] = OEM (engaged —
|
||||
/// the enable direction is a no-op, OEM already engages BD).
|
||||
Bd = 0x04,
|
||||
/// Host Revocation List handling. [`STATE_ON`] = skip lookup;
|
||||
/// [`HRL_WIPE_ONCE`] = one-time permanent wipe.
|
||||
/// Host Revocation List handling. [`STATE_ON`] = skip lookup (revoked certs
|
||||
/// accepted, non-destructive).
|
||||
Hrl = 0x05,
|
||||
/// Drive-host AKE. [`STATE_ON`] = null (drive acts pre-authenticated).
|
||||
Ake = 0x06,
|
||||
@@ -487,8 +483,7 @@ impl<'a> FirmwareControl<'a> {
|
||||
self.exec_none(&cdb)
|
||||
}
|
||||
|
||||
/// Restore every feature to [`STATE_PASSTHROUGH`] (RESET). NOTE: a prior
|
||||
/// [`Feature::Hrl`] wipe-once is destructive and NOT undone by this.
|
||||
/// Restore every feature to [`STATE_PASSTHROUGH`] (RESET).
|
||||
pub fn reset(&mut self) -> Result<()> {
|
||||
let cdb = build_reset_cdb();
|
||||
self.exec_none(&cdb)
|
||||
@@ -552,11 +547,6 @@ impl<'a> FirmwareControl<'a> {
|
||||
pub fn skip_hrl(&mut self) -> Result<()> {
|
||||
self.set(Feature::Hrl, STATE_ON)
|
||||
}
|
||||
/// One-time PERMANENT flash wipe of the HRL to valid-empty. Destructive and
|
||||
/// NOT undone by [`FirmwareControl::reset`].
|
||||
pub fn wipe_hrl_once(&mut self) -> Result<()> {
|
||||
self.set(Feature::Hrl, HRL_WIPE_ONCE)
|
||||
}
|
||||
/// Null the drive-host AKE (drive acts pre-authenticated).
|
||||
pub fn null_ake(&mut self) -> Result<()> {
|
||||
self.set(Feature::Ake, STATE_ON)
|
||||
@@ -632,7 +622,6 @@ impl<'a> FirmwareControl<'a> {
|
||||
///
|
||||
/// Issues RESET (every feature → passthrough) and verifies each feature read
|
||||
/// back as [`STATE_PASSTHROUGH`]. Rips: nothing — this DISARMS the drive.
|
||||
/// (A prior `wipe_hrl_once` is destructive and is NOT restored.)
|
||||
pub fn arm_stealth_oem(&mut self) -> Result<()> {
|
||||
self.reset()?;
|
||||
for feature in ALL_FEATURES {
|
||||
|
||||
@@ -38,7 +38,6 @@ fn state_and_frame_constants_match_abi() {
|
||||
assert_eq!(STATE_OFF, 0x00);
|
||||
assert_eq!(STATE_ON, 0x01);
|
||||
assert_eq!(SPEED_MAX, 0x01);
|
||||
assert_eq!(HRL_WIPE_ONCE, 0x02);
|
||||
assert_eq!(STATE_BD_DISABLE, 0x02);
|
||||
assert_eq!([REGION_BD_A, REGION_BD_B, REGION_BD_C], [0x2A, 0x2B, 0x2C]);
|
||||
assert_eq!(REGION_DVD_BASE, 0x10);
|
||||
@@ -340,7 +339,6 @@ fn typed_setters_issue_expected_set_cdbs() {
|
||||
fw.enable_uhd().unwrap();
|
||||
fw.disable_bd().unwrap();
|
||||
fw.skip_hrl().unwrap();
|
||||
fw.wipe_hrl_once().unwrap();
|
||||
fw.null_ake().unwrap();
|
||||
fw.bus_off().unwrap();
|
||||
fw.region_free().unwrap();
|
||||
@@ -351,13 +349,12 @@ fn typed_setters_issue_expected_set_cdbs() {
|
||||
assert_eq!(m.cdbs[0], build_set_cdb(Feature::Uhd, STATE_ON));
|
||||
assert_eq!(m.cdbs[1], build_set_cdb(Feature::Bd, STATE_BD_DISABLE));
|
||||
assert_eq!(m.cdbs[2], build_set_cdb(Feature::Hrl, STATE_ON));
|
||||
assert_eq!(m.cdbs[3], build_set_cdb(Feature::Hrl, HRL_WIPE_ONCE));
|
||||
assert_eq!(m.cdbs[4], build_set_cdb(Feature::Ake, STATE_ON));
|
||||
assert_eq!(m.cdbs[5], build_set_cdb(Feature::Bus, STATE_ON));
|
||||
assert_eq!(m.cdbs[6], build_set_cdb(Feature::Region, STATE_ON));
|
||||
assert_eq!(m.cdbs[7], build_set_cdb(Feature::Region, REGION_BD_B));
|
||||
assert_eq!(m.cdbs[8], build_set_cdb(Feature::Region, 0x12));
|
||||
assert_eq!(m.cdbs[9], build_set_cdb(Feature::Speed, SPEED_MAX));
|
||||
assert_eq!(m.cdbs[3], build_set_cdb(Feature::Ake, STATE_ON));
|
||||
assert_eq!(m.cdbs[4], build_set_cdb(Feature::Bus, STATE_ON));
|
||||
assert_eq!(m.cdbs[5], build_set_cdb(Feature::Region, STATE_ON));
|
||||
assert_eq!(m.cdbs[6], build_set_cdb(Feature::Region, REGION_BD_B));
|
||||
assert_eq!(m.cdbs[7], build_set_cdb(Feature::Region, 0x12));
|
||||
assert_eq!(m.cdbs[8], build_set_cdb(Feature::Speed, SPEED_MAX));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user