reset: do not loop forever in C simulator
What changed, and why it matters
This is a tiny one-line fix for the software simulator used in development and automated testing. A previous change accidentally made the simulator's 'reboot' command spin in a busy loop instead of doing nothing, which caused simulator tests in a related Go project to hang. The patch simply skips the reboot call when the 'c-unit-testing' simulator feature is enabled. It does not affect real BitBox02 hardware or end-user security.
No security action required. Treat as a normal development/testing fix. Verify that simulator tests in bitbox02-api-go no longer hang during reset flows.
Security signals we found
No security-relevant code path changed on real hardware
Fix is in simulator/test-only configuration
No input validation, cryptography, memory safety, or privilege changes
No references to vulnerabilities, CVEs, or security researchers
Evidence from the diff
The reset() function in src/rust/bitbox02-rust/src/reset.rs calls hal.system().reboot() after resetting the secure chip and Bluetooth. Originally this call was gated by #[cfg(not(feature = “testing”))]. When the reboot implementation moved into the HAL, the C simulator build (feature “c-unit-testing”) started executing a busy-loop reboot implementation, causing simulator tests to hang forever. The patch expands the cfg guard to #[cfg(not(any(feature = “testing”, feature = “c-unit-testing”)))] so the simulator builds skip reboot, restoring the previous no-op behavior for test environments.
Changed components
src/rust/bitbox02-rust/src/reset.rsC simulator build (feature "c-unit-testing")bitbox02-api-go simulator testsInspect captured patch +1 / −1
diff --git a/src/rust/bitbox02-rust/src/reset.rs b/src/rust/bitbox02-rust/src/reset.rs
index ee4ea1f..2198ae1 100644
--- a/src/rust/bitbox02-rust/src/reset.rs
+++ b/src/rust/bitbox02-rust/src/reset.rs
@@ -64,7 +64,7 @@ pub(crate) async fn reset(hal: &mut impl crate::hal::Hal, status: bool) {
hal.system().reset_ble();
}
- #[cfg(not(feature = "testing"))]
+ #[cfg(not(any(feature = "testing", feature = "c-unit-testing")))]
hal.system().reboot();
}
Why this scored 17/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.