diff --git a/app/src/apdu_sign.c b/app/src/apdu_sign.c index 04d5e5e48..ef6761c75 100644 --- a/app/src/apdu_sign.c +++ b/app/src/apdu_sign.c @@ -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, diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/review_transaction.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/review_transaction.png new file mode 100644 index 000000000..00bec06df Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/review_transaction.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_1.png new file mode 100644 index 000000000..f010f761c Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_2.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_2.png new file mode 100644 index 000000000..3c85f8da9 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_2.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_3.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_3.png new file mode 100644 index 000000000..6687c5921 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_3.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_4.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_4.png new file mode 100644 index 000000000..e3ed3ba73 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_1_4.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_2_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_2_1.png new file mode 100644 index 000000000..7f1c52c44 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_2_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_2_2.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_2_2.png new file mode 100644 index 000000000..d8a22ce04 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_2_2.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_2_3.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_2_3.png new file mode 100644 index 000000000..d8a22ce04 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_2_3.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_3_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_3_1.png new file mode 100644 index 000000000..81274f181 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_skip_screen_3_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/review_transaction.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/review_transaction.png new file mode 100644 index 000000000..68c268b95 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/review_transaction.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_1_1.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_1_1.png new file mode 100644 index 000000000..f5e29533a Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_1_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_1_2.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_1_2.png new file mode 100644 index 000000000..4eb6920f5 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_1_2.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_1_3.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_1_3.png new file mode 100644 index 000000000..f41ae61a7 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_1_3.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_2_1.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_2_1.png new file mode 100644 index 000000000..336ab26bb Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_2_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_2_2.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_2_2.png new file mode 100644 index 000000000..336ab26bb Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_2_2.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_3_1.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_3_1.png new file mode 100644 index 000000000..aecc8103b Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_3_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_3_2.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_3_2.png new file mode 100644 index 000000000..2963845b4 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_3_2.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_3_3.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_3_3.png new file mode 100644 index 000000000..7a5a8891a Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_skip_screen_3_3.png differ diff --git a/tests/integration/touch/test_blindsign_different_modes.py b/tests/integration/touch/test_blindsign_different_modes.py index 6b4e39eca..8bdd4cea7 100755 --- a/tests/integration/touch/test_blindsign_different_modes.py +++ b/tests/integration/touch/test_blindsign_different_modes.py @@ -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()