build(core): use BOOTLOADER_DEVEL flag for keys selection
What changed, and why it matters
This commit renames and restructures how Trezor firmware selects cryptographic signing keys for bootloaders. Previously, non-production builds automatically used weaker development/QA keys. Now, a dedicated BOOTLOADER_DEVEL flag controls that, while a separate FORCE_BOOTLOADER_UPGRADE flag controls whether the firmware should forcibly update the bootloader. The change also prevents combining PRODUCTION=1 with BOOTLOADER_DEVEL=1. This is primarily a build-hardening and internal workflow cleanup; it does not by itself fix a remotely exploitable bug in shipped devices.
Treat as a defensive build-system hardening commit. Review CI/build documentation to ensure developers understand the new flags and cannot accidentally ship PRODUCTION=1 firmware compiled with BOOTLOADER_DEVEL=1. No emergency patch or advisory appears warranted from this diff alone.
Security signals we found
Build flag that selects weaker/development signing keys is now explicit and separated from production gating
Makefile now forbids combining PRODUCTION=1 with BOOTLOADER_DEVEL=1
Bootloader replacement logic no longer triggers automatically on QA builds; requires explicit FORCE_BOOTLOADER_UPGRADE
Development public keys remain present in source tree under BOOTLOADER_DEVEL guard
Evidence from the diff
The patch replaces the BOOTLOADER_QA build flag with BOOTLOADER_DEVEL and introduces FORCE_BOOTLOADER_UPGRADE. It changes the preprocessor guards in image.c and boot_header.c so that development signing keys are selected only when BOOTLOADER_DEVEL=1, not simply whenever PRODUCTION=0. It also changes firmware/main.c so bootloader replacement is gated by PRODUCTION || FORCE_BOOTLOADER_UPGRADE instead of PRODUCTION || BOOTLOADER_QA. A Makefile guard now errors if PRODUCTION and BOOTLOADER_DEVEL are both set. The embedded bootloader binaries and their hashes are renamed from _qa to _devel, but their contents appear unchanged (same hashes).
Changed components
core/Makefilecore/SConscript.bootloadercore/SConscript.firmwarecore/SConscript.kernelcore/SConscript.secmoncore/embed/sec/image/image.ccore/embed/sec/image/boot_header.ccore/embed/projects/firmware/main.ccore/embed/projects/firmware/boot_image_embdata.cmodel-specific bootloader binaries and hash headersInspect captured patch +93 / −83
diff --git a/core/Makefile b/core/Makefile
index 0da3351d..c730a93a 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -31,7 +31,7 @@ PRODUCTION ?= 0
DEBUGLINK ?= 0
PYOPT ?= 1
BITCOIN_ONLY ?= 0
-BOOTLOADER_QA ?= 0
+FORCE_BOOTLOADER_UPGRADE ?= 0
BOOTLOADER_DEVEL ?= 0
UNSAFE_FW ?= 0
TREZOR_MODEL ?= T3W1
@@ -52,6 +52,13 @@ DBG_CONSOLE ?=
EXTAPP_SUPPORT ?= 0
N4W1 ?= 0
+ifeq ($(PRODUCTION),1)
+ifeq ($(BOOTLOADER_DEVEL),1)
+$(error PRODUCTION and BOOTLOADER_DEVEL cannot be set at the same time)
+# remove this check if you know what you are doing and need to build this way
+endif
+endif
+
# If set, VCP writes will be blocking, in order to allow reliable debug data transmission over VCP.
# Disabled by default, to prevent debug firmware from getting stuck while writing log messages (if the host is not reading them).
BLOCK_ON_VCP ?= 0
@@ -126,7 +133,7 @@ SCONS_VARS = \
BENCHMARK="$(BENCHMARK)" \
BITCOIN_ONLY="$(BITCOIN_ONLY)" \
BOOTLOADER_DEVEL="$(BOOTLOADER_DEVEL)" \
- BOOTLOADER_QA="$(BOOTLOADER_QA)" \
+ FORCE_BOOTLOADER_UPGRADE="$(FORCE_BOOTLOADER_UPGRADE)" \
UNSAFE_FW="$(UNSAFE_FW)" \
CFLAGS="$(CFLAGS)" \
CMAKELISTS="$(CMAKELISTS)" \
@@ -335,8 +342,16 @@ build_secmon: ## build security monitor image
build_kernel: ## build kernel image
$(SCONS) $(KERNEL_BUILD_DIR)/kernel.bin
+# build secmon locally if BOOTLOADER_DEVEL=1 and UNSAFE_FW=0
+BUILD_LOCAL_SECMON =
+ifeq ($(BOOTLOADER_DEVEL),1)
+ifeq ($(UNSAFE_FW),0)
+BUILD_LOCAL_SECMON = build_secmon
+endif
+endif
+
build_firmware: MICROPY_ENABLE_SOURCE_LINE ?= 0
-build_firmware: templates build_cross $(if $(or $(filter 1,$(PRODUCTION)),$(filter 1,$(UNSAFE_FW))),,build_secmon) build_kernel ## build firmware with frozen modules
+build_firmware: templates build_cross $(BUILD_LOCAL_SECMON) build_kernel ## build firmware with frozen modules
$(SCONS) $(FIRMWARE_BUILD_DIR)/firmware.bin
build_unix: MICROPY_ENABLE_SOURCE_LINE ?= 1
diff --git a/core/SConscript.boardloader b/core/SConscript.boardloader
index cef10163..f6b6d852 100644
--- a/core/SConscript.boardloader
+++ b/core/SConscript.boardloader
@@ -8,6 +8,7 @@ CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
DBG_CONSOLE = ARGUMENTS.get('DBG_CONSOLE', '')
+BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
FEATURES_WANTED = [
"boot_ucb",
@@ -32,7 +33,7 @@ if DBG_CONSOLE != "":
FEATURES_WANTED += ["dbg_console"]
env = Environment(ENV=os.environ,
- CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')),
+ CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DBOOTLOADER_DEVEL={int(BOOTLOADER_DEVEL)}",
CPPDEFINES_IMPLICIT=[],
CPPDEFPREFIX="-D'",
CPPDEFSUFFIX="'",
diff --git a/core/SConscript.bootloader b/core/SConscript.bootloader
index ec8f8d73..906a7394 100644
--- a/core/SConscript.bootloader
+++ b/core/SConscript.bootloader
@@ -5,8 +5,8 @@ import tools, models, ui
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T2T1')
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
-BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
-PRODUCTION = 0 if BOOTLOADER_QA else ARGUMENTS.get('PRODUCTION', '0') == '1'
+BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
+PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
DEBUGLINK = ARGUMENTS.get('DEBUGLINK', '0') == '1'
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
UI_PERFORMANCE_OVERLAY = ARGUMENTS.get('UI_PERFORMANCE_OVERLAY', '0') == '1'
@@ -55,7 +55,7 @@ if DBG_CONSOLE != "":
env = Environment(
ENV=os.environ,
- CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DBOOTLOADER_QA={int(BOOTLOADER_QA)}",
+ CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DBOOTLOADER_DEVEL={int(BOOTLOADER_DEVEL)}",
CPPDEFINES_IMPLICIT=[],
CPPDEFPREFIX="-D'",
CPPDEFSUFFIX="'",
@@ -258,7 +258,7 @@ env.Replace(
env.Replace(
ALLSOURCES=SOURCE_MOD + SOURCE_MOD_CRYPTO + SOURCE_BOOTLOADER + SOURCE_NANOPB + SOURCE_HAL,
- ALLDEFS=tools.get_defs_for_cmake(env['CPPDEFINES'] + env['CPPDEFINES_IMPLICIT'] + [f"PRODUCTION={int(PRODUCTION)}", f"BOOTLOADER_QA={int(BOOTLOADER_QA)}"]))
+ ALLDEFS=tools.get_defs_for_cmake(env['CPPDEFINES'] + env['CPPDEFINES_IMPLICIT'] + [f"PRODUCTION={int(PRODUCTION)}"]))
cmake_gen = env.Command(
target='CMakeLists.txt',
@@ -322,9 +322,8 @@ program_elf = env.Command(
env.Depends(program_elf, linkerscript_gen)
-SUFFIX = '_qa' if BOOTLOADER_QA else ''
-BINARY_NAME = f"build/bootloader/bootloader-{TREZOR_MODEL}{SUFFIX}"
+BINARY_NAME = f"build/bootloader/bootloader-{TREZOR_MODEL}"
BINARY_NAME += "-" + tools.get_version('embed/projects/bootloader/version.h')
BINARY_NAME += "-" + tools.get_git_revision_short_hash()
BINARY_NAME += "-dirty" if tools.get_git_modified() else ""
@@ -338,6 +337,6 @@ program_bin = env.Command(
source=program_elf,
action=[
'$OBJCOPY -O binary -j .header -j .flash -j .data $SOURCE $TARGET',
- '$HEADERTOOL $TARGET ' + ('-D' if not PRODUCTION else ''),
+ '$HEADERTOOL $TARGET ' + ('-D' if BOOTLOADER_DEVEL else ''),
'$CP $TARGET ' + BINARY_NAME,
], )
diff --git a/core/SConscript.bootloader_ci b/core/SConscript.bootloader_ci
index c5742556..c1177e9e 100644
--- a/core/SConscript.bootloader_ci
+++ b/core/SConscript.bootloader_ci
@@ -5,6 +5,7 @@ import tools, models, ui
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T2T1')
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
+BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
@@ -34,7 +35,7 @@ RUST_UI_FEATURES = []
env = Environment(
ENV=os.environ,
- CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')),
+ CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DBOOTLOADER_DEVEL={int(BOOTLOADER_DEVEL)}",
CPPDEFINES_IMPLICIT=[],
CPPDEFPREFIX="-D'",
CPPDEFSUFFIX="'",
@@ -252,6 +253,6 @@ program_bin = env.Command(
source=program_elf,
action=[
'$OBJCOPY -O binary -j .header -j .flash -j .data $SOURCE $TARGET',
- '$HEADERTOOL $TARGET ' + ('-D' if ARGUMENTS.get('PRODUCTION', '0') == '0' else ''),
+ '$HEADERTOOL $TARGET ' + ('-D' if BOOTLOADER_DEVEL else ''),
'$CP $TARGET ' + BINARY_NAME,
], )
diff --git a/core/SConscript.bootloader_emu b/core/SConscript.bootloader_emu
index 88a14d4b..d7d8ebae 100644
--- a/core/SConscript.bootloader_emu
+++ b/core/SConscript.bootloader_emu
@@ -5,8 +5,8 @@ import tools, models, ui
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T2T1')
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
-BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
-PRODUCTION = 0 if BOOTLOADER_QA else ARGUMENTS.get('PRODUCTION', '0') == '1'
+BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
+PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
DEBUGLINK = ARGUMENTS.get('DEBUGLINK', '0') == '1'
HW_REVISION = 'emulator'
DBG_CONSOLE = ARGUMENTS.get('DBG_CONSOLE', '')
@@ -158,7 +158,7 @@ ui.init_ui(TREZOR_MODEL, "bootloader", RUST_UI_FEATURES)
env = Environment(
ENV=os.environ,
- CFLAGS=ARGUMENTS.get('CFLAGS', '') + f" -DCONFIDENTIAL= -DPRODUCTION={ARGUMENTS.get('PRODUCTION', '0')}",
+ CFLAGS=ARGUMENTS.get('CFLAGS', '') + f" -DCONFIDENTIAL= -DPRODUCTION={int(PRODUCTION)} -DBOOTLOADER_DEVEL={int(BOOTLOADER_DEVEL)}",
CPPDEFPREFIX="-D'",
CPPDEFSUFFIX="'",
)
diff --git a/core/SConscript.firmware b/core/SConscript.firmware
index 1232c07d..482abef7 100644
--- a/core/SConscript.firmware
+++ b/core/SConscript.firmware
@@ -7,7 +7,7 @@ import random
BITCOIN_ONLY = ARGUMENTS.get('BITCOIN_ONLY', '0')
PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
-BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
+FORCE_BOOTLOADER_UPGRADE = ARGUMENTS.get('FORCE_BOOTLOADER_UPGRADE', '0') == '1'
BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
UNSAFE_FW = ARGUMENTS.get('UNSAFE_FW', '0') == '1'
EVERYTHING = BITCOIN_ONLY != '1'
@@ -469,7 +469,7 @@ env = Environment(
ENV=os.environ,
CFLAGS=(
f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DPYOPT={PYOPT} "
- f"-DBOOTLOADER_QA={int(BOOTLOADER_QA)} -DBITCOIN_ONLY={BITCOIN_ONLY} {DEBUG_FLAGS}"
+ f"-DFORCE_BOOTLOADER_UPGRADE={int(FORCE_BOOTLOADER_UPGRADE)} -DBOOTLOADER_DEVEL={int(BOOTLOADER_DEVEL)} -DBITCOIN_ONLY={BITCOIN_ONLY} {DEBUG_FLAGS}"
),
CPPDEFINES_IMPLICIT=[],
CPPDEFPREFIX="-D'",
@@ -901,7 +901,7 @@ random.Random(SCM_REVISION).shuffle(obj_program)
env.Replace(
ALLSOURCES=source_files,
- ALLDEFS=tools.get_defs_for_cmake(env['CPPDEFINES'] + env['CPPDEFINES_IMPLICIT'] + [f"PRODUCTION={int(PRODUCTION)}", f"BOOTLOADER_QA={int(BOOTLOADER_QA)}", f"PYOPT={PYOPT}", f"BITCOIN_ONLY={BITCOIN_ONLY}"]))
+ ALLDEFS=tools.get_defs_for_cmake(env['CPPDEFINES'] + env['CPPDEFINES_IMPLICIT'] + [f"PRODUCTION={int(PRODUCTION)}", f"FORCE_BOOTLOADER_UPGRADE={int(FORCE_BOOTLOADER_UPGRADE)}", f"PYOPT={PYOPT}", f"BITCOIN_ONLY={BITCOIN_ONLY}"]))
cmake_gen = env.Command(
@@ -959,11 +959,11 @@ env.Depends(rust, protobuf_blobs)
env.Depends(rust, TRANSLATION_DATA)
BOOTLOADER_SUFFIX = TREZOR_MODEL
-if BOOTLOADER_QA or BOOTLOADER_DEVEL:
- BOOTLOADER_SUFFIX += '_qa'
+if BOOTLOADER_DEVEL:
+ BOOTLOADER_SUFFIX += '_devel'
# select vendor header
-if BOOTLOADER_QA or BOOTLOADER_DEVEL:
+if BOOTLOADER_DEVEL:
if UNSAFE_FW:
vendor = "unsafe_signed_dev"
else:
@@ -1061,14 +1061,14 @@ if 'STM32F427xx' in CPPDEFINES_HAL or 'STM32F429xx' in CPPDEFINES_HAL:
'$OBJCOPY -O binary -j .vendorheader -j .header -j .flash -j .data --pad-to 0x08100000 $SOURCE ${TARGET}.p1',
'$OBJCOPY -O binary -j .flash2 $SOURCE ${TARGET}.p2',
'$CAT ${TARGET}.p1 ${TARGET}.p2 > $TARGET',
- '$HEADERTOOL -h $TARGET ' + ('-D' if not PRODUCTION else ''),
+ '$HEADERTOOL -h $TARGET ' + ('-D' if not (BOOTLOADER_DEVEL or not PRODUCTION) else ''),
'$DD if=$TARGET of=${TARGET}.p1 skip=0 bs=128k count=6',
'$CP $TARGET ' + BINARY_NAME,
]
else:
action_bin=[
'$OBJCOPY -O binary -j .vendorheader -j .header -j .flash -j .data $SOURCE ${TARGET}',
- '$HEADERTOOL -h $TARGET ' + ('-D' if not PRODUCTION else ''),
+ '$HEADERTOOL -h $TARGET ' + ('-D' if not (BOOTLOADER_DEVEL or not PRODUCTION) else ''),
'$CP $TARGET ' + BINARY_NAME,
]
diff --git a/core/SConscript.kernel b/core/SConscript.kernel
index 3225d304..51d00d8f 100644
--- a/core/SConscript.kernel
+++ b/core/SConscript.kernel
@@ -6,7 +6,6 @@ import tools, models
BITCOIN_ONLY = ARGUMENTS.get('BITCOIN_ONLY', '0')
PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
-BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
UNSAFE_FW = ARGUMENTS.get('UNSAFE_FW', '0') == '1'
EVERYTHING = BITCOIN_ONLY != '1'
@@ -270,7 +269,7 @@ else:
env = Environment(
ENV=os.environ,
- CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DPYOPT={PYOPT} -DBOOTLOADER_QA={int(BOOTLOADER_QA)} -DBITCOIN_ONLY={BITCOIN_ONLY} -USCM_REVISION_INIT {DEBUG_FLAGS}",
+ CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DPYOPT={PYOPT} -DBOOTLOADER_DEVEL={int(BOOTLOADER_DEVEL)} -DBITCOIN_ONLY={BITCOIN_ONLY} -USCM_REVISION_INIT {DEBUG_FLAGS}",
CPPDEFINES_IMPLICIT=[],
CPPDEFPREFIX="-D'",
CPPDEFSUFFIX="'",
@@ -376,7 +375,7 @@ obj_program.extend(env.Object(source=SOURCE_HAL))
env.Replace(
ALLSOURCES=source_files,
- ALLDEFS=tools.get_defs_for_cmake(env['CPPDEFINES'] + env['CPPDEFINES_IMPLICIT'] + [f"PRODUCTION={int(PRODUCTION)}", f"BOOTLOADER_QA={int(BOOTLOADER_QA)}", f"PYOPT={PYOPT}", f"BITCOIN_ONLY={BITCOIN_ONLY}"]))
+ ALLDEFS=tools.get_defs_for_cmake(env['CPPDEFINES'] + env['CPPDEFINES_IMPLICIT'] + [f"PRODUCTION={int(PRODUCTION)}", f"PYOPT={PYOPT}", f"BITCOIN_ONLY={BITCOIN_ONLY}"]))
cmake_gen = env.Command(
@@ -385,12 +384,8 @@ cmake_gen = env.Command(
action='$MAKECMAKELISTS --sources $ALLSOURCES --dirs $CPPPATH --defs $ALLDEFS',
)
-BOOTLOADER_SUFFIX = TREZOR_MODEL
-if BOOTLOADER_QA:
- BOOTLOADER_SUFFIX += '_qa'
-
# select vendor header
-if BOOTLOADER_QA or BOOTLOADER_DEVEL:
+if BOOTLOADER_DEVEL:
vendor = "dev_DO_NOT_SIGN_signed_dev"
elif not PRODUCTION:
vendor = "unsafe_signed_prod"
diff --git a/core/SConscript.prodtest b/core/SConscript.prodtest
index d3953d0c..e42179e9 100644
--- a/core/SConscript.prodtest
+++ b/core/SConscript.prodtest
@@ -65,7 +65,7 @@ if DBG_CONSOLE != "":
env = Environment(
ENV=os.environ,
- CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')),
+ CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DBOOTLOADER_DEVEL={int(BOOTLOADER_DEVEL)}",
CPPDEFINES_IMPLICIT=[],
CPPDEFPREFIX="-D'",
CPPDEFSUFFIX="'",
@@ -341,10 +341,10 @@ elif (vh := os.environ.get("VENDOR_HEADER", None)):
# we should figure out a cleaner way to pass in this argument, without having to teach
# the Makefile about it.
VENDORHEADER = f'embed/models/{TREZOR_MODEL}/vendorheader/{vh}'
-elif PRODUCTION:
- VENDORHEADER = f'embed/models/{TREZOR_MODEL}/vendorheader/vendorheader_prodtest_signed_prod.bin'
elif BOOTLOADER_DEVEL:
VENDORHEADER = f'embed/models/{TREZOR_MODEL}/vendorheader/vendorheader_prodtest_DO_NOT_SIGN_signed_dev.bin'
+elif PRODUCTION:
+ VENDORHEADER = f'embed/models/{TREZOR_MODEL}/vendorheader/vendorheader_prodtest_signed_prod.bin'
else:
VENDORHEADER = f'embed/models/{TREZOR_MODEL}/vendorheader/vendorheader_unsafe_signed_prod.bin'
@@ -387,7 +387,7 @@ if secmon_prodtest:
source=program_elf,
action=[
'$OBJCOPY -O binary -j .secmon_header -j .flash -j .data $SOURCE $TARGET',
- '$HEADERTOOL $TARGET ' + ('-D' if ARGUMENTS.get('PRODUCTION', '0') == '0' else ''),
+ '$HEADERTOOL $TARGET ' + ('-D' if (BOOTLOADER_DEVEL or not PRODUCTION) else ''),
], )
headers_bin = env.Command(
@@ -401,7 +401,7 @@ if secmon_prodtest:
target='prodtest.bin',
source=[ headers_bin, secmon_bin ],
action=['cat ${SOURCES[0]} ${SOURCES[1]} > $TARGET',
- '$HEADERTOOL $TARGET ' + ('-D' if ARGUMENTS.get('PRODUCTION', '0') == '0' else ''),
+ '$HEADERTOOL $TARGET ' + ('-D' if (BOOTLOADER_DEVEL or not PRODUCTION) else ''),
'$CP $TARGET ' + BINARY_NAME,]
)
@@ -413,6 +413,6 @@ else:
source=program_elf,
action=[
'$OBJCOPY -O binary -j .vendorheader -j .header -j .flash -j .data $SOURCE $TARGET',
- '$HEADERTOOL $TARGET ' + ('-D' if ARGUMENTS.get('PRODUCTION', '0') == '0' else ''),
+ '$HEADERTOOL $TARGET ' + ('-D' if (BOOTLOADER_DEVEL or not PRODUCTION) else ''),
'$CP $TARGET ' + BINARY_NAME,
], )
diff --git a/core/SConscript.prodtest_emu b/core/SConscript.prodtest_emu
index cd683dd3..262afba3 100644
--- a/core/SConscript.prodtest_emu
+++ b/core/SConscript.prodtest_emu
@@ -5,6 +5,8 @@ import tools, models, ui
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T2T1')
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
+PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
+BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
HW_REVISION = 'emulator'
DBG_CONSOLE = ARGUMENTS.get('DBG_CONSOLE', '')
@@ -145,7 +147,7 @@ ui.init_ui(TREZOR_MODEL, "prodtest", RUST_UI_FEATURES)
env = Environment(
ENV=os.environ,
- CFLAGS=ARGUMENTS.get('CFLAGS', '') + f" -DCONFIDENTIAL= -DPRODUCTION={ARGUMENTS.get('PRODUCTION', '0')}",
+ CFLAGS=ARGUMENTS.get('CFLAGS', '') + f" -DCONFIDENTIAL= -DPRODUCTION={int(PRODUCTION)} -DBOOTLOADER_DEVEL={int(BOOTLOADER_DEVEL)}",
CPPDEFPREFIX="-D'",
CPPDEFSUFFIX="'",
)
diff --git a/core/SConscript.secmon b/core/SConscript.secmon
index 653cf469..c0d96df4 100644
--- a/core/SConscript.secmon
+++ b/core/SConscript.secmon
@@ -6,7 +6,6 @@ import tools, models
BITCOIN_ONLY = ARGUMENTS.get('BITCOIN_ONLY', '0')
PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
-BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
UNSAFE_FW = ARGUMENTS.get('UNSAFE_FW', '0') == '1'
EVERYTHING = BITCOIN_ONLY != '1'
@@ -81,7 +80,7 @@ FROZEN = True
env = Environment(
ENV=os.environ,
- CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DPYOPT={PYOPT} -DBOOTLOADER_QA={int(BOOTLOADER_QA)} -DBITCOIN_ONLY={BITCOIN_ONLY} -USCM_REVISION_INIT {DEBUG_FLAGS}",
+ CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DPYOPT={PYOPT} -DBOOTLOADER_DEVEL={int(BOOTLOADER_DEVEL)} -DBITCOIN_ONLY={BITCOIN_ONLY} -USCM_REVISION_INIT {DEBUG_FLAGS}",
CPPDEFINES_IMPLICIT=[],
CPPDEFPREFIX="-D'",
CPPDEFSUFFIX="'",
@@ -371,7 +370,7 @@ if 'boot_ucb' in FEATURES_AVAILABLE:
env.Replace(
ALLSOURCES=source_files,
- ALLDEFS=tools.get_defs_for_cmake(env['CPPDEFINES'] + env['CPPDEFINES_IMPLICIT'] + [f"PRODUCTION={int(PRODUCTION)}", f"BOOTLOADER_QA={int(BOOTLOADER_QA)}", f"PYOPT={PYOPT}", f"BITCOIN_ONLY={BITCOIN_ONLY}"]))
+ ALLDEFS=tools.get_defs_for_cmake(env['CPPDEFINES'] + env['CPPDEFINES_IMPLICIT'] + [f"PRODUCTION={int(PRODUCTION)}", f"PYOPT={PYOPT}", f"BITCOIN_ONLY={BITCOIN_ONLY}"]))
cmake_gen = env.Command(
@@ -381,7 +380,7 @@ cmake_gen = env.Command(
)
# select vendor header
-if BOOTLOADER_QA or BOOTLOADER_DEVEL:
+if BOOTLOADER_DEVEL:
vendor = "dev_DO_NOT_SIGN_signed_dev"
elif not PRODUCTION:
vendor = "unsafe_signed_prod"
@@ -438,7 +437,7 @@ if TREZOR_MODEL in ('T3B1', 'T3T1'):
else:
action_bin=[
'$OBJCOPY -O binary -j .secmon_header -j .flash -j .data -j .gnu.sgstubs $SOURCE ${TARGET}',
- '$HEADERTOOL -h $TARGET ' + ('-D' if not PRODUCTION else ''),
+ '$HEADERTOOL -h $TARGET ' + ('-D' if not (BOOTLOADER_DEVEL or not PRODUCTION) else ''),
'$CP $TARGET ' + BINARY_NAME,
]
diff --git a/core/SConscript.unix b/core/SConscript.unix
index 29e573bb..7e5438e7 100644
--- a/core/SConscript.unix
+++ b/core/SConscript.unix
@@ -8,6 +8,7 @@ BITCOIN_ONLY = ARGUMENTS.get('BITCOIN_ONLY', '0')
EVERYTHING = BITCOIN_ONLY != '1'
PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T2T1')
+BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
HW_REVISION ='emulator'
THP = ARGUMENTS.get('THP', '0') == '1' # Trezor-Host Protocol
@@ -463,7 +464,7 @@ else:
env = Environment(
ENV=os.environ,
- CFLAGS=ARGUMENTS.get("CFLAGS", "") + f" -DCONFIDENTIAL= -DPYOPT={PYOPT} -DBITCOIN_ONLY={BITCOIN_ONLY} {DEBUG_FLAGS}",
+ CFLAGS=ARGUMENTS.get("CFLAGS", "") + f" -DCONFIDENTIAL= -DPYOPT={PYOPT} -DBITCOIN_ONLY={BITCOIN_ONLY} {DEBUG_FLAGS} -DBOOTLOADER_DEVEL={int(BOOTLOADER_DEVEL)}",
CPPDEFPREFIX="-D'",
CPPDEFSUFFIX="'",
)
diff --git a/core/embed/models/D001/bootloaders/bootloader_D001_devel.bin b/core/embed/models/D001/bootloaders/bootloader_D001_devel.bin
new file mode 120000
index 00000000..176fb596
--- /dev/null
+++ b/core/embed/models/D001/bootloaders/bootloader_D001_devel.bin
@@ -0,0 +1 @@
+./bootloader_D001.bin
\ No newline at end of file
diff --git a/core/embed/models/D001/bootloaders/bootloader_D001_qa.bin b/core/embed/models/D001/bootloaders/bootloader_D001_qa.bin
deleted file mode 120000
index 176fb596..00000000
--- a/core/embed/models/D001/bootloaders/bootloader_D001_qa.bin
+++ /dev/null
@@ -1 +0,0 @@
-./bootloader_D001.bin
\ No newline at end of file
diff --git a/core/embed/models/D001/bootloaders/bootloader_hashes.h b/core/embed/models/D001/bootloaders/bootloader_hashes.h
index a15df247..eb1c89ac 100644
--- a/core/embed/models/D001/bootloaders/bootloader_hashes.h
+++ b/core/embed/models/D001/bootloaders/bootloader_hashes.h
@@ -8,9 +8,9 @@
#define BOOTLOADER_D001_00 {0x23, 0xc6, 0xcb, 0x1f, 0xcb, 0xaf, 0x2b, 0x0c, 0x25, 0x7c, 0xeb, 0x23, 0xbd, 0x60, 0xfd, 0x2f, 0x24, 0xde, 0xc9, 0x23, 0x4a, 0x02, 0x42, 0x9e, 0x2c, 0xc4, 0xa3, 0x59, 0x83, 0x1e, 0x04, 0x50}
#define BOOTLOADER_D001_FF {0xf2, 0x2a, 0xd2, 0xa4, 0x3c, 0xed, 0xf0, 0xa0, 0x9f, 0xcc, 0xeb, 0x56, 0x65, 0x18, 0xe6, 0xb5, 0xbe, 0xfe, 0x9d, 0x46, 0xa4, 0xff, 0x99, 0xbf, 0xc6, 0x78, 0xe5, 0xb6, 0x27, 0xa1, 0x1e, 0xdb}
-// bootloader_D001_qa.bin version 2.1.10.0
-#define BOOTLOADER_D001_QA_00 {0x23, 0xc6, 0xcb, 0x1f, 0xcb, 0xaf, 0x2b, 0x0c, 0x25, 0x7c, 0xeb, 0x23, 0xbd, 0x60, 0xfd, 0x2f, 0x24, 0xde, 0xc9, 0x23, 0x4a, 0x02, 0x42, 0x9e, 0x2c, 0xc4, 0xa3, 0x59, 0x83, 0x1e, 0x04, 0x50}
-#define BOOTLOADER_D001_QA_FF {0xf2, 0x2a, 0xd2, 0xa4, 0x3c, 0xed, 0xf0, 0xa0, 0x9f, 0xcc, 0xeb, 0x56, 0x65, 0x18, 0xe6, 0xb5, 0xbe, 0xfe, 0x9d, 0x46, 0xa4, 0xff, 0x99, 0xbf, 0xc6, 0x78, 0xe5, 0xb6, 0x27, 0xa1, 0x1e, 0xdb}
+// bootloader_D001_devel.bin version 2.1.10.0
+#define BOOTLOADER_D001_DEVEL_00 {0x23, 0xc6, 0xcb, 0x1f, 0xcb, 0xaf, 0x2b, 0x0c, 0x25, 0x7c, 0xeb, 0x23, 0xbd, 0x60, 0xfd, 0x2f, 0x24, 0xde, 0xc9, 0x23, 0x4a, 0x02, 0x42, 0x9e, 0x2c, 0xc4, 0xa3, 0x59, 0x83, 0x1e, 0x04, 0x50}
+#define BOOTLOADER_D001_DEVEL_FF {0xf2, 0x2a, 0xd2, 0xa4, 0x3c, 0xed, 0xf0, 0xa0, 0x9f, 0xcc, 0xeb, 0x56, 0x65, 0x18, 0xe6, 0xb5, 0xbe, 0xfe, 0x9d, 0x46, 0xa4, 0xff, 0x99, 0xbf, 0xc6, 0x78, 0xe5, 0xb6, 0x27, 0xa1, 0x1e, 0xdb}
// clang-format on
diff --git a/core/embed/models/D002/bootloaders/bootloader_D002_devel.bin b/core/embed/models/D002/bootloaders/bootloader_D002_devel.bin
new file mode 100755
index 00000000..4ba96826
Binary files /dev/null and b/core/embed/models/D002/bootloaders/bootloader_D002_devel.bin differ
diff --git a/core/embed/models/D002/bootloaders/bootloader_D002_qa.bin b/core/embed/models/D002/bootloaders/bootloader_D002_qa.bin
deleted file mode 100755
index 4ba96826..00000000
Binary files a/core/embed/models/D002/bootloaders/bootloader_D002_qa.bin and /dev/null differ
diff --git a/core/embed/models/D002/bootloaders/bootloader_hashes.h b/core/embed/models/D002/bootloaders/bootloader_hashes.h
index 4a46258c..7a7ac821 100644
--- a/core/embed/models/D002/bootloaders/bootloader_hashes.h
+++ b/core/embed/models/D002/bootloaders/bootloader_hashes.h
@@ -8,9 +8,9 @@
#define BOOTLOADER_D002_00 {0xd7, 0xf5, 0x8f, 0xa0, 0x8e, 0x71, 0x3d, 0x53, 0x97, 0xe3, 0xb1, 0x76, 0xa1, 0x57, 0xe5, 0x05, 0xcd, 0x6d, 0x4f, 0x6e, 0xc7, 0x0c, 0x47, 0x4a, 0x7b, 0x12, 0x2f, 0xd2, 0xcb, 0x95, 0x45, 0x8d}
#define BOOTLOADER_D002_FF {0xd7, 0xf5, 0x8f, 0xa0, 0x8e, 0x71, 0x3d, 0x53, 0x97, 0xe3, 0xb1, 0x76, 0xa1, 0x57, 0xe5, 0x05, 0xcd, 0x6d, 0x4f, 0x6e, 0xc7, 0x0c, 0x47, 0x4a, 0x7b, 0x12, 0x2f, 0xd2, 0xcb, 0x95, 0x45, 0x8d}
-// bootloader_D002_qa.bin version 2.1.11.0
-#define BOOTLOADER_D002_QA_00 {0xd7, 0xf5, 0x8f, 0xa0, 0x8e, 0x71, 0x3d, 0x53, 0x97, 0xe3, 0xb1, 0x76, 0xa1, 0x57, 0xe5, 0x05, 0xcd, 0x6d, 0x4f, 0x6e, 0xc7, 0x0c, 0x47, 0x4a, 0x7b, 0x12, 0x2f, 0xd2, 0xcb, 0x95, 0x45, 0x8d}
-#define BOOTLOADER_D002_QA_FF {0xd7, 0xf5, 0x8f, 0xa0, 0x8e, 0x71, 0x3d, 0x53, 0x97, 0xe3, 0xb1, 0x76, 0xa1, 0x57, 0xe5, 0x05, 0xcd, 0x6d, 0x4f, 0x6e, 0xc7, 0x0c, 0x47, 0x4a, 0x7b, 0x12, 0x2f, 0xd2, 0xcb, 0x95, 0x45, 0x8d}
+// bootloader_D002_devel.bin version 2.1.11.0
+#define BOOTLOADER_D002_DEVEL_00 {0xd7, 0xf5, 0x8f, 0xa0, 0x8e, 0x71, 0x3d, 0x53, 0x97, 0xe3, 0xb1, 0x76, 0xa1, 0x57, 0xe5, 0x05, 0xcd, 0x6d, 0x4f, 0x6e, 0xc7, 0x0c, 0x47, 0x4a, 0x7b, 0x12, 0x2f, 0xd2, 0xcb, 0x95, 0x45, 0x8d}
+#define BOOTLOADER_D002_DEVEL_FF {0xd7, 0xf5, 0x8f, 0xa0, 0x8e, 0x71, 0x3d, 0x53, 0x97, 0xe3, 0xb1, 0x76, 0xa1, 0x57, 0xe5, 0x05, 0xcd, 0x6d, 0x4f, 0x6e, 0xc7, 0x0c, 0x47, 0x4a, 0x7b, 0x12, 0x2f, 0xd2, 0xcb, 0x95, 0x45, 0x8d}
// clang-format on
diff --git a/core/embed/models/T2B1/bootloaders/bootloader_T2B1_devel.bin b/core/embed/models/T2B1/bootloaders/bootloader_T2B1_devel.bin
new file mode 100644
index 00000000..cb469e28
Binary files /dev/null and b/core/embed/models/T2B1/bootloaders/bootloader_T2B1_devel.bin differ
diff --git a/core/embed/models/T2B1/bootloaders/bootloader_T2B1_qa.bin b/core/embed/models/T2B1/bootloaders/bootloader_T2B1_qa.bin
deleted file mode 100644
index cb469e28..00000000
Binary files a/core/embed/models/T2B1/bootloaders/bootloader_T2B1_qa.bin and /dev/null differ
diff --git a/core/embed/models/T2B1/bootloaders/bootloader_hashes.h b/core/embed/models/T2B1/bootloaders/bootloader_hashes.h
index c167ceea..d84b9d2f 100644
--- a/core/embed/models/T2B1/bootloaders/bootloader_hashes.h
+++ b/core/embed/models/T2B1/bootloaders/bootloader_hashes.h
@@ -8,9 +8,9 @@
#define BOOTLOADER_T2B1_00 {0x22, 0x05, 0x4b, 0xc5, 0xfb, 0x94, 0x3f, 0xd0, 0xc5, 0x39, 0x4e, 0x19, 0x82, 0xce, 0xf0, 0xeb, 0x07, 0xba, 0x51, 0x6d, 0xac, 0x15, 0xe9, 0xc1, 0x5d, 0xd2, 0x05, 0x8a, 0xfa, 0x5c, 0x40, 0x7c}
#define BOOTLOADER_T2B1_FF {0x1e, 0x22, 0xc3, 0x11, 0xde, 0xb7, 0x5d, 0xf6, 0x21, 0xb2, 0x6b, 0x4c, 0x93, 0x34, 0xec, 0x66, 0x98, 0x91, 0x5c, 0xe9, 0x4c, 0x8c, 0xc0, 0x0b, 0xbb, 0x01, 0xb0, 0xe5, 0xdb, 0xda, 0x56, 0xe0}
-// bootloader_T2B1_qa.bin version 2.1.16.0
-#define BOOTLOADER_T2B1_QA_00 {0xaf, 0xef, 0x75, 0x0b, 0xf3, 0xd1, 0x62, 0x14, 0x4b, 0x19, 0x61, 0x37, 0x33, 0x00, 0x66, 0x3f, 0xbb, 0x4b, 0x96, 0xb7, 0xc4, 0x16, 0x26, 0xdd, 0x9c, 0x5a, 0x43, 0x21, 0x27, 0x32, 0xba, 0x86}
-#define BOOTLOADER_T2B1_QA_FF {0xb9, 0x31, 0x08, 0x9a, 0x7a, 0xa2, 0xce, 0x0a, 0xf7, 0x83, 0x2f, 0x61, 0xad, 0xd1, 0xc7, 0x96, 0xc7, 0x39, 0xd0, 0x47, 0xae, 0xf9, 0xfb, 0x85, 0x14, 0x78, 0x2e, 0xf6, 0xcb, 0x2c, 0xd0, 0xfe}
+// bootloader_T2B1_devel.bin version 2.1.16.0
+#define BOOTLOADER_T2B1_DEVEL_00 {0xaf, 0xef, 0x75, 0x0b, 0xf3, 0xd1, 0x62, 0x14, 0x4b, 0x19, 0x61, 0x37, 0x33, 0x00, 0x66, 0x3f, 0xbb, 0x4b, 0x96, 0xb7, 0xc4, 0x16, 0x26, 0xdd, 0x9c, 0x5a, 0x43, 0x21, 0x27, 0x32, 0xba, 0x86}
+#define BOOTLOADER_T2B1_DEVEL_FF {0xb9, 0x31, 0x08, 0x9a, 0x7a, 0xa2, 0xce, 0x0a, 0xf7, 0x83, 0x2f, 0x61, 0xad, 0xd1, 0xc7, 0x96, 0xc7, 0x39, 0xd0, 0x47, 0xae, 0xf9, 0xfb, 0x85, 0x14, 0x78, 0x2e, 0xf6, 0xcb, 0x2c, 0xd0, 0xfe}
// clang-format on
diff --git a/core/embed/models/T2T1/bootloaders/bootloader_T2T1_devel.bin b/core/embed/models/T2T1/bootloaders/bootloader_T2T1_devel.bin
new file mode 100644
index 00000000..4d44e1ed
Binary files /dev/null and b/core/embed/models/T2T1/bootloaders/bootloader_T2T1_devel.bin differ
diff --git a/core/embed/models/T2T1/bootloaders/bootloader_T2T1_qa.bin b/core/embed/models/T2T1/bootloaders/bootloader_T2T1_qa.bin
deleted file mode 100644
index 4d44e1ed..00000000
Binary files a/core/embed/models/T2T1/bootloaders/bootloader_T2T1_qa.bin and /dev/null differ
diff --git a/core/embed/models/T2T1/bootloaders/bootloader_hashes.h b/core/embed/models/T2T1/bootloaders/bootloader_hashes.h
index 5f131de5..337552d1 100644
--- a/core/embed/models/T2T1/bootloaders/bootloader_hashes.h
+++ b/core/embed/models/T2T1/bootloaders/bootloader_hashes.h
@@ -8,9 +8,9 @@
#define BOOTLOADER_T2T1_00 {0xa6, 0xce, 0x30, 0x93, 0x8f, 0xde, 0xe8, 0x6b, 0x94, 0x42, 0x35, 0x50, 0xc9, 0xd7, 0x9b, 0x6d, 0x96, 0xa9, 0x33, 0x0f, 0xb5, 0x9b, 0x3b, 0x2d, 0xd9, 0x13, 0x5e, 0x0b, 0x4e, 0xa2, 0x5d, 0x18}
#define BOOTLOADER_T2T1_FF {0x78, 0x69, 0xd7, 0x41, 0xd9, 0x3f, 0xc6, 0x0c, 0x96, 0xd4, 0x12, 0xca, 0x4f, 0xaf, 0x74, 0x99, 0xc0, 0x04, 0x9f, 0x87, 0x9a, 0x09, 0xcd, 0xe2, 0x65, 0x5d, 0xbb, 0x36, 0x1c, 0x0c, 0xb2, 0x7a}
-// bootloader_T2T1_qa.bin version 2.1.16.0
-#define BOOTLOADER_T2T1_QA_00 {0x10, 0xd4, 0xae, 0x8e, 0x74, 0xaa, 0xdb, 0x62, 0xa0, 0xf0, 0xc1, 0xca, 0x84, 0x49, 0x21, 0xf8, 0xe8, 0x8f, 0x9f, 0xb0, 0xe6, 0xa5, 0x9c, 0x2e, 0x5a, 0xc3, 0xb6, 0x6a, 0xd1, 0xd7, 0x9f, 0x3f}
-#define BOOTLOADER_T2T1_QA_FF {0x32, 0x1c, 0xe0, 0xee, 0xdc, 0xb5, 0xbd, 0x1e, 0x41, 0x73, 0x9c, 0x72, 0x24, 0x3e, 0xc0, 0x49, 0xdd, 0x75, 0x22, 0xef, 0x46, 0x19, 0x61, 0x9f, 0x38, 0x5f, 0xf7, 0x20, 0x30, 0x53, 0xd3, 0xc9}
+// bootloader_T2T1_devel.bin version 2.1.16.0
+#define BOOTLOADER_T2T1_DEVEL_00 {0x10, 0xd4, 0xae, 0x8e, 0x74, 0xaa, 0xdb, 0x62, 0xa0, 0xf0, 0xc1, 0xca, 0x84, 0x49, 0x21, 0xf8, 0xe8, 0x8f, 0x9f, 0xb0, 0xe6, 0xa5, 0x9c, 0x2e, 0x5a, 0xc3, 0xb6, 0x6a, 0xd1, 0xd7, 0x9f, 0x3f}
+#define BOOTLOADER_T2T1_DEVEL_FF {0x32, 0x1c, 0xe0, 0xee, 0xdc, 0xb5, 0xbd, 0x1e, 0x41, 0x73, 0x9c, 0x72, 0x24, 0x3e, 0xc0, 0x49, 0xdd, 0x75, 0x22, 0xef, 0x46, 0x19, 0x61, 0x9f, 0x38, 0x5f, 0xf7, 0x20, 0x30, 0x53, 0xd3, 0xc9}
// clang-format on
diff --git a/core/embed/models/T3B1/bootloaders/bootloader_T3B1_devel.bin b/core/embed/models/T3B1/bootloaders/bootloader_T3B1_devel.bin
new file mode 100755
index 00000000..0f6ae9fa
Binary files /dev/null and b/core/embed/models/T3B1/bootloaders/bootloader_T3B1_devel.bin differ
diff --git a/core/embed/models/T3B1/bootloaders/bootloader_T3B1_qa.bin b/core/embed/models/T3B1/bootloaders/bootloader_T3B1_qa.bin
deleted file mode 100755
index 0f6ae9fa..00000000
Binary files a/core/embed/models/T3B1/bootloaders/bootloader_T3B1_qa.bin and /dev/null differ
diff --git a/core/embed/models/T3B1/bootloaders/bootloader_hashes.h b/core/embed/models/T3B1/bootloaders/bootloader_hashes.h
index a627cc03..66b8be26 100644
--- a/core/embed/models/T3B1/bootloaders/bootloader_hashes.h
+++ b/core/embed/models/T3B1/bootloaders/bootloader_hashes.h
@@ -8,9 +8,9 @@
#define BOOTLOADER_T3B1_00 {0x19, 0x62, 0x4e, 0x00, 0x17, 0x2a, 0xf9, 0x74, 0x06, 0x92, 0x01, 0x7b, 0x9f, 0x65, 0xa9, 0xd0, 0xa3, 0x1e, 0xfd, 0x3b, 0x7f, 0x9f, 0xdd, 0xb7, 0x37, 0x46, 0xb5, 0xbd, 0xa0, 0x13, 0xbf, 0x34}
#define BOOTLOADER_T3B1_FF {0x46, 0x50, 0x45, 0xd6, 0x84, 0xf8, 0xad, 0x03, 0xb9, 0x38, 0x2b, 0xf9, 0xd3, 0x60, 0x7c, 0x88, 0x41, 0x84, 0xd9, 0x92, 0xcb, 0xa5, 0x8a, 0x09, 0x9a, 0x32, 0xfe, 0x41, 0xa7, 0x92, 0x0a, 0x24}
-// bootloader_T3B1_qa.bin version 2.1.16.0
-#define BOOTLOADER_T3B1_QA_00 {0xf5, 0xf1, 0x53, 0x44, 0x53, 0x3e, 0xcb, 0x95, 0xcd, 0x46, 0x67, 0x4c, 0x2c, 0x5b, 0x8f, 0x8a, 0xa7, 0xee, 0x31, 0x1f, 0xb9, 0x04, 0x62, 0xa7, 0x1e, 0x8a, 0xed, 0x16, 0xf1, 0xc7, 0x65, 0x1f}
-#define BOOTLOADER_T3B1_QA_FF {0xad, 0x60, 0xb9, 0x64, 0xfc, 0xc6, 0x45, 0x36, 0xd2, 0x51, 0xa2, 0xc8, 0x5b, 0xcb, 0xbf, 0x6a, 0x89, 0x1d, 0x78, 0x6b, 0xbf, 0xe5, 0xb5, 0x7a, 0xab, 0x52, 0x2a, 0x5d, 0xec, 0x07, 0xce, 0x68}
+// bootloader_T3B1_devel.bin version 2.1.16.0
+#define BOOTLOADER_T3B1_DEVEL_00 {0xf5, 0xf1, 0x53, 0x44, 0x53, 0x3e, 0xcb, 0x95, 0xcd, 0x46, 0x67, 0x4c, 0x2c, 0x5b, 0x8f, 0x8a, 0xa7, 0xee, 0x31, 0x1f, 0xb9, 0x04, 0x62, 0xa7, 0x1e, 0x8a, 0xed, 0x16, 0xf1, 0xc7, 0x65, 0x1f}
+#define BOOTLOADER_T3B1_DEVEL_FF {0xad, 0x60, 0xb9, 0x64, 0xfc, 0xc6, 0x45, 0x36, 0xd2, 0x51, 0xa2, 0xc8, 0x5b, 0xcb, 0xbf, 0x6a, 0x89, 0x1d, 0x78, 0x6b, 0xbf, 0xe5, 0xb5, 0x7a, 0xab, 0x52, 0x2a, 0x5d, 0xec, 0x07, 0xce, 0x68}
// clang-format on
diff --git a/core/embed/models/T3T1/bootloaders/bootloader_T3T1_devel.bin b/core/embed/models/T3T1/bootloaders/bootloader_T3T1_devel.bin
new file mode 100755
index 00000000..9ea6ff76
Binary files /dev/null and b/core/embed/models/T3T1/bootloaders/bootloader_T3T1_devel.bin differ
diff --git a/core/embed/models/T3T1/bootloaders/bootloader_T3T1_qa.bin b/core/embed/models/T3T1/bootloaders/bootloader_T3T1_qa.bin
deleted file mode 100755
index 9ea6ff76..00000000
Binary files a/core/embed/models/T3T1/bootloaders/bootloader_T3T1_qa.bin and /dev/null differ
diff --git a/core/embed/models/T3T1/bootloaders/bootloader_hashes.h b/core/embed/models/T3T1/bootloaders/bootloader_hashes.h
index 7e02f7b8..15155829 100644
--- a/core/embed/models/T3T1/bootloaders/bootloader_hashes.h
+++ b/core/embed/models/T3T1/bootloaders/bootloader_hashes.h
@@ -8,9 +8,9 @@
#define BOOTLOADER_T3T1_00 {0x1f, 0xa4, 0xe7, 0xbf, 0xe3, 0xe2, 0xbe, 0x01, 0x8f, 0x5d, 0x0d, 0x2f, 0xb7, 0x0b, 0x49, 0x6e, 0x2b, 0xd7, 0x53, 0x08, 0x62, 0x7e, 0x2d, 0x97, 0x22, 0xf4, 0xef, 0xf5, 0xfb, 0xdf, 0x6d, 0x81}
#define BOOTLOADER_T3T1_FF {0x3f, 0x01, 0xfd, 0xfe, 0x52, 0xf8, 0x2c, 0x76, 0x03, 0x67, 0x17, 0x07, 0x1d, 0xf3, 0xdc, 0xed, 0x89, 0xca, 0xe7, 0x9f, 0xca, 0xef, 0x01, 0xa4, 0xd0, 0xb3, 0x32, 0xcd, 0x68, 0x06, 0xd3, 0x35}
-// bootloader_T3T1_qa.bin version 2.1.16.0
-#define BOOTLOADER_T3T1_QA_00 {0x6d, 0xc0, 0x3b, 0x05, 0x32, 0xfc, 0x09, 0xb5, 0x5f, 0x21, 0x66, 0x0e, 0xa2, 0x8b, 0x42, 0x56, 0x5b, 0x1b, 0x36, 0x5b, 0x8a, 0x6c, 0xa8, 0xaa, 0xd0, 0xac, 0xf2, 0x78, 0xd0, 0xa8, 0x62, 0xe3}
-#define BOOTLOADER_T3T1_QA_FF {0x86, 0xb5, 0x3a, 0xa9, 0x51, 0x11, 0x9e, 0x8d, 0x9f, 0xcf, 0xbb, 0x25, 0xc6, 0x66, 0xc7, 0xfb, 0x85, 0x2c, 0x2d, 0x7b, 0xb9, 0x4d, 0xd9, 0xa6, 0x4e, 0x98, 0x5e, 0x5a, 0x48, 0x08, 0x6e, 0xaa}
+// bootloader_T3T1_devel.bin version 2.1.16.0
+#define BOOTLOADER_T3T1_DEVEL_00 {0x6d, 0xc0, 0x3b, 0x05, 0x32, 0xfc, 0x09, 0xb5, 0x5f, 0x21, 0x66, 0x0e, 0xa2, 0x8b, 0x42, 0x56, 0x5b, 0x1b, 0x36, 0x5b, 0x8a, 0x6c, 0xa8, 0xaa, 0xd0, 0xac, 0xf2, 0x78, 0xd0, 0xa8, 0x62, 0xe3}
+#define BOOTLOADER_T3T1_DEVEL_FF {0x86, 0xb5, 0x3a, 0xa9, 0x51, 0x11, 0x9e, 0x8d, 0x9f, 0xcf, 0xbb, 0x25, 0xc6, 0x66, 0xc7, 0xfb, 0x85, 0x2c, 0x2d, 0x7b, 0xb9, 0x4d, 0xd9, 0xa6, 0x4e, 0x98, 0x5e, 0x5a, 0x48, 0x08, 0x6e, 0xaa}
// clang-format on
diff --git a/core/embed/models/T3W1/bootloaders/bootloader_T3W1_devel.bin b/core/embed/models/T3W1/bootloaders/bootloader_T3W1_devel.bin
new file mode 100755
index 00000000..014a9416
Binary files /dev/null and b/core/embed/models/T3W1/bootloaders/bootloader_T3W1_devel.bin differ
diff --git a/core/embed/models/T3W1/bootloaders/bootloader_T3W1_qa.bin b/core/embed/models/T3W1/bootloaders/bootloader_T3W1_qa.bin
deleted file mode 100755
index 014a9416..00000000
Binary files a/core/embed/models/T3W1/bootloaders/bootloader_T3W1_qa.bin and /dev/null differ
diff --git a/core/embed/models/T3W1/bootloaders/bootloader_hashes.h b/core/embed/models/T3W1/bootloaders/bootloader_hashes.h
index 4960f52b..c072fa52 100644
--- a/core/embed/models/T3W1/bootloaders/bootloader_hashes.h
+++ b/core/embed/models/T3W1/bootloaders/bootloader_hashes.h
@@ -8,9 +8,9 @@
#define BOOTLOADER_T3W1_00 {0x2e, 0xc6, 0xa2, 0x30, 0xd9, 0x3c, 0x41, 0x96, 0x2f, 0xf7, 0xce, 0xfb, 0xea, 0x01, 0xca, 0xd5, 0x8c, 0x9f, 0xe3, 0xed, 0xc1, 0xfe, 0xe1, 0xd4, 0x21, 0xb3, 0xd3, 0xc1, 0xc1, 0x51, 0x9b, 0x14}
#define BOOTLOADER_T3W1_FF {0x2e, 0xc6, 0xa2, 0x30, 0xd9, 0x3c, 0x41, 0x96, 0x2f, 0xf7, 0xce, 0xfb, 0xea, 0x01, 0xca, 0xd5, 0x8c, 0x9f, 0xe3, 0xed, 0xc1, 0xfe, 0xe1, 0xd4, 0x21, 0xb3, 0xd3, 0xc1, 0xc1, 0x51, 0x9b, 0x14}
-// bootloader_T3W1_qa.bin version 2.1.16.0
-#define BOOTLOADER_T3W1_QA_00 {0x5a, 0x70, 0x1a, 0x07, 0xa4, 0xba, 0x79, 0x93, 0x31, 0xc8, 0xf9, 0x98, 0xdb, 0xb9, 0x67, 0xd4, 0x34, 0x63, 0x09, 0x13, 0x1b, 0x34, 0x43, 0xbc, 0x4f, 0xe7, 0x86, 0x7d, 0xdb, 0xfd, 0x78, 0x5e}
-#define BOOTLOADER_T3W1_QA_FF {0x5a, 0x70, 0x1a, 0x07, 0xa4, 0xba, 0x79, 0x93, 0x31, 0xc8, 0xf9, 0x98, 0xdb, 0xb9, 0x67, 0xd4, 0x34, 0x63, 0x09, 0x13, 0x1b, 0x34, 0x43, 0xbc, 0x4f, 0xe7, 0x86, 0x7d, 0xdb, 0xfd, 0x78, 0x5e}
+// bootloader_T3W1_devel.bin version 2.1.16.0
+#define BOOTLOADER_T3W1_DEVEL_00 {0x5a, 0x70, 0x1a, 0x07, 0xa4, 0xba, 0x79, 0x93, 0x31, 0xc8, 0xf9, 0x98, 0xdb, 0xb9, 0x67, 0xd4, 0x34, 0x63, 0x09, 0x13, 0x1b, 0x34, 0x43, 0xbc, 0x4f, 0xe7, 0x86, 0x7d, 0xdb, 0xfd, 0x78, 0x5e}
+#define BOOTLOADER_T3W1_DEVEL_FF {0x5a, 0x70, 0x1a, 0x07, 0xa4, 0xba, 0x79, 0x93, 0x31, 0xc8, 0xf9, 0x98, 0xdb, 0xb9, 0x67, 0xd4, 0x34, 0x63, 0x09, 0x13, 0x1b, 0x34, 0x43, 0xbc, 0x4f, 0xe7, 0x86, 0x7d, 0xdb, 0xfd, 0x78, 0x5e}
// clang-format on
diff --git a/core/embed/projects/firmware/boot_image_embdata.c b/core/embed/projects/firmware/boot_image_embdata.c
index bbc0af73..b6a9d518 100644
--- a/core/embed/projects/firmware/boot_image_embdata.c
+++ b/core/embed/projects/firmware/boot_image_embdata.c
@@ -24,10 +24,10 @@
#define CONCAT_NAME_HELPER(prefix, name, suffix) prefix##name##suffix
#define CONCAT_NAME(name, var) CONCAT_NAME_HELPER(BOOTLOADER_, name, var)
-#if BOOTLOADER_QA
-// QA bootloaders
-#define BOOTLOADER_00 CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _QA_00)
-#define BOOTLOADER_FF CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _QA_FF)
+#if BOOTLOADER_DEVEL
+// DEVKIT bootloaders
+#define BOOTLOADER_00 CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _DEVEL_00)
+#define BOOTLOADER_FF CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _DEVEL_FF)
#else
// normal bootloaders
#define BOOTLOADER_00 CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _00)
diff --git a/core/embed/projects/firmware/main.c b/core/embed/projects/firmware/main.c
index 43051f67..01b59baf 100644
--- a/core/embed/projects/firmware/main.c
+++ b/core/embed/projects/firmware/main.c
@@ -77,7 +77,7 @@ int main_func(uint32_t cmd, void *arg) {
bool update_required = false;
-#if PRODUCTION || BOOTLOADER_QA
+#if PRODUCTION || FORCE_BOOTLOADER_UPGRADE
// Check if the bootloader is valid and replace it if not
bool bl_update_required = boot_image_check(boot_image_get_embdata());
update_required = update_required || bl_update_required;
@@ -93,7 +93,7 @@ int main_func(uint32_t cmd, void *arg) {
screen_update();
fading = true;
-#if PRODUCTION || BOOTLOADER_QA
+#if PRODUCTION || FORCE_BOOTLOADER_UPGRADE
if (bl_update_required) {
boot_image_replace(boot_image_get_embdata());
}
@@ -106,7 +106,7 @@ int main_func(uint32_t cmd, void *arg) {
#endif
}
-#if PRODUCTION || BOOTLOADER_QA
+#if PRODUCTION || FORCE_BOOTLOADER_UPGRADE
if (bl_update_required) {
reboot_device();
}
diff --git a/core/embed/sec/image/boot_header.c b/core/embed/sec/image/boot_header.c
index 842b9ed7..ec2ca636 100644
--- a/core/embed/sec/image/boot_header.c
+++ b/core/embed/sec/image/boot_header.c
@@ -30,7 +30,7 @@
#include <ed25519-donna/ed25519.h>
static const uint8_t * const BOARDLOADER_PQ_KEYS[] = {
-#if !PRODUCTION
+#if BOOTLOADER_DEVEL
(const uint8_t*) "\xec\x01\xe6\x02\x63\x02\x4f\x7e\x71\x72\x80\x13\xb7\x31\xf7\xba\x12\x99\xf5\x18\xc2\x7b\xa3\xed\x8f\x4a\x21\x99\x74\x12\x7c\x62",
(const uint8_t*) "\x8a\xf8\x87\x80\x85\x94\x6e\xd8\xb1\x16\xbd\x24\xc0\xf2\xaa\xc4\x8b\x7e\x8f\x11\xbf\x06\x87\x25\xcc\xfb\xb1\x52\xab\xf7\xa4\xcd",
#else
@@ -39,7 +39,7 @@ static const uint8_t * const BOARDLOADER_PQ_KEYS[] = {
};
static const uint8_t * const BOARDLOADER_EC_KEYS[] = {
-#if !PRODUCTION
+#if BOOTLOADER_DEVEL
(const uint8_t*) "\xdb\x99\x5f\xe2\x51\x69\xd1\x41\xca\xb9\xbb\xba\x92\xba\xa0\x1f\x9f\x2e\x1e\xce\x7d\xf4\xcb\x2a\xc0\x51\x90\xf3\x7f\xcc\x1f\x9d",
(const uint8_t*) "\x21\x52\xf8\xd1\x9b\x79\x1d\x24\x45\x32\x42\xe1\x5f\x2e\xab\x6c\xb7\xcf\xfa\x7b\x6a\x5e\xd3\x00\x97\x96\x0e\x06\x98\x81\xdb\x12",
#else
diff --git a/core/embed/sec/image/image.c b/core/embed/sec/image/image.c
index 922b19c2..e40a29b0 100644
--- a/core/embed/sec/image/image.c
+++ b/core/embed/sec/image/image.c
@@ -38,7 +38,7 @@ _Static_assert(VENDOR_HEADER_MAX_SIZE + IMAGE_HEADER_SIZE <= IMAGE_CHUNK_SIZE,
const uint8_t BOARDLOADER_KEY_M = 2;
const uint8_t BOARDLOADER_KEY_N = 3;
static const uint8_t * const BOARDLOADER_KEYS[] = {
-#if !PRODUCTION
+#if BOOTLOADER_DEVEL
(const uint8_t *)"\xdb\x99\x5f\xe2\x51\x69\xd1\x41\xca\xb9\xbb\xba\x92\xba\xa0\x1f\x9f\x2e\x1e\xce\x7d\xf4\xcb\x2a\xc0\x51\x90\xf3\x7f\xcc\x1f\x9d",
(const uint8_t *)"\x21\x52\xf8\xd1\x9b\x79\x1d\x24\x45\x32\x42\xe1\x5f\x2e\xab\x6c\xb7\xcf\xfa\x7b\x6a\x5e\xd3\x00\x97\x96\x0e\x06\x98\x81\xdb\x12",
(const uint8_t *)"\x22\xfc\x29\x77\x92\xf0\xb6\xff\xc0\xbf\xcf\xdb\x7e\xdb\x0c\x0a\xa1\x4e\x02\x5a\x36\x5e\xc0\xe3\x42\xe8\x6e\x38\x29\xcb\x74\xb6",
@@ -50,7 +50,7 @@ static const uint8_t * const BOARDLOADER_KEYS[] = {
const uint8_t BOOTLOADER_KEY_M = 2;
const uint8_t BOOTLOADER_KEY_N = 3;
static const uint8_t * const BOOTLOADER_KEYS[] = {
-#if !PRODUCTION
+#if BOOTLOADER_DEVEL
/*** DEVEL/QA KEYS ***/
(const uint8_t *)"\xd7\x59\x79\x3b\xbc\x13\xa2\x81\x9a\x82\x7c\x76\xad\xb6\xfb\xa8\xa4\x9a\xee\x00\x7f\x49\xf2\xd0\x99\x2d\x99\xb8\x25\xad\x2c\x48",
(const uint8_t *)"\x63\x55\x69\x1c\x17\x8a\x8f\xf9\x10\x07\xa7\x47\x8a\xfb\x95\x5e\xf7\x35\x2c\x63\xe7\xb2\x57\x03\x98\x4c\xf7\x8b\x26\xe2\x1a\x56",
@@ -64,7 +64,7 @@ static const uint8_t * const BOOTLOADER_KEYS[] = {
const uint8_t SECMON_KEY_M = 2;
const uint8_t SECMON_KEY_N = 3;
static const uint8_t * const SECMON_KEYS[] = {
-#if !PRODUCTION
+#if BOOTLOADER_DEVEL
/*** DEVEL/QA KEYS ***/
(const uint8_t *)"\xdb\x99\x5f\xe2\x51\x69\xd1\x41\xca\xb9\xbb\xba\x92\xba\xa0\x1f\x9f\x2e\x1e\xce\x7d\xf4\xcb\x2a\xc0\x51\x90\xf3\x7f\xcc\x1f\x9d",
(const uint8_t *)"\x21\x52\xf8\xd1\x9b\x79\x1d\x24\x45\x32\x42\xe1\x5f\x2e\xab\x6c\xb7\xcf\xfa\x7b\x6a\x5e\xd3\x00\x97\x96\x0e\x06\x98\x81\xdb\x12",
diff --git a/core/embed/sys/syscall/stm32/syscall_dispatch.c b/core/embed/sys/syscall/stm32/syscall_dispatch.c
index c4740d31..14d15c40 100644
--- a/core/embed/sys/syscall/stm32/syscall_dispatch.c
+++ b/core/embed/sys/syscall/stm32/syscall_dispatch.c
@@ -27,6 +27,7 @@
#include <io/notify.h>
#include <io/translations.h>
#include <io/usb.h>
+#include <sec/boot_image.h>
#include <sec/fwutils.h>
#include <sec/rng_strong.h>
#include <sec/unit_properties.h>
@@ -85,10 +86,6 @@
#include <sec/telemetry.h>
#endif
-#if PRODUCTION || BOOTLOADER_QA
-#include <sec/boot_image.h>
-#endif
-
#include "syscall_context.h"
#include "syscall_internal.h"
#include "syscall_verifiers.h"
Why this scored 30/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.