@@ -978,12 +978,7 @@ void coin_main(libargs_t *args) {
|
||||
tmpCtx.transactionContext.currentItemIndex = 0;
|
||||
|
||||
for (;;) {
|
||||
#ifdef HAVE_BAGL
|
||||
UX_INIT();
|
||||
#endif // HAVE_BAGL
|
||||
#ifdef HAVE_NBGL
|
||||
nbgl_objInit();
|
||||
#endif // HAVE_NBGL
|
||||
|
||||
BEGIN_TRY {
|
||||
TRY {
|
||||
|
||||
@@ -479,7 +479,7 @@ static bool parse_der_value(const s_tlv_payload *payload, size_t *offset, uint32
|
||||
if ((*offset + byte_length) > payload->size) {
|
||||
PRINTF("TLV payload too small for DER encoded value\n");
|
||||
} else {
|
||||
if (byte_length > sizeof(buf)) {
|
||||
if (byte_length > sizeof(buf) || byte_length == 0) {
|
||||
PRINTF("Unexpectedly long DER-encoded value (%u bytes)\n", byte_length);
|
||||
} else {
|
||||
memset(buf, 0, (sizeof(buf) - byte_length));
|
||||
|
||||
@@ -201,9 +201,6 @@ static void reviewContinueCommon(void) {
|
||||
if (tx_approval_context.fromPlugin) {
|
||||
// plugin id + max items + fees
|
||||
nbPairs += dataContext.tokenContext.pluginUiMaxItems + 1;
|
||||
if (tx_approval_context.displayNetwork) {
|
||||
nbPairs++;
|
||||
}
|
||||
} else {
|
||||
nbPairs += 3;
|
||||
if (N_storage.displayNonce) {
|
||||
@@ -217,9 +214,10 @@ static void reviewContinueCommon(void) {
|
||||
nbPairs += 1;
|
||||
}
|
||||
#endif // HAVE_DOMAIN_NAME
|
||||
if (tx_approval_context.displayNetwork) {
|
||||
nbPairs++;
|
||||
}
|
||||
}
|
||||
|
||||
if (tx_approval_context.displayNetwork) {
|
||||
nbPairs++;
|
||||
}
|
||||
|
||||
useCaseTagValueList.pairs = NULL;
|
||||
|
||||
@@ -56,12 +56,14 @@ static bool navCallback(uint8_t page, nbgl_pageContent_t* content) {
|
||||
break;
|
||||
|
||||
case 2:
|
||||
#ifdef HAVE_EIP712_FULL_SUPPORT
|
||||
switches[index++] =
|
||||
(nbgl_layoutSwitch_t){.initState = N_storage.verbose_eip712 ? ON_STATE : OFF_STATE,
|
||||
.text = "Verbose EIP712",
|
||||
.subText = "Ignore filtering and\ndisplay raw content",
|
||||
.token = EIP712_VERBOSE_TOKEN,
|
||||
.tuneId = TUNE_TAP_CASUAL};
|
||||
#endif // HAVE_EIP712_FULL_SUPPORT
|
||||
#ifdef HAVE_DOMAIN_NAME
|
||||
switches[index++] = (nbgl_layoutSwitch_t){
|
||||
.initState = N_storage.verbose_domain_name ? ON_STATE : OFF_STATE,
|
||||
@@ -116,5 +118,15 @@ static void controlsCallback(int token, uint8_t index) {
|
||||
}
|
||||
|
||||
void ui_menu_settings(void) {
|
||||
nbgl_useCaseSettings(APPNAME " settings", 0, 3, false, ui_idle, navCallback, controlsCallback);
|
||||
uint8_t nb_screens = 2;
|
||||
#if defined(HAVE_EIP712_FULL_SUPPORT) || defined(HAVE_DOMAIN_NAME)
|
||||
nb_screens += 1;
|
||||
#endif
|
||||
nbgl_useCaseSettings(APPNAME " settings",
|
||||
0,
|
||||
nb_screens,
|
||||
false,
|
||||
ui_idle,
|
||||
navCallback,
|
||||
controlsCallback);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ static bool display_review_page(uint8_t page, nbgl_pageContent_t *content) {
|
||||
nbgl_getTextMaxLenInNbLines(BAGL_FONT_INTER_MEDIUM_32px,
|
||||
strings.tmp.tmp,
|
||||
SCREEN_WIDTH - (2 * BORDER_MARGIN),
|
||||
9,
|
||||
NB_MAX_LINES_IN_REVIEW,
|
||||
&len);
|
||||
strings.tmp.tmp[len] = '\0';
|
||||
|
||||
@@ -39,7 +39,6 @@ static bool display_review_page(uint8_t page, nbgl_pageContent_t *content) {
|
||||
content->tagValueList.nbPairs = 1;
|
||||
content->tagValueList.pairs = &pair;
|
||||
content->tagValueList.wrapping = false;
|
||||
content->tagValueList.nbMaxLinesForValue = 0;
|
||||
ret = true;
|
||||
break;
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ static bool display_review_page(uint8_t page, nbgl_pageContent_t *content) {
|
||||
|
||||
content->type = TAG_VALUE_LIST;
|
||||
content->tagValueList.nbPairs = 2;
|
||||
content->tagValueList.nbMaxLinesForValue = 0;
|
||||
content->tagValueList.pairs = (nbgl_layoutTagValue_t *) pairs;
|
||||
} else if (page == 1) {
|
||||
g_position = UI_SIGNING_POSITION_SIGN;
|
||||
|
||||
@@ -46,7 +46,7 @@ static bool display_message(nbgl_pageContent_t *content) {
|
||||
reached = nbgl_getTextMaxLenInNbLines(BAGL_FONT_INTER_MEDIUM_32px,
|
||||
(char *) g_stax_shared_buffer,
|
||||
SCREEN_WIDTH - (2 * BORDER_MARGIN),
|
||||
9,
|
||||
NB_MAX_LINES_IN_REVIEW,
|
||||
&len);
|
||||
|
||||
stringsTmpTmpIdx = len - eip191MessageIdx;
|
||||
@@ -71,7 +71,7 @@ static bool display_message(nbgl_pageContent_t *content) {
|
||||
content->tagValueList.nbPairs = 1;
|
||||
content->tagValueList.pairs = &pair;
|
||||
content->tagValueList.smallCaseForValue = false;
|
||||
content->tagValueList.nbMaxLinesForValue = 9;
|
||||
content->tagValueList.nbMaxLinesForValue = NB_MAX_LINES_IN_REVIEW;
|
||||
content->tagValueList.wrapping = false;
|
||||
|
||||
if ((g_action != UI_191_ACTION_IDLE) && (stringsTmpTmpIdx >= strlen(strings.tmp.tmp))) {
|
||||
|
||||
@@ -31,7 +31,7 @@ static bool displayTransactionPage(uint8_t page, nbgl_pageContent_t *content) {
|
||||
pairs[0].value = strings.common.fullAmount;
|
||||
pairs[1].item = "Buy";
|
||||
pairs[1].value = strings.common.maxFee;
|
||||
pairs[2].item = "Token amount";
|
||||
pairs[2].item = "Token Account";
|
||||
pairs[2].value = strings.common.fullAddress;
|
||||
|
||||
content->type = TAG_VALUE_LIST;
|
||||
|
||||
@@ -52,8 +52,11 @@ static bool displayTransactionPage(uint8_t page, nbgl_pageContent_t *content) {
|
||||
pairs[count].value = strings.tmp.tmp;
|
||||
count++;
|
||||
}
|
||||
|
||||
pairs[count].item = "Token Account";
|
||||
pairs[count].value = strings.tmp.tmp2;
|
||||
count++;
|
||||
|
||||
content->type = TAG_VALUE_LIST;
|
||||
content->tagValueList.nbPairs = count;
|
||||
content->tagValueList.pairs = (nbgl_layoutTagValue_t *) pairs;
|
||||
@@ -66,8 +69,8 @@ static bool displayTransactionPage(uint8_t page, nbgl_pageContent_t *content) {
|
||||
condAddressBuffer,
|
||||
sizeof(condAddressBuffer),
|
||||
&global_sha3,
|
||||
chainConfig->chainId),
|
||||
pairs[0].item = "Cond. Address";
|
||||
chainConfig->chainId);
|
||||
pairs[0].item = "Cond. Address";
|
||||
pairs[0].value = condAddressBuffer;
|
||||
|
||||
stark_sign_display_condition_fact();
|
||||
@@ -78,6 +81,7 @@ static bool displayTransactionPage(uint8_t page, nbgl_pageContent_t *content) {
|
||||
content->tagValueList.nbPairs = 2;
|
||||
content->tagValueList.pairs = (nbgl_layoutTagValue_t *) pairs;
|
||||
|
||||
return true;
|
||||
} else {
|
||||
page++;
|
||||
}
|
||||
@@ -86,6 +90,7 @@ static bool displayTransactionPage(uint8_t page, nbgl_pageContent_t *content) {
|
||||
content->type = INFO_LONG_PRESS, content->infoLongPress.icon = get_app_icon(false);
|
||||
content->infoLongPress.text = "Review transaction";
|
||||
content->infoLongPress.longPressText = SIGN_BUTTON;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -106,19 +111,19 @@ void ui_stark_transfer(bool selfTransfer, bool conditional) {
|
||||
char *subTitle;
|
||||
if (conditional) {
|
||||
if (selfTransfer) {
|
||||
subTitle = (char *) "Conditionnal self transfer";
|
||||
subTitle = (char *) "Conditional Self Transfer";
|
||||
} else {
|
||||
subTitle = (char *) "Conditionnal transfer";
|
||||
subTitle = (char *) "Conditional Transfer";
|
||||
}
|
||||
} else {
|
||||
if (selfTransfer) {
|
||||
subTitle = (char *) "self transfer";
|
||||
subTitle = (char *) "Self Transfer";
|
||||
} else {
|
||||
subTitle = (char *) "Transfer";
|
||||
}
|
||||
}
|
||||
nbgl_useCaseReviewStart(get_app_icon(false),
|
||||
"Review stark transaction",
|
||||
"Review stark\ntransaction",
|
||||
subTitle,
|
||||
REJECT_BUTTON,
|
||||
reviewContinue,
|
||||
|
||||
Reference in New Issue
Block a user