build(core): fix T3W1 build with DISABLE_OPTIGA=1
What changed, and why it matters
This is a build-system fix that moves a single function outside of a conditional compilation block. When the Optiga secure chip support was disabled (DISABLE_OPTIGA=1), the T3W1 hardware build failed because a function named secret_key_delegated_identity was accidentally placed inside the Optiga-only code section. The patch makes that function always available, which is correct because it is unrelated to Optiga. There is no security vulnerability here.
No security action needed. Treat as a normal build fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit changes core/embed/sec/secret/stm32u5/secret_keys.c by relocating the #endif for USE_OPTIGA. Previously, secret_key_delegated_identity() was compiled only when USE_OPTIGA was defined. With DISABLE_OPTIGA=1, USE_OPTIGA is undefined, so the function was missing and the T3W1 build broke. The patch moves the #endif above secret_key_delegated_identity(), making it unconditional, matching its intended behavior. The function itself is unchanged.
Changed components
core/embed/sec/secret/stm32u5/secret_keys.cInspect captured patch +2 / −2
diff --git a/core/embed/sec/secret/stm32u5/secret_keys.c b/core/embed/sec/secret/stm32u5/secret_keys.c
index 5a9a37a0b..9b4340b4d 100644
--- a/core/embed/sec/secret/stm32u5/secret_keys.c
+++ b/core/embed/sec/secret/stm32u5/secret_keys.c
@@ -49,13 +49,13 @@ secbool secret_key_optiga_masking(uint8_t dest[ECDSA_PRIVATE_KEY_SIZE]) {
KEY_INDEX_OPTIGA_MASKING, dest);
}
+#endif // USE_OPTIGA
+
secbool secret_key_delegated_identity(uint8_t dest[ECDSA_PRIVATE_KEY_SIZE]) {
return secret_key_derive_nist256p1(SECRET_UNPRIVILEGED_MASTER_KEY_SLOT,
KEY_INDEX_DELEGATED_IDENTITY, dest);
}
-#endif // USE_OPTIGA
-
#ifdef USE_TROPIC
static secbool secret_key_derive_curve25519(uint8_t slot, uint16_t index,
curve25519_key dest) {
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.