feat(core/bootloader_emu): report secmon verification and code alignment with -p [no changelog]
What changed, and why it matters
This commit adds diagnostic output to the Trezor bootloader emulator. When run with a special flag, it now prints two extra pieces of information: whether the bootloader expects a 'secure monitor' component in firmware images, and what memory alignment it requires for firmware code. This is purely a testing/debugging convenience for the emulator and does not change how real devices verify or load firmware.
No security action required. Treat as a normal feature/test-harness improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change extends print_properties() in core/embed/projects/bootloader/emulator.c to include CODE_ALIGNMENT and a USE_SECMON_VERIFICATION boolean in the JSON printed by the bootloader emulator’s -p option. It is an instrumentation-only change to the emulator’s property-reporting output; no verification logic, parsing, memory layout, or cryptographic checks are modified.
Changed components
core/embed/projects/bootloader/emulator.cbootloader emulator property-reporting outputInspect captured patch +8 / −1
### core/embed/projects/bootloader/emulator.c
@@ -141,7 +141,14 @@ bool preload_firmware_image(const char *filename) {
// model and where the storage areas sit inside it. Works from the sector
// layout alone, before the flash file is mapped.
static void print_properties(void) {
- printf("{\"model\": \"%s\", \"storage_areas\": [", MODEL_INTERNAL_NAME);
+#ifdef USE_SECMON_VERIFICATION
+ const char *secmon = "true";
+#else
+ const char *secmon = "false";
+#endif
+ printf("{\"model\": \"%s\", \"code_alignment\": %u, ", MODEL_INTERNAL_NAME,
+ (unsigned)CODE_ALIGNMENT);
+ printf("\"secmon_verification\": %s, \"storage_areas\": [", secmon);
for (size_t i = 0; i < ARRAY_LENGTH(STORAGE_AREAS); i++) {
// storage areas are single subareas, see storage_empty()
const flash_area_t *area = &STORAGE_AREAS[i];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.