What changed, and why it matters
This commit fixes a build error in the Bitcoin-only version of the Keystone 3 firmware. It wraps Litecoin-specific code with a compile-time flag so that code is excluded when building the firmware variant that only supports Bitcoin. There is no direct security vulnerability being patched; it is a build-configuration fix.
No security action required. Treat as a normal build fix. Verify that btc-only builds compile and that LTC functionality remains intact in the full WEB3_VERSION build.
Security signals we found
Compile-time feature gating added for btc-only build
Missing break statement in switch case restored indirectly via #ifdef guard
No input validation, memory safety, or cryptographic changes observed
Evidence from the diff
The change adds #ifdef WEB3_VERSION guards around Litecoin (LTC) handling code in the UTXO receive widgets. In the btc-only build, LTC symbols such as HOME_WALLET_CARD_LTC, LTC_DERIVATION_PATH_DESC, g_ltcAddressSettings, and TUTORIAL_LTC_RECEIVE are not defined, causing compilation failures. The patch also restores a missing break statement after the BTC case that had been removed by the LTC addition, ensuring correct switch fall-through behavior in the WEB3_VERSION build. No runtime security bug is evident from the diff.
Changed components
src/ui/gui_widgets/gui_utxo_receive_widgets.cInspect captured patch +8 / −0
diff --git a/src/ui/gui_widgets/gui_utxo_receive_widgets.c b/src/ui/gui_widgets/gui_utxo_receive_widgets.c
index e0d3894..1e0ed75 100644
--- a/src/ui/gui_widgets/gui_utxo_receive_widgets.c
+++ b/src/ui/gui_widgets/gui_utxo_receive_widgets.c
@@ -218,11 +218,13 @@ static void InitDerivationPathDesc(uint8_t chain)
case HOME_WALLET_CARD_BTC:
g_derivationPathDescs = GetDerivationPathDescs(BTC_DERIVATION_PATH_DESC);
g_addressSettingsNum = NUMBER_OF_ARRAYS(g_mainNetAddressSettings);
+#ifdef WEB3_VERSION
break;
case HOME_WALLET_CARD_LTC:
g_derivationPathDescs = GetDerivationPathDescs(LTC_DERIVATION_PATH_DESC);
g_addressSettingsNum = NUMBER_OF_ARRAYS(g_ltcAddressSettings);
break;
+#endif
#ifdef BTC_ONLY
g_testNetderivationPathDescs = GetDerivationPathDescs(BTC_TEST_NET_DERIVATION_PATH_DESC);
#endif
@@ -457,10 +459,12 @@ static void GuiCreateMoreWidgets(lv_obj_t *parent)
ExportXpubHandler, NULL, true);
lv_obj_align(btn, LV_ALIGN_TOP_MID, 0, 120 + 476);
break;
+#ifdef WEB3_VERSION
case HOME_WALLET_CARD_LTC:
btn = GuiCreateSelectButton(cont, _("receive_btc_more_address_settings"), &imgAddressType,
AddressSettingsHandler, NULL, true);
lv_obj_align(btn, LV_ALIGN_TOP_MID, 0, 120 + 476);
+#endif
default:
break;
}
@@ -949,9 +953,11 @@ static void GetChangePathLabelHint(char* hint, uint32_t maxLen)
case HOME_WALLET_CARD_BTC:
snprintf_s(hint, maxLen, "%s", _("derivation_path_select_btc"));
break;
+#ifdef WEB3_VERSION
case HOME_WALLET_CARD_LTC:
snprintf_s(hint, maxLen, "%s", _("derivation_path_select_ltc"));
return;
+#endif
default:
break;
}
@@ -1203,9 +1209,11 @@ static void TutorialHandler(lv_event_t *e)
if (g_chainCard == HOME_WALLET_CARD_BTC) {
TUTORIAL_LIST_INDEX_ENUM tIndex = TUTORIAL_BTC_RECEIVE;
GuiFrameOpenViewWithParam(&g_tutorialView, &tIndex, sizeof(tIndex));
+#ifdef WEB3_VERSION
} else if (g_chainCard == HOME_WALLET_CARD_LTC) {
TUTORIAL_LIST_INDEX_ENUM tIndex = TUTORIAL_LTC_RECEIVE;
GuiFrameOpenViewWithParam(&g_tutorialView, &tIndex, sizeof(tIndex));
+#endif
}
}
Why this scored 20/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.