What changed, and why it matters
This commit fixes a test-only simulator feature so that a command-line flag called --preseed actually loads a known test wallet. It only changes test/simulator code, not the real BitBox02/BitBox03 firmware that runs on the hardware wallet. There is no security-relevant change to production code.
No security action required. Treat as a normal test-harness bug fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch re-enables previously commented-out code in test/simulator-graphical-bb03/src/main.rs that encrypts and stores a hard-coded BIP-39 mnemonic seed when the simulator is launched with –preseed. It imports Memory and block_on, removes the underscore from the _bitbox parameter, and calls encrypt_and_store_seed followed by set_initialized. The change is confined to the graphical simulator test harness and does not alter firmware, keystore, or cryptographic logic used by real devices.
Changed components
test/simulator-graphical-bb03/src/main.rsInspect captured patch +10 / −7
diff --git a/test/simulator-graphical-bb03/src/main.rs b/test/simulator-graphical-bb03/src/main.rs
index 59237b5..f4a7a89 100644
--- a/test/simulator-graphical-bb03/src/main.rs
+++ b/test/simulator-graphical-bb03/src/main.rs
@@ -42,10 +42,11 @@ use glutin_winit::DisplayBuilder;
use tracing::{debug, error, info};
use tracing_subscriber::{EnvFilter, filter::LevelFilter, fmt, prelude::*};
-use bitbox_hal::{Hal, system::System};
+use bitbox_hal::{Hal, Memory, system::System};
use bitbox03::io::touchscreen::{TouchScreen, TouchScreenEvent};
use hal::BitBox03;
+use util::bb02_async::block_on;
use bitbox_lvgl as lvgl;
use lvgl::LvDisplayRenderMode;
@@ -204,7 +205,7 @@ fn my_flush_cb(display: lvgl::LvDisplay, _area: &lvgl::LvArea, _px_map: *mut u8)
}
fn init_hww(
- _bitbox: &mut BitBox03,
+ bitbox: &mut BitBox03,
preseed: bool,
) -> Option<bitbox02_rust::hww::transport::HwwTransport<BitBox03>> {
//bitbox02::screen::init(pixel_fn, mirror_fn, clear_fn);
@@ -228,11 +229,13 @@ fn init_hww(
info!("Memory setup: success");
if preseed {
- //let mnemonic = "boring mistake dish oyster truth pigeon viable emerge sort crash wire portion cannon couple enact box walk height pull today solid off enable tide";
- //let seed = bitbox02_rust::bip39::mnemonic_to_seed(&mnemonic).unwrap();
- //let mut hal = bitbox03::hal::BitBox02Hal::new();
- //bitbox02_rust::keystore::encrypt_and_store_seed(&mut hal, &seed, "").unwrap();
- //bitbox.memory().set_initialized().unwrap();
+ let mnemonic = "boring mistake dish oyster truth pigeon viable emerge sort crash wire portion cannon couple enact box walk height pull today solid off enable tide";
+ let seed = bitbox02_rust::bip39::mnemonic_to_seed(mnemonic).unwrap();
+ block_on(bitbox02_rust::keystore::encrypt_and_store_seed(
+ bitbox, &seed, "",
+ ))
+ .unwrap();
+ bitbox.memory().set_initialized().unwrap();
}
Some(bitbox02_rust::hww::transport::hww_transport::<BitBox03>())
Why this scored 15/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.