What changed, and why it matters
This commit is a build fix that restructures conditional compilation blocks for different firmware variants (Web3, Cypherpunk, BTC-only). It does not appear to change runtime behavior for any single firmware build; it mainly ensures the correct code paths compile under each build configuration. There is no clear security-relevant change.
No immediate security action required. Treat as routine build maintenance. If reviewing the CYPHERPUNK_VERSION path, verify that entropy and password handling in get_icarus_master_key/derive_bip32_ed25519_extended_pubkey follow the same security assumptions as the WEB3_VERSION path.
Security signals we found
Conditional compilation restructure only
No new input validation or memory safety changes visible
No explicit security fix described in commit message
Evidence from the diff
The patch splits previously #else-guarded code into explicit #ifdef WEB3_VERSION, #ifdef CYPHERPUNK_VERSION, and #ifdef BTC_ONLY branches. In account_public_info.c, the BTC_ONLY variant now calls ProcessKeyType directly without the Cardano SLIP23 special case. In gui_key_derivation_request_widgets.c, the CYPHERPUNK_VERSION variant adds an alternate path to derive the BIP32-Ed25519 extended public key via get_icarus_master_key using account entropy and passphrase. These changes are guarded by compile-time macros and appear intended to fix build errors across product variants rather than alter security logic.
Changed components
src/crypto/account_public_info.csrc/ui/gui_widgets/multi/gui_key_derivation_request_widgets.cInspect captured patch +20 / −2
diff --git a/src/crypto/account_public_info.c b/src/crypto/account_public_info.c
index 80ad780..6a04ef9 100644
--- a/src/crypto/account_public_info.c
+++ b/src/crypto/account_public_info.c
@@ -942,12 +942,16 @@ int32_t AccountPublicSavePublicInfo(uint8_t accountIndex, const char *password,
} else {
xPubResult = ProcessKeyType(seed, len, g_chainTable[i].cryptoKey, g_chainTable[i].path, icarusMasterKey, ledgerBitbox02Key);
}
-#else
+#endif
+#ifdef WEB3_VERSION
if (g_chainTable[i].cryptoKey == BIP32_ED25519 && isSlip39) {
xPubResult = cardano_get_pubkey_by_slip23(seed, len, g_chainTable[i].path);
} else {
xPubResult = ProcessKeyType(seed, len, g_chainTable[i].cryptoKey, g_chainTable[i].path, icarusMasterKey, ledgerBitbox02Key);
}
+#endif
+#ifdef BTC_ONLY
+ xPubResult = ProcessKeyType(seed, len, g_chainTable[i].cryptoKey, g_chainTable[i].path, icarusMasterKey, ledgerBitbox02Key);
#endif
if (g_chainTable[i].cryptoKey == RSA_KEY && xPubResult == NULL) {
continue;
@@ -1112,13 +1116,17 @@ int32_t TempAccountPublicInfo(uint8_t accountIndex, const char *password, bool s
} else {
xPubResult = ProcessKeyType(seed, len, g_chainTable[i].cryptoKey, g_chainTable[i].path, icarusMasterKey, ledgerBitbox02Key);
}
-#else
+#endif
+#ifdef WEB3_VERSION
if (g_chainTable[i].cryptoKey == BIP32_ED25519 && isSlip39) {
// ada slip23
xPubResult = cardano_get_pubkey_by_slip23(seed, len, g_chainTable[i].path);
} else {
xPubResult = ProcessKeyType(seed, len, g_chainTable[i].cryptoKey, g_chainTable[i].path, icarusMasterKey, ledgerBitbox02Key);
}
+#endif
+#ifdef BTC_ONLY
+ xPubResult = ProcessKeyType(seed, len, g_chainTable[i].cryptoKey, g_chainTable[i].path, icarusMasterKey, ledgerBitbox02Key);
#endif
if (g_chainTable[i].cryptoKey == RSA_KEY && xPubResult == NULL) {
continue;
diff --git a/src/ui/gui_widgets/multi/gui_key_derivation_request_widgets.c b/src/ui/gui_widgets/multi/gui_key_derivation_request_widgets.c
index ddd3e19..5a5b1c5 100644
--- a/src/ui/gui_widgets/multi/gui_key_derivation_request_widgets.c
+++ b/src/ui/gui_widgets/multi/gui_key_derivation_request_widgets.c
@@ -540,6 +540,7 @@ static UREncodeResult *ModelGenerateSyncUR(void)
break;
case BIP32_ED25519:
if (selected_ada_derivation_algo == HD_STANDARD_ADA && !g_isUsb) {
+#ifdef WEB3_VERSION
if (isSlip39) {
pubkey[i] = cardano_get_pubkey_by_slip23(seed, seedLen, path);
} else {
@@ -550,6 +551,15 @@ static UREncodeResult *ModelGenerateSyncUR(void)
char* icarusMasterKey = cip3_response->data;
pubkey[i] = derive_bip32_ed25519_extended_pubkey(icarusMasterKey, path);
}
+#endif
+#ifdef CYPHERPUNK_VERSION
+ uint8_t entropyLen = 0;
+ uint8_t entropy[64];
+ GetAccountEntropy(GetCurrentAccountIndex(), entropy, &entropyLen, password);
+ SimpleResponse_c_char* cip3_response = get_icarus_master_key(entropy, entropyLen, GetPassphrase(GetCurrentAccountIndex()));
+ char* icarusMasterKey = cip3_response->data;
+ pubkey[i] = derive_bip32_ed25519_extended_pubkey(icarusMasterKey, path);
+#endif
} else if (selected_ada_derivation_algo == HD_LEDGER_BITBOX_ADA || g_isUsb) {
// seed -> mnemonic --> master key(m) -> derive key
uint8_t entropyLen = 0;
Why this scored 11/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.