chore(core): add `crypto_ctx` to `tropic_driver_t`
What changed, and why it matters
This is a small code maintenance change in Trezor firmware for a secure chip driver. It adds a new cryptographic context field to an internal data structure and wires it into an existing library handle. There is no indication this fixes or introduces a security vulnerability; it appears to be routine plumbing needed by an updated external library (libtropic).
No security action required. Treat as normal firmware maintenance. If reviewing a release, verify the matching libtropic version bump and that `lt_ctx_trezor_crypto_t` is properly zero-initialized by `lt_init()` or surrounding code.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds lt_ctx_trezor_crypto_t crypto_ctx to tropic_driver_t and assigns drv->handle.l3.crypto_ctx = &drv->crypto_ctx before calling lt_init(). It also adds an include for libtropic/cal/trezor_crypto/libtropic_trezor_crypto.h. This is a structural change to satisfy the libtropic L3 crypto abstraction layer API, likely required after an upstream library update. No security bug is visible in the diff.
Changed components
core/embed/sec/tropic/tropic.cTropic secure element driverlibtropic integration layerInspect captured patch +5 / −0
diff --git a/core/embed/sec/tropic/tropic.c b/core/embed/sec/tropic/tropic.c
index 9ced22082..78e626606 100644
--- a/core/embed/sec/tropic/tropic.c
+++ b/core/embed/sec/tropic/tropic.c
@@ -28,6 +28,7 @@
#include "hmac.h"
#include <libtropic.h>
+#include <libtropic/cal/trezor_crypto/libtropic_trezor_crypto.h>
#ifdef TREZOR_EMULATOR
#include <arpa/inet.h>
@@ -118,6 +119,7 @@ typedef struct {
lt_pkey_index_t pairing_key_index; // This field is valid only if
// session_started is true.
lt_handle_t handle;
+ lt_ctx_trezor_crypto_t crypto_ctx;
#ifdef TREZOR_EMULATOR
lt_dev_posix_tcp_t device;
#endif
@@ -335,6 +337,9 @@ bool tropic_init(void) {
drv->handle.l2.device = &drv->device;
#endif
+ // Initialize crypto context
+ drv->handle.l3.crypto_ctx = &drv->crypto_ctx;
+
if (lt_init(&drv->handle) != LT_OK) {
return false;
}
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.