feat(core/embed): do not reestablish session for the same key
What changed, and why it matters
This commit adds a small optimization to the Tropic secure-element integration in Trezor firmware: if a secure session is already active for the same pairing key, the code now skips re-establishing it. The change is defensive in nature and appears aimed at avoiding redundant session setup, not at fixing a known vulnerability. There is no direct evidence in the commit that this resolves an exploitable security flaw.
Treat as a routine hardening/optimization commit. Review the surrounding session lifecycle to confirm that skipping re-establishment does not leave stale session state or skip required re-authentication under any threat model. No urgent action is indicated by the diff alone.
Security signals we found
Avoids redundant secure-element session establishment
Prevents potential state churn or resource exhaustion from repeated session starts
No input validation changes or bounds checks added
No explicit vulnerability description in commit message or diff
Evidence from the diff
In core/embed/sec/tropic/tropic.c, tropic_custom_session_start() now checks whether drv->session_started is true and whether the requested pairing_key_index matches the already-active drv->pairing_key_index. If both conditions hold, it returns LT_OK immediately instead of re-running the session-start handshake. This prevents duplicate session establishment for the same key. The patch is additive and does not change behavior when a different key is requested or no session is active.
Changed components
core/embed/sec/tropic/tropic.cTropic secure-element session managementInspect captured patch +3 / −0
diff --git a/core/embed/sec/tropic/tropic.c b/core/embed/sec/tropic/tropic.c
index 4271307a5..dc37ed8c9 100644
--- a/core/embed/sec/tropic/tropic.c
+++ b/core/embed/sec/tropic/tropic.c
@@ -102,6 +102,9 @@ lt_ret_t tropic_custom_session_start(pkey_index_t pairing_key_index) {
return LT_FAIL;
}
+ if (drv->session_started && drv->pairing_key_index == pairing_key_index) {
+ return LT_OK;
+ }
lt_ret_t ret = LT_FAIL;
Why this scored 26/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.