Skip to content

Commit

Permalink
Merge pull request #783 from LedgerHQ/unify-blind-signing-warning-wor…
Browse files Browse the repository at this point in the history
…ding

Unify Blind Signing Warning wording
  • Loading branch information
nroggeman-ledger authored Sep 25, 2024
2 parents cdcd9d8 + 334562a commit 0a5281b
Showing 1 changed file with 16 additions and 30 deletions.
46 changes: 16 additions & 30 deletions lib_nbgl/src/nbgl_use_case.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static char reducedAddress[QRCODE_REDUCED_ADDR_LEN];
static void displayReviewPage(uint8_t page, bool forceFullRefresh);
static void displayDetailsPage(uint8_t page, bool forceFullRefresh);
static void displayFullValuePage(const nbgl_contentTagValue_t *pair);
static void displayBlindWarning(nbgl_opType_t opType);
static void displayBlindWarning(void);
static void displayTipBoxModal(void);
static void displaySettingsPage(uint8_t page, bool forceFullRefresh);
static void displayGenericContextPage(uint8_t pageIdx, bool forceFullRefresh);
Expand Down Expand Up @@ -587,14 +587,7 @@ static void pageCallback(int token, uint8_t index)
displayFullValuePage(pair);
}
else if (token == BLIND_WARNING_TOKEN) {
if (navType == STREAMING_NAV) {
displayBlindWarning(bundleNavContext.reviewStreaming.operationType
& ~(SKIPPABLE_OPERATION | BLIND_OPERATION));
}
else {
displayBlindWarning(bundleNavContext.review.operationType
& ~(SKIPPABLE_OPERATION | BLIND_OPERATION));
}
displayBlindWarning();
}
else if (token == TIP_BOX_TOKEN) {
displayTipBoxModal();
Expand Down Expand Up @@ -1183,7 +1176,7 @@ static void displayFullValuePage(const nbgl_contentTagValue_t *pair)
}

// function used to display the modal warning when touching the alert symbol of a blind review
static void displayBlindWarning(nbgl_opType_t opType)
static void displayBlindWarning(void)
{
nbgl_layoutDescription_t layoutDescription = {.modal = true,
.withLeftBorder = true,
Expand All @@ -1197,18 +1190,11 @@ static void displayBlindWarning(nbgl_opType_t opType)
nbgl_layoutCenteredInfo_t centeredInfo
= {.icon = NULL, .text3 = NULL, .style = LARGE_CASE_INFO, .offsetY = 0, .onTop = false};
centeredInfo.text1 = "Security risk detected";
if (opType == TYPE_TRANSACTION) {
centeredInfo.text2
= "This transaction cannot be fully decoded. If you sign it, you could be authorizing "
"malicious actions that can drain your wallet.\n\n"
"Learn more: ledger.com/e8";
}
else {
centeredInfo.text2
= "This message cannot be fully decoded. If you sign it, you could be authorizing "
"malicious actions that can drain your wallet.\n\n"
"Learn more: ledger.com/e8";
}
centeredInfo.text2
= "This transaction or message cannot be decoded fully. If you choose to sign, you could "
"be authorizing malicious actions that can drain your wallet.\n\n"
"Learn more: ledger.com/e8";

genericContext.modalLayout = nbgl_layoutGet(&layoutDescription);
// add header with the tag part of the pair, to go back
nbgl_layoutAddHeader(genericContext.modalLayout, &headerDesc);
Expand Down Expand Up @@ -1744,14 +1730,14 @@ static void blindSigningWarning(void)
#ifdef HAVE_PIEZO_SOUND
io_seproxyhal_play_tune(TUNE_LOOK_AT_ME);
#endif // HAVE_PIEZO_SOUND
nbgl_useCaseChoice(
&C_Warning_64px,
"Blind signing ahead",
"This transaction's details are not fully verifiable. If you sign it, you could lose all "
"your assets.",
"Back to safety",
"Continue anyway",
blindSigningWarningCallback);
nbgl_useCaseChoice(&C_Warning_64px,
"Blind signing ahead",
"The details of this transaction or message are not fully verifiable. If "
"you sign it, you could lose all "
"your assets.",
"Back to safety",
"Continue anyway",
blindSigningWarningCallback);
}

// function to factorize code for all simple reviews
Expand Down

0 comments on commit 0a5281b

Please sign in to comment.