security-relevant: modify collateral test to not panic on failure

The panic on failure causes incompatibility with older boot0's
that don't set up the collateral area correctly.

Make the failure more graceful, but we also promise ourselves
to add CI tests to check for this explicitly, because we can't
just rely on panics to enforce behavior.
This commit is contained in:
bunnie 2026-01-30 04:01:09 +08:00
parent 5e4a7ae38b
commit b1121daef6

View file

@ -19,7 +19,8 @@ pub fn keystore(sid: SID) -> ! {
if store.is_collateral_erased() {
log::info!("{}COLLATERAL.ERASED,{}", BOOKEND_START, BOOKEND_END);
} else {
panic!("Collateral is not erased - protocol error for Baochip firmwares!");
log::error!("Collateral is not erased - protocol error for Baochip firmwares!");
log::info!("{}COLLATERAL.FAIL,{}", BOOKEND_START, BOOKEND_END);
}
let mut msg_opt = None;