From 26636561f5086e9e1edeae6411f7597ddaeb5f97 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 18 Jan 2026 02:52:42 +0800 Subject: [PATCH] add collateral check to audit --- bao1x-boot/boot1/src/repl.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bao1x-boot/boot1/src/repl.rs b/bao1x-boot/boot1/src/repl.rs index 09f6e3080..aa7c564cf 100644 --- a/bao1x-boot/boot1/src/repl.rs +++ b/bao1x-boot/boot1/src/repl.rs @@ -449,6 +449,15 @@ impl Repl { crate::println!("Factory configuration error - CM7 or debug is enabled!"); secure = false; } + let collateral = slot_mgr.read(&COLLATERAL).unwrap(); + let check_val = + alloc::vec![bao1x_hal::sigcheck::ERASE_VALUE; COLLATERAL.len() * SLOT_ELEMENT_LEN_BYTES]; + if collateral == &check_val { + crate::println!("Collateral erased"); + } else { + crate::println!("Collateral is set"); + } + if !secure { crate::println!("** System did not meet minimum requirements for security **"); }