Rearranging the key information so it fits without ...
What changed, and why it matters
This commit only changes the on-screen text shown when registering a Bitcoin wallet policy on a Ledger device. It rewords labels like 'ours' to 'Our' and shortens the format so the text fits on the device's small screen. There is no security-relevant change.
No security action needed. Treat as a routine UI/text refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff refactors label formatting in src/ui/display.c. It replaces three separate snprintf calls inside a switch statement with a single snprintf after the switch, and updates capitalization/shortening of displayed strings for different screen sizes. No buffer sizes, control flow, cryptographic operations, or trust assumptions are altered.
Changed components
src/ui/display.cInspect captured patch +7 / −17
diff --git a/src/ui/display.c b/src/ui/display.c
index 4b206a9..a00ba65 100644
--- a/src/ui/display.c
+++ b/src/ui/display.c
@@ -150,35 +150,25 @@ bool ui_display_register_wallet_policy(
for (size_t i = 0; i < wallet_header->n_keys; i++) {
state->keys_info[i] = (*keys_info)[i];
#ifdef SCREEN_SIZE_WALLET
- const char labels[3][20] = {"internal", "external", "unspendable"};
+ const char labels[3][20] = {"Internal", "External", "Unspendable"};
#else
- const char labels[3][20] = {"ours", "theirs", "dummy"};
+ const char labels[3][20] = {"Our", "Their", "Dummy"};
#endif
+ unsigned int num = 0;
switch ((*keys_type)[i]) {
case PUBKEY_TYPE_INTERNAL:
- snprintf(state->keys_label[i],
- sizeof(state->keys_label[i]),
- "Key @%u, %s",
- i,
- labels[0]);
+ num = 0;
break;
case PUBKEY_TYPE_EXTERNAL:
- snprintf(state->keys_label[i],
- sizeof(state->keys_label[i]),
- "Key @%u, %s",
- i,
- labels[1]);
+ num = 1;
break;
case PUBKEY_TYPE_UNSPENDABLE:
- snprintf(state->keys_label[i],
- sizeof(state->keys_label[i]),
- "Key @%u, %s",
- i,
- labels[2]);
+ num = 2;
break;
default:
LEDGER_ASSERT(false, "Unreachable code");
}
+ snprintf(state->keys_label[i], sizeof(state->keys_label[i]), "%s key@%u", labels[num], i);
}
ui_display_register_wallet_policy_flow();
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.