feat(nordic): add model identifier as a protected TLV into app image
What changed, and why it matters
This commit adds a numeric model identifier for a specific Trezor hardware board (the T3W1 revision A with Nordic nRF52832 chip) into the firmware signing process as a protected custom TLV field. It is a feature addition that embeds device-model metadata into signed firmware images. There is no indication in the commit that it fixes a security bug or introduces a vulnerability.
No security action required. Treat as a normal firmware feature commit. If reviewing broader firmware signing design, verify that the new protected TLV is validated by the bootloader and that the model identifier cannot be reused across incompatible hardware revisions.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change introduces a Kconfig option CONFIG_MODEL_IDENTIFIER across three Nordic/Zephyr apps (direct_test_mode, radio_test, trezor-ble) and sets it to 827798356 for the t3w1_revA_nrf52832 board. The build_sign_flash.sh script then injects the fixed hex value 0x54335731 (‘T3W1’ in ASCII) as a protected custom TLV (tag 0x00A3) into both .bin and .hex images during MCUboot imgtool signing. This is a metadata/hardening feature, not a patch for an exploitable flaw.
Changed components
nordic/trezor/boards/arm/t3w1_revA_nrf52832/t3w1_revA_nrf52832_defconfignordic/trezor/direct_test_mode/Kconfignordic/trezor/radio_test/Kconfignordic/trezor/trezor-ble/Kconfignordic/trezor/scripts/build_sign_flash.shInspect captured patch +14 / −2
diff --git a/nordic/trezor/boards/arm/t3w1_revA_nrf52832/t3w1_revA_nrf52832_defconfig b/nordic/trezor/boards/arm/t3w1_revA_nrf52832/t3w1_revA_nrf52832_defconfig
index 775cead9..e24ebe2a 100644
--- a/nordic/trezor/boards/arm/t3w1_revA_nrf52832/t3w1_revA_nrf52832_defconfig
+++ b/nordic/trezor/boards/arm/t3w1_revA_nrf52832/t3w1_revA_nrf52832_defconfig
@@ -13,3 +13,5 @@ CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_PINCTRL=y
+
+CONFIG_MODEL_IDENTIFIER=827798356
diff --git a/nordic/trezor/direct_test_mode/Kconfig b/nordic/trezor/direct_test_mode/Kconfig
index f7763dcd..a4bb2f9c 100644
--- a/nordic/trezor/direct_test_mode/Kconfig
+++ b/nordic/trezor/direct_test_mode/Kconfig
@@ -96,6 +96,9 @@ config DTM_FAST_RAMP_UP
Do fast ramp up when starting the radio peripheral. This mode will significancy reduce
the ramp up time and makes it almost the same on all supported chips.
+config MODEL_IDENTIFIER
+ int "Model identifier"
+
module = DTM_TRANSPORT
module-str = "DTM_transport"
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"
diff --git a/nordic/trezor/radio_test/Kconfig b/nordic/trezor/radio_test/Kconfig
index d4edc610..9a6407b2 100644
--- a/nordic/trezor/radio_test/Kconfig
+++ b/nordic/trezor/radio_test/Kconfig
@@ -32,4 +32,7 @@ config RADIO_TEST_RX_TIMEOUT
received in RX mode when a specified number of packets are set to be received.
If the timeout is reached before the first packet is received, the radio will be disabled.
+config MODEL_IDENTIFIER
+ int "Model identifier"
+
source "Kconfig.zephyr"
diff --git a/nordic/trezor/scripts/build_sign_flash.sh b/nordic/trezor/scripts/build_sign_flash.sh
index a2e01a9d..d9960870 100755
--- a/nordic/trezor/scripts/build_sign_flash.sh
+++ b/nordic/trezor/scripts/build_sign_flash.sh
@@ -104,8 +104,8 @@ VERSION=$(get_version_from_file)
# Update paths in signing and flashing commands
if [ "$SIGN" -eq 1 ]; then
run_under_ncs_subshell \
- "imgtool sign --version $VERSION --align 4 --header-size 0x200 -S 0x6c000 --pad-header build/$APP_DIR/zephyr/zephyr.bin build/$APP_DIR/zephyr/zephyr.prep.bin --custom-tlv 0x00A2 0x03 && \
- imgtool sign --version $VERSION --align 4 --header-size 0x200 -S 0x6c000 --pad-header build/$APP_DIR/zephyr/zephyr.hex build/$APP_DIR/zephyr/zephyr.prep.hex --custom-tlv 0x00A2 0x03 && \
+ "imgtool sign --version $VERSION --align 4 --header-size 0x200 -S 0x6c000 --pad-header build/$APP_DIR/zephyr/zephyr.bin build/$APP_DIR/zephyr/zephyr.prep.bin --custom-tlv 0x00A2 0x03 --custom-tlv 0x00A3 0x54335731 && \
+ imgtool sign --version $VERSION --align 4 --header-size 0x200 -S 0x6c000 --pad-header build/$APP_DIR/zephyr/zephyr.hex build/$APP_DIR/zephyr/zephyr.prep.hex --custom-tlv 0x00A2 0x03 --custom-tlv 0x00A3 0x54335731 && \
../bootloader/mcuboot/scripts/imgtool.py dumpinfo ./build/$APP_DIR/zephyr/zephyr.prep.bin > ./build/$APP_DIR/zephyr/dump.txt"
HASH=$(python ./scripts/extract_hash.py ./build/$APP_DIR/zephyr/dump.txt)
diff --git a/nordic/trezor/trezor-ble/Kconfig b/nordic/trezor/trezor-ble/Kconfig
index a4145e0e..07f237e4 100644
--- a/nordic/trezor/trezor-ble/Kconfig
+++ b/nordic/trezor/trezor-ble/Kconfig
@@ -25,4 +25,8 @@ config DEFAULT_THREAD_STACK_SIZE
help
Common stack size used
+config MODEL_IDENTIFIER
+ int "Model identifier"
+
+
endmenu
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.