remove redundant prints in loader

the first check should *never* print a message because an attacker
can trigger a glitch off of the UART. this eliminates the diagnostic
print on the first check.
This commit is contained in:
bunnie 2026-02-08 12:49:50 +08:00
parent 0bb693449b
commit c499087d5a
No known key found for this signature in database
2 changed files with 7 additions and 2 deletions

View file

@ -313,8 +313,7 @@ pub unsafe extern "C" fn rust_entry(signed_buffer: *const usize, signature: u32)
}
bao1x_hal::sigcheck::die_no_std();
} else {
println!("{}LOADER.KERNDEV,{}", BOOKEND_START, BOOKEND_END);
println!("Developer key detected on kernel. Proceeding in developer mode!");
// don't print anything on the first check, so a double-glitch is harder
}
}
csprng.random_delay();

View file

@ -279,6 +279,12 @@ impl SwapHal {
);
bao1x_hal::sigcheck::die_no_std();
} else {
bollard!(bao1x_hal::sigcheck::die_no_std, 4);
// check if it's still 0 - force a double-glitch
if owc.get(bao1x_api::DEVELOPER_MODE).unwrap() == 0 {
bao1x_hal::sigcheck::die_no_std();
}
bollard!(bao1x_hal::sigcheck::die_no_std, 4);
println!("{}LOADER.SWAPDEV,{}", BOOKEND_START, BOOKEND_END);
println!(
"Developer key detected on swap. Proceeding in developer mode!"