refactor(core/prodtest): make global tropic configuration constant
What changed, and why it matters
This commit is a minor code cleanup in Trezor's production-test tool. It adds the 'const' keyword to two large configuration tables so the compiler knows they should not be modified at runtime. There is no functional change, no bug fix, and no security vulnerability indicated in the diff or commit message.
No security action required. Treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change converts two static global structs (g_irreversible_configuration and g_reversible_configuration) from mutable to read-only by adding the ‘const’ qualifier. This is a compile-time enforcement change in the prodtest_tropic.c production-test command file. It does not alter logic, data values, or memory layout in a security-relevant way.
Changed components
core/embed/projects/prodtest/cmd/prodtest_tropic.cInspect captured patch +2 / −2
diff --git a/core/embed/projects/prodtest/cmd/prodtest_tropic.c b/core/embed/projects/prodtest/cmd/prodtest_tropic.c
index 5c7f84318..2901d209f 100644
--- a/core/embed/projects/prodtest/cmd/prodtest_tropic.c
+++ b/core/embed/projects/prodtest/cmd/prodtest_tropic.c
@@ -61,7 +61,7 @@ static tropic_handshake_state_t g_tropic_handshake_state =
// TODO: Adjust the configuration to match the revision of the provisioned
// tropics.
// clang-format off
-static struct lt_config_t g_irreversible_configuration = {
+static const struct lt_config_t g_irreversible_configuration = {
.obj = {
// # CFG_START_UP (0x00)
// | Setting | Value |
@@ -270,7 +270,7 @@ static struct lt_config_t g_irreversible_configuration = {
// TODO: Adjust the configuration to match the revision of the provisioned
// tropics.
-static struct lt_config_t g_reversible_configuration = {
+static const struct lt_config_t g_reversible_configuration = {
.obj = {
// # CFG_START_UP (0x00)
// | Setting | Value |
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.