Skip to content

Commit

Permalink
Merge pull request #289 from trilitech/paler@functori@remove-too-long…
Browse files Browse the repository at this point in the history
…-operation-warning-on-parsing-error

[summary] remove too long operation warning on parsing error
  • Loading branch information
spalmer25 authored Sep 23, 2024
2 parents f510cb5 + 2bef9fe commit e871e20
Show file tree
Hide file tree
Showing 362 changed files with 22 additions and 26 deletions.
31 changes: 19 additions & 12 deletions app/src/apdu_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static void handle_data_apdu(command_t *cmd);
static void handle_data_apdu_clear(command_t *cmd);
static void handle_data_apdu_blind(void);
#ifdef HAVE_BAGL
static void pass_from_clear_to_summary(void);
static void init_too_many_screens_stream(void);
static void init_summary_stream(void);
#endif
Expand Down Expand Up @@ -234,6 +235,12 @@ refill_blo_im_full(void)

global.keys.apdu.sign.step = SIGN_ST_WAIT_USER_INPUT;
#ifdef HAVE_BAGL
if ((N_settings.blindsign_status == ST_BLINDSIGN_LARGE_TX)
&& (SCREEN_DISPLAYED >= NB_MAX_SCREEN_ALLOWED)) {
pass_from_clear_to_summary();
TZ_SUCCEED();
}

if (st->field_info.is_field_complex && !N_settings.expert_mode) {
tz_ui_stream_push(TZ_UI_STREAM_CB_NOCB, st->field_info.field_name,
"Needs Expert mode", TZ_UI_LAYOUT_HOME_B,
Expand All @@ -255,16 +262,10 @@ refill_blo_im_full(void)
}
}

if ((N_settings.blindsign_status == ST_BLINDSIGN_LARGE_TX)
&& (SCREEN_DISPLAYED >= NB_MAX_SCREEN_ALLOWED)) {
init_too_many_screens_stream();
TZ_SUCCEED();
} else {
SCREEN_DISPLAYED++;
wrote = tz_ui_stream_push(TZ_UI_STREAM_CB_NOCB,
st->field_info.field_name, global.line_buf,
TZ_UI_LAYOUT_BN, TZ_UI_ICON_NONE);
}
SCREEN_DISPLAYED++;
wrote = tz_ui_stream_push(TZ_UI_STREAM_CB_NOCB, st->field_info.field_name,
global.line_buf, TZ_UI_LAYOUT_BN,
TZ_UI_ICON_NONE);

#elif HAVE_NBGL
PRINTF("[DEBUG] field=%s complex=%d\n", st->field_info.field_name,
Expand Down Expand Up @@ -319,7 +320,11 @@ refill_blo_done(void)

#ifdef HAVE_BAGL
if (global.step == ST_SUMMARY_SIGN) {
TZ_CHECK(init_summary_stream());
if (N_settings.blindsign_status == ST_BLINDSIGN_LARGE_TX) {
init_too_many_screens_stream();
} else {
init_summary_stream();
}
TZ_SUCCEED();
}

Expand Down Expand Up @@ -602,7 +607,7 @@ too_many_screens_stream_cb(tz_ui_cb_type_t cb_type)

// clang-format off
switch (cb_type) {
case TZ_UI_STREAM_CB_VALIDATE: TZ_CHECK(pass_from_clear_to_summary()); break;
case TZ_UI_STREAM_CB_VALIDATE: TZ_CHECK(init_summary_stream()); break;
case TZ_UI_STREAM_CB_REJECT: send_reject(EXC_REJECT); break;
default: TZ_FAIL(EXC_UNKNOWN); break;
}
Expand Down Expand Up @@ -630,6 +635,8 @@ init_too_many_screens_stream(void)
TZ_UI_STREAM_CB_REJECT);

tz_ui_stream_close();

tz_ui_stream();
}
#endif

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Loading

0 comments on commit e871e20

Please sign in to comment.