Skip to content

Commit

Permalink
Revert "security: Only show prompt when unlocking"
Browse files Browse the repository at this point in the history
This reverts commit 771911a.

The EC will already be set to unlocked at this point, so the prompt
must be run even when in the "Unlock" state. This is fine, as the
prompt is for physical present detection.

Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
crawfxrd committed Jul 8, 2024
1 parent 1dc803d commit af694ec
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/security.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,18 @@ extern "efiapi" fn run() -> bool {
}
};

debugln!("security state: {:?}", security_state);
// The EC will already be set to unlocked at this point, so the prompt
// must be run even when in the "Unlock" state. This is fine, as the
// prompt is for physical present detection.

// Only show prompt when unlocking
if security_state != SecurityState::PrepareUnlock {
debugln!("security state: {:?}", security_state);
if security_state == SecurityState::Lock {
// Already locked, so do not confirm
return false;
}

// Not locked, require confirmation

let res = match Output::one() {
Ok(output) => {
let mut display = Display::new(output);
Expand Down

0 comments on commit af694ec

Please sign in to comment.