chore(core): use `memzero` wrapper instead of `lt_secure_memzero`
What changed, and why it matters
This is a small cleanup change in Trezor's firmware build setup. It swaps one secure-memory-wiping helper for another equivalent one already used elsewhere in the project. There is no direct evidence this fixes a security bug; it appears to be a routine code-maintenance chore.
No immediate action required. Treat as routine refactoring. If auditing, verify that the project's `memzero()` wrapper is itself implemented with a secure, non-optimizable wipe (e.g., explicit_bzero or equivalent) and that removing `lt_secure_memzero.c` does not drop any needed compiler barriers on the supported toolchains.
Security signals we found
Secure-memory-wipe helper changed from vendor-provided to project-local wrapper
No change to call sites or wipe semantics visible in the diff
Commit title and message describe the change as a chore/maintenance task, not a security fix
Evidence from the diff
The commit replaces the vendor libtropic lt_secure_memzero.c implementation with a project-local wrapper that calls the existing memzero() helper. The wrapper is added to both STM32 and Unix tropic01 platform files, and the libtropic source file is removed from the build for the T3W1 emulator and three hardware revisions. The behavior—zeroing a memory buffer—remains the same; only the provider of the implementation changes.
Changed components
core/embed/sec/tropic/stm32/tropic01.ccore/embed/sec/tropic/unix/tropic01.ccore/site_scons/models/T3W1/emulator.pycore/site_scons/models/T3W1/trezor_t3w1_revA.pycore/site_scons/models/T3W1/trezor_t3w1_revB.pycore/site_scons/models/T3W1/trezor_t3w1_revC.pyInspect captured patch +10 / −4
diff --git a/core/embed/sec/tropic/stm32/tropic01.c b/core/embed/sec/tropic/stm32/tropic01.c
index 861da2b03..0e3907707 100644
--- a/core/embed/sec/tropic/stm32/tropic01.c
+++ b/core/embed/sec/tropic/stm32/tropic01.c
@@ -23,6 +23,7 @@
#include <libtropic.h>
+#include <memzero.h>
#include <sec/rng.h>
#include <sec/tropic.h>
#include <sys/systick.h>
@@ -203,4 +204,8 @@ lt_ret_t lt_port_random_bytes(lt_l2_state_t *s2, void *buff, size_t count) {
return LT_OK;
}
+void lt_secure_memzero(void *const ptr, const size_t count) {
+ memzero(ptr, count);
+}
+
#endif
diff --git a/core/embed/sec/tropic/unix/tropic01.c b/core/embed/sec/tropic/unix/tropic01.c
index d68fb893b..014c740a2 100644
--- a/core/embed/sec/tropic/unix/tropic01.c
+++ b/core/embed/sec/tropic/unix/tropic01.c
@@ -20,6 +20,7 @@
#include <trezor_rtl.h>
+#include <memzero.h>
#include <sec/tropic.h>
bool tropic_hal_init(void) { return true; }
@@ -32,4 +33,8 @@ void tropic_set_ui_progress(tropic_ui_progress_t ui_progress) {
}
}
+void lt_secure_memzero(void *const ptr, const size_t count) {
+ memzero(ptr, count);
+}
+
#endif
diff --git a/core/site_scons/models/T3W1/emulator.py b/core/site_scons/models/T3W1/emulator.py
index e4370a65c..f181d8934 100644
--- a/core/site_scons/models/T3W1/emulator.py
+++ b/core/site_scons/models/T3W1/emulator.py
@@ -85,7 +85,6 @@ def configure(
"vendor/libtropic/src/lt_l2_frame_check.c",
"vendor/libtropic/src/lt_l3_process.c",
"vendor/libtropic/src/lt_random.c",
- "vendor/libtropic/src/lt_secure_memzero.c",
"vendor/libtropic/src/lt_tr01_attrs.c",
]
paths += ["embed/sec/tropic/inc"]
diff --git a/core/site_scons/models/T3W1/trezor_t3w1_revA.py b/core/site_scons/models/T3W1/trezor_t3w1_revA.py
index 816692f6f..0d3fb2d3b 100644
--- a/core/site_scons/models/T3W1/trezor_t3w1_revA.py
+++ b/core/site_scons/models/T3W1/trezor_t3w1_revA.py
@@ -206,7 +206,6 @@ def configure(
sources += ["vendor/libtropic/src/lt_l2_frame_check.c"]
sources += ["vendor/libtropic/src/lt_l3_process.c"]
sources += ["vendor/libtropic/src/lt_random.c"]
- sources += ["vendor/libtropic/src/lt_secure_memzero.c"]
sources += ["vendor/libtropic/src/lt_tr01_attrs.c"]
paths += ["embed/sec/tropic/inc"]
paths += ["vendor/libtropic/include"]
diff --git a/core/site_scons/models/T3W1/trezor_t3w1_revB.py b/core/site_scons/models/T3W1/trezor_t3w1_revB.py
index 51ab0e644..5f5241298 100644
--- a/core/site_scons/models/T3W1/trezor_t3w1_revB.py
+++ b/core/site_scons/models/T3W1/trezor_t3w1_revB.py
@@ -208,7 +208,6 @@ def configure(
sources += ["vendor/libtropic/src/lt_l2_frame_check.c"]
sources += ["vendor/libtropic/src/lt_l3_process.c"]
sources += ["vendor/libtropic/src/lt_random.c"]
- sources += ["vendor/libtropic/src/lt_secure_memzero.c"]
sources += ["vendor/libtropic/src/lt_tr01_attrs.c"]
paths += ["embed/sec/tropic/inc"]
diff --git a/core/site_scons/models/T3W1/trezor_t3w1_revC.py b/core/site_scons/models/T3W1/trezor_t3w1_revC.py
index e317fd37f..9e0145816 100644
--- a/core/site_scons/models/T3W1/trezor_t3w1_revC.py
+++ b/core/site_scons/models/T3W1/trezor_t3w1_revC.py
@@ -207,7 +207,6 @@ def configure(
sources += ["vendor/libtropic/src/lt_l2_frame_check.c"]
sources += ["vendor/libtropic/src/lt_l3_process.c"]
sources += ["vendor/libtropic/src/lt_random.c"]
- sources += ["vendor/libtropic/src/lt_secure_memzero.c"]
sources += ["vendor/libtropic/src/lt_tr01_attrs.c"]
paths += ["embed/sec/tropic/inc"]
paths += ["vendor/libtropic/include"]
Why this scored 19/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.