What changed, and why it matters
This commit is a straightforward build fix for a firmware configuration file. It adds conditional preprocessor definitions so that different product build variants (Web3, BTC-only, Cypherpunk) each define a required constant, LEGACY_USB_PAD_LEN, with values of either 1 or 2. Without this change, some build configurations would fail because the constant was missing. There is no security-relevant change in behavior visible in the diff.
No security action required; treat as a normal build-system fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies src/config/legacy_web_update_pad.c to wrap the existing LEGACY_USB_PAD_LEN default definition in product-specific #ifdef guards (WEB3_VERSION, BTC_ONLY, CYPHERPUNK_VERSION). Previously the constant was defined unconditionally; now each supported build flavor provides its own default. A subsequent compile-time range check (#if LEGACY_USB_PAD_LEN < 1 || > 15) remains unchanged. The change is purely build-system/configuration hygiene.
Changed components
src/config/legacy_web_update_pad.cInspect captured patch +14 / −0
diff --git a/src/config/legacy_web_update_pad.c b/src/config/legacy_web_update_pad.c
index d850d0e..f40eb65 100644
--- a/src/config/legacy_web_update_pad.c
+++ b/src/config/legacy_web_update_pad.c
@@ -1,9 +1,23 @@
#include <stdint.h>
#include "legacy_web_update_pad.h"
+#ifdef WEB3_VERSION
#ifndef LEGACY_USB_PAD_LEN
#define LEGACY_USB_PAD_LEN 2U
#endif
+#endif
+
+#ifdef BTC_ONLY
+#ifndef LEGACY_USB_PAD_LEN
+#define LEGACY_USB_PAD_LEN 1U
+#endif
+#endif
+
+#ifdef CYPHERPUNK_VERSION
+#ifndef LEGACY_USB_PAD_LEN
+#define LEGACY_USB_PAD_LEN 2U
+#endif
+#endif
#if (LEGACY_USB_PAD_LEN < 1) || (LEGACY_USB_PAD_LEN > 15)
#error "LEGACY_USB_PAD_LEN must be in range [1, 15]"
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.