simulator: persist securechip type in fake memory
What changed, and why it matters
This change only affects the BitBox02 firmware simulator's fake memory test helper. It makes the simulator persist the securechip type in fake memory so it survives resets, rather than just setting it temporarily in RAM. There is no indication this affects real hardware or user funds, and no security relevance is stated.
No security action required. Treat as routine test infrastructure maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/hardware-fakes/src/fake_memory.c in the fake_memory_nova() test helper. Previously it directly mutated a pointer into _memory_shared_data. Now it reads existing shared bootdata, sets platform and securechip_type fields, and writes the result back via memory_write_to_address_fake(). This is a test-only simulator change to make the securechip type persistent across simulated operations. No production firmware, cryptographic operations, or real secure chip behavior is changed.
Changed components
test/hardware-fakes/src/fake_memory.csimulator fake memory helperInspect captured patch +7 / −3
diff --git a/test/hardware-fakes/src/fake_memory.c b/test/hardware-fakes/src/fake_memory.c
index 572ed3b..68a1700 100644
--- a/test/hardware-fakes/src/fake_memory.c
+++ b/test/hardware-fakes/src/fake_memory.c
@@ -68,9 +68,13 @@ void fake_memory_factoryreset(void)
bool fake_memory_nova(void)
{
- chunk_shared_t* shared_ptr = (chunk_shared_t*)&_memory_shared_data[0];
- shared_ptr->fields.platform = MEMORY_PLATFORM_BITBOX02_PLUS;
- shared_ptr->fields.securechip_type = MEMORY_SECURECHIP_TYPE_OPTIGA;
+ chunk_shared_t shared = {0};
+ memory_read_shared_bootdata_fake(shared.bytes);
+ shared.fields.platform = MEMORY_PLATFORM_BITBOX02_PLUS;
+ shared.fields.securechip_type = MEMORY_SECURECHIP_TYPE_OPTIGA;
+ if (!memory_write_to_address_fake(FLASH_SHARED_DATA_START, 0, shared.bytes)) {
+ return false;
+ }
memory_ble_metadata_t ble_metadata = {0};
memcpy(ble_metadata.allowed_firmware_hash, ALLOWED_HASH, sizeof(ALLOWED_HASH) - 1);
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.