Skip to content

Commit

Permalink
Swith to large tx mode in BLINDSIGN ON mode if user does not press skip
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinkyaraj-23 committed Sep 25, 2024
1 parent 07460fb commit d95ef44
Show file tree
Hide file tree
Showing 22 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/apdu_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ refill_blo_im_full(void)
#elif HAVE_NBGL
PRINTF("[DEBUG] field=%s complex=%d\n", st->field_info.field_name,
st->field_info.is_field_complex);
if ((N_settings.blindsign_status == ST_BLINDSIGN_LARGE_TX)
if ((N_settings.blindsign_status != ST_BLINDSIGN_OFF)
&& (SCREEN_DISPLAYED >= NB_MAX_SCREEN_ALLOWED)) {
strncpy(global.error_code, "TOO_MANY_SCREENS", ERROR_CODE_SIZE);
tz_ui_stream_push_all(TZ_UI_STREAM_CB_CANCEL,
Expand Down
Binary file removed tests/integration/touch/snapshots/flex/info.png
Binary file not shown.
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.
File renamed without changes
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.
32 changes: 31 additions & 1 deletion tests/integration/touch/test_blindsign_different_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,35 @@ def blindsign_review_sign(app: TezosAppScreen):
app.send_apdu("800f81ff48000000096d6573736167653137000000096d6573736167653138000000096d65737361676531397000ffdd6102321bc251e4a5190ad5b12b251069d9b4c0843d0f0103ff80ade204")
blindsign_review_sign(app)

app.set_blindsigning_status(BlindsigningStatus.Large_Tx_only)
# # Blindsign status ON but continue clear signing
app.assert_home()
app.set_blindsigning_status(BlindsigningStatus.ON)
app.send_initialize_msg( "800f000011048000002c800006c18000000080000000")
send_payload(app, "800f01ffeb0300000000000000000000000000000000000000000000000000000000000000006b00ffdd6102321bc251e4a5190ad5b12b251069d9b4c0843d0b0104020320182716513907b6bab33f905396d031931c07e01bddd780780c1a56b9c086da6c00ffdd6102321bc251e4a5190ad5b12b251069d9b480897a0c0107c08db701000278eb8b6ab9a768579cd5146b480789650c83f28effff0d7570646174655f636f6e6669670000000607070005030a6e00ffdd6102321bc251e4a5190ad5b12b251069d9b4c08db7010d0105ff01ee572f02e5be5d097ba17369789582882e8abb87c900ffdd6102321bc2")
app.assert_screen("review_transaction")
app.review.next()
group_1_screen_count= app.firmware == Firmware.STAX and 3 or 4
for i in range(group_1_screen_count):
app.assert_screen("tbdm_skip_screen_1_" + str(i+1))
app.review.next()
app.assert_screen("expert_mode_splash")
group_2_screen_count= app.firmware == Firmware.STAX and 2 or 3
for i in range(group_2_screen_count):
app.review.next()
app.assert_screen("tbdm_skip_screen_2_" + str(i+1))
app.expect_apdu_return("9000")
app.send_apdu("800f01ffeb51e4a5190ad5b12b251069d9b48092f4010e0106000000fa000000086d65737361676530000000086d65737361676531000000086d65737361676532000000086d65737361676533000000086d65737361676534000000086d65737361676535000000086d65737361676536000000086d65737361676537000000086d65737361676538000000086d65737361676539000000096d6573736167653130000000096d6573736167653131000000096d6573736167653132000000096d6573736167653133000000096d6573736167653134000000096d6573736167653135000000096d6573736167653136")
group_3_screen_count= app.firmware == Firmware.STAX and 3 or 1
for i in range(group_3_screen_count):
app.review.next()
app.assert_screen("tbdm_skip_screen_3_" + str(i+1))
app.review.next()
app.assert_screen("blindsign_warning_too_many_screens")
app.review.back_to_safety.reject()
app.expect_apdu_return("9000")
app.send_apdu("800f81ff48000000096d6573736167653137000000096d6573736167653138000000096d65737361676531397000ffdd6102321bc251e4a5190ad5b12b251069d9b4c0843d0f0103ff80ade204")
blindsign_review_sign(app)

app.set_expert_mode(initial_status=True)
app.set_blindsigning_status(BlindsigningStatus.Large_Tx_only)
app.assert_home()

0 comments on commit d95ef44

Please sign in to comment.