diff --git a/Makefile b/Makefile index 695ccfd00..dd227c089 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ app_%_dbg.tgz: app/src/*.[ch] \ app/Makefile SDK=$(shell echo $* | tr "[:lower:]" "[:upper:]")_SDK; \ $(DOCKER_RUN_APP_BUILDER) bash -c \ - "BOLOS_SDK=\$$$$SDK make -C app DEBUG=1" + "BOLOS_SDK=\$$$$SDK make -C app DEBUG=1 NBGL_DEBUG=1" $(DOCKER_RUN_APP_BUILDER) bash -c "cd app/bin/ && tar cz ." > $@ diff --git a/app/src/apdu_sign.c b/app/src/apdu_sign.c index 5ba81066b..db9e4c395 100644 --- a/app/src/apdu_sign.c +++ b/app/src/apdu_sign.c @@ -66,8 +66,12 @@ static void handle_data_apdu_clear(command_t *cmd); static void handle_data_apdu_blind(void); #ifdef HAVE_BAGL static void init_too_many_screens_stream(void); -static void init_summary_stream(void); #endif +#ifdef HAVE_NBGL +static void continue_blindsign_cb(void); +static void pass_from_summary_to_blind(void); +#endif +static void init_summary_stream(void); /* Macros */ @@ -83,8 +87,7 @@ static void init_summary_stream(void); #define APDU_SIGN_ASSERT_STEP(x) \ APDU_SIGN_ASSERT(global.keys.apdu.sign.step == (x)) -#define NB_MAX_SCREEN_ALLOWED 20 -#define SCREEN_DISPLAYED global.keys.apdu.sign.u.clear.screen_displayed +#define SCREEN_DISPLAYED global.keys.apdu.sign.u.clear.screen_displayed #ifdef HAVE_BAGL void @@ -181,7 +184,6 @@ sign_packet(void) io_send_response_buffers(bufs, 2, SW_OK); global.step = ST_IDLE; - TZ_POSTAMBLE; } @@ -269,6 +271,17 @@ 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) + && (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, + st->field_info.field_name, "TOO_MANY_SCREENS", + TZ_UI_LAYOUT_BN, TZ_UI_ICON_NONE); + + global.blindsign_reason = REASON_TOO_MANY_SCREENS; + + TZ_SUCCEED(); + } if (st->field_info.is_field_complex && !global.keys.apdu.sign.u.clear.displayed_expert_warning) { global.keys.apdu.sign.u.clear.last_field_index @@ -317,12 +330,12 @@ refill_blo_done(void) TZ_SUCCEED(); } -#ifdef HAVE_BAGL if (global.step == ST_SUMMARY_SIGN) { TZ_CHECK(init_summary_stream()); TZ_SUCCEED(); } +#ifdef HAVE_BAGL tz_ui_stream_push_accept_reject(); #endif tz_ui_stream_close(); @@ -352,7 +365,7 @@ refill_error(void) #ifndef TARGET_NANOS "This transaction", "could not be\ndecoded correctly." #endif - ); + ); tz_ui_stream_push_all(TZ_UI_STREAM_CB_NOCB, "Parsing error", @@ -360,17 +373,29 @@ refill_error(void) TZ_UI_LAYOUT_HOME_BN, TZ_UI_ICON_NONE); tz_ui_stream_push_learn_more(); - tz_ui_stream_push_risky_accept_reject(TZ_UI_STREAM_CB_BLINDSIGN, TZ_UI_STREAM_CB_CANCEL); + tz_ui_stream_push_risky_accept_reject( + TZ_UI_STREAM_CB_BLINDSIGN, TZ_UI_STREAM_CB_CANCEL); #elif HAVE_NBGL - // The following call is just to invoke switch_to_blindsigning - // with TZ_UI_STREAM_CB_CANCEL callback type in function tz_ui_nav_cb() - // The text will not be shown. - tz_ui_stream_push_all(TZ_UI_STREAM_CB_CANCEL, - "Parsing error", - tz_parser_result_name(st->errno), - TZ_UI_LAYOUT_BN, - TZ_UI_ICON_NONE); + global.blindsign_reason = REASON_PARSING_ERROR; + strncpy(global.error_code, tz_parser_result_name(st->errno), ERROR_CODE_SIZE); + if(global.step == ST_SUMMARY_SIGN) { + pass_from_summary_to_blind(); + TZ_SUCCEED(); + } + else if(global.step == ST_CLEAR_SIGN){ + // The following call is just to invoke switch_to_blindsigning + // with TZ_UI_STREAM_CB_CANCEL callback type in function tz_ui_nav_cb() + // The text will not be shown. + tz_ui_stream_push_all(TZ_UI_STREAM_CB_CANCEL, + "Parsing error", + tz_parser_result_name(st->errno), + TZ_UI_LAYOUT_BN, + TZ_UI_ICON_NONE); + } + else{ + TZ_FAIL(EXC_UNEXPECTED_STATE); // Only two states can lead to refill error. ST_CLEAR_SIGN and ST_SUMMARY_SIGN + } #endif // clang-format on @@ -395,10 +420,14 @@ refill(void) PRINTF("[DEBUG] refill(errno: %s)\n", tz_parser_result_name(st->errno)); // clang-format off switch (st->errno) { - case TZ_BLO_IM_FULL: TZ_CHECK(refill_blo_im_full()); break; - case TZ_BLO_FEED_ME: TZ_CHECK(send_continue()); break; - case TZ_BLO_DONE: TZ_CHECK(refill_blo_done()); break; - default: TZ_CHECK(refill_error()); break; + case TZ_BLO_IM_FULL: TZ_CHECK(refill_blo_im_full()); + break; + case TZ_BLO_FEED_ME: TZ_CHECK(send_continue()); + break; + case TZ_BLO_DONE: TZ_CHECK(refill_blo_done()); + break; + default: TZ_CHECK(refill_error()); + break; } // clang-format on TZ_POSTAMBLE; @@ -424,6 +453,23 @@ refill_all(void) TZ_POSTAMBLE; } +static void +pass_from_clear_to_summary(void) +{ + TZ_PREAMBLE(("void")); + + APDU_SIGN_ASSERT_STEP(SIGN_ST_WAIT_USER_INPUT); + + global.step = ST_SUMMARY_SIGN; + global.keys.apdu.sign.step = SIGN_ST_WAIT_DATA; +#ifdef HAVE_NBGL + init_blind_stream(); +#endif + TZ_CHECK(refill_all()); + + TZ_POSTAMBLE; +} + static void send_cancel(void) { @@ -475,13 +521,14 @@ stream_cb(tz_ui_cb_type_t cb_type) // clang-format off switch (cb_type) { - case TZ_UI_STREAM_CB_ACCEPT: TZ_CHECK(sign_packet()); break; - case TZ_UI_STREAM_CB_REFILL: TZ_CHECK(refill()); break; - case TZ_UI_STREAM_CB_REJECT: send_reject(EXC_REJECT); break; - case TZ_UI_STREAM_CB_BLINDSIGN_REJECT: send_reject(EXC_PARSE_ERROR); break; - case TZ_UI_STREAM_CB_CANCEL: TZ_CHECK(send_cancel()); break; - case TZ_UI_STREAM_CB_BLINDSIGN: TZ_CHECK(pass_from_clear_to_blind()); break; - default: TZ_FAIL(EXC_UNKNOWN); break; + case TZ_UI_STREAM_CB_ACCEPT: TZ_CHECK(sign_packet()); break; + case TZ_UI_STREAM_CB_REFILL: TZ_CHECK(refill()); break; + case TZ_UI_STREAM_CB_REJECT: send_reject(EXC_REJECT); break; + case TZ_UI_STREAM_CB_BLINDSIGN_REJECT: send_reject(EXC_PARSE_ERROR); break; + case TZ_UI_STREAM_CB_CANCEL: TZ_CHECK(send_cancel()); break; + case TZ_UI_STREAM_CB_BLINDSIGN: TZ_CHECK(pass_from_clear_to_blind()); break; + case TZ_UI_STREAM_CB_SUMMARY: TZ_CHECK(pass_from_clear_to_summary()); break; + default: TZ_FAIL(EXC_UNKNOWN); break; } // clang-format on @@ -558,46 +605,38 @@ summary_stream_cb(tz_ui_cb_type_t cb_type) // clang-format off switch (cb_type) { - case TZ_UI_STREAM_CB_ACCEPT: TZ_CHECK(sign_packet()); break; - case TZ_UI_STREAM_CB_REJECT: send_reject(EXC_REJECT); break; - case TZ_UI_STREAM_CB_REFILL: TZ_CHECK(push_next_summary_screen()); break; - default: TZ_FAIL(EXC_UNKNOWN); break; + case TZ_UI_STREAM_CB_ACCEPT: TZ_CHECK(sign_packet()); break; + case TZ_UI_STREAM_CB_REJECT: send_reject(EXC_REJECT); break; + case TZ_UI_STREAM_CB_REFILL: TZ_CHECK(push_next_summary_screen()); break; + default: TZ_FAIL(EXC_UNKNOWN); + break; } // clang-format on TZ_POSTAMBLE; } +#endif + static void init_summary_stream(void) { TZ_PREAMBLE(("void")); - +#ifdef HAVE_BAGL tz_ui_stream_init(summary_stream_cb); - global.keys.apdu.sign.u.summary.step = SUMMARYSIGN_ST_OPERATION; push_next_summary_screen(); - tz_ui_stream(); +#elif defined(HAVE_NBGL) + continue_blindsign_cb(); +#endif TZ_POSTAMBLE; } -static void -pass_from_clear_to_summary(void) -{ - TZ_PREAMBLE(("void")); - - APDU_SIGN_ASSERT_STEP(SIGN_ST_WAIT_USER_INPUT); - - global.step = ST_SUMMARY_SIGN; - global.keys.apdu.sign.step = SIGN_ST_WAIT_DATA; - - TZ_CHECK(refill_all()); - - TZ_POSTAMBLE; -} +#define FINAL_HASH global.keys.apdu.hash.final_hash +#ifdef HAVE_BAGL static void too_many_screens_stream_cb(tz_ui_cb_type_t cb_type) { @@ -605,9 +644,9 @@ 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_REJECT: send_reject(EXC_REJECT); break; - default: TZ_FAIL(EXC_UNKNOWN); break; + case TZ_UI_STREAM_CB_VALIDATE: TZ_CHECK(pass_from_clear_to_summary()); break; + case TZ_UI_STREAM_CB_REJECT: send_reject(EXC_REJECT); break; + default: TZ_FAIL(EXC_UNKNOWN); break; } // clang-format on @@ -634,10 +673,7 @@ init_too_many_screens_stream(void) tz_ui_stream_close(); } -#endif -#define FINAL_HASH global.keys.apdu.hash.final_hash -#ifdef HAVE_BAGL static void bs_push_next(void) { @@ -682,11 +718,15 @@ bs_stream_cb(tz_ui_cb_type_t cb_type) // clang-format off switch (cb_type) { - case TZ_UI_STREAM_CB_ACCEPT: return sign_packet(); - case TZ_UI_STREAM_CB_REFILL: return bs_push_next(); - case TZ_UI_STREAM_CB_REJECT: return send_reject(EXC_REJECT); - case TZ_UI_STREAM_CB_CANCEL: return send_cancel(); - default: TZ_FAIL(EXC_UNKNOWN); + case TZ_UI_STREAM_CB_ACCEPT: + return sign_packet(); + case TZ_UI_STREAM_CB_REFILL: + return bs_push_next(); + case TZ_UI_STREAM_CB_REJECT: + return send_reject(EXC_REJECT); + case TZ_UI_STREAM_CB_CANCEL: + return send_cancel(); + default: TZ_FAIL(EXC_UNKNOWN); } // clang-format on @@ -793,19 +833,24 @@ handle_data_apdu(command_t *cmd) global.keys.apdu.sign.tag = cmd->data[0]; } +#ifdef HAVE_BAGL if ((N_settings.blindsign_status == ST_BLINDSIGN_ON) && (global.step == ST_CLEAR_SIGN)) { global.step = ST_SUMMARY_SIGN; } +#endif // clang-format off switch (global.step) { case ST_CLEAR_SIGN: case ST_SWAP_SIGN: case ST_SUMMARY_SIGN: - TZ_CHECK(handle_data_apdu_clear(cmd)); break; - case ST_BLIND_SIGN: TZ_CHECK(handle_data_apdu_blind()); break; - default: TZ_FAIL(EXC_UNEXPECTED_STATE); break; + TZ_CHECK(handle_data_apdu_clear(cmd)); + break; + case ST_BLIND_SIGN: TZ_CHECK(handle_data_apdu_blind()); + break; + default: TZ_FAIL(EXC_UNEXPECTED_STATE); + break; } // clang-format on @@ -853,7 +898,55 @@ handle_data_apdu_clear(command_t *cmd) TZ_POSTAMBLE; } +#define OPERATION_TYPE_STR_LENGTH 22 + +static void +get_blindsign_type(char *type) +{ + TZ_PREAMBLE(("type=%s", type)); + TZ_ASSERT(strlen(type) == OPERATION_TYPE_STR_LENGTH, EXC_WRONG_PARAM); + // clang-format off + switch (global.keys.apdu.sign.tag) { + case 0x01: + case 0x11: + memcpy(type,"Block\nproposal", OPERATION_TYPE_STR_LENGTH); + break; + case 0x03: + memcpy(type,"Manager\noperation", OPERATION_TYPE_STR_LENGTH); + break; + case 0x02: + case 0x12: + case 0x13: + memcpy(type,"Consensus\noperation", OPERATION_TYPE_STR_LENGTH); + break; + case 0x05: + memcpy(type,"Micheline\nexpression", OPERATION_TYPE_STR_LENGTH); + break; + default: + break; + } + // clang-format on + TZ_POSTAMBLE; +} + #ifdef HAVE_NBGL +static void +pass_from_summary_to_blind(void) +{ + TZ_PREAMBLE(("void")); + + TZ_ASSERT(global.step == ST_SUMMARY_SIGN, EXC_UNEXPECTED_STATE); + + global.step = ST_BLIND_SIGN; + global.keys.apdu.sign.step = SIGN_ST_WAIT_DATA; + global.keys.apdu.sign.u.blind.step = BLINDSIGN_ST_OPERATION; + + init_blind_stream(); + handle_data_apdu_blind(); + + TZ_POSTAMBLE; +} + static nbgl_layoutTagValueList_t useCaseTagValueList; void @@ -873,7 +966,8 @@ reviewChoice(bool confirm) FUNC_ENTER(("confirm=%d", confirm)); if (confirm) { - nbgl_useCaseStatus("TRANSACTION\nSIGNED", true, accept_blindsign_cb); + nbgl_useCaseReviewStatus(STATUS_TYPE_TRANSACTION_SIGNED, + accept_blindsign_cb); } else { tz_reject(); } @@ -881,25 +975,85 @@ reviewChoice(bool confirm) FUNC_LEAVE(); } -static const char *transaction_type; -static char - hash[TZ_BASE58_BUFFER_SIZE(sizeof(global.keys.apdu.hash.final_hash))]; +typedef enum { + SUMMARY_INDEX_NB_OF_TX = 0, + SUMMARY_INDEX_TOTAL_AMOUNT, + SUMMARY_INDEX_TOTAL_FEES, + SUMMARY_INDEX_TYPE, + SUMMARY_INDEX_HASH, + SUMMARY_INDEX_MAX +} summary_index_t; + +#define DECIMAL_SIZE TZ_DECIMAL_BUFFER_SIZE((TZ_NUM_BUFFER_SIZE / 8)) + static nbgl_layoutTagValue_t pair; + static nbgl_layoutTagValue_t * getTagValuePair(uint8_t pairIndex) { + TZ_PREAMBLE(("pairIndex=%u", pairIndex)); + // Reuse the buffer for tag value pair list. + tz_operation_state *op + = &global.keys.apdu.sign.u.clear.parser_state.operation; + + /// Following condition is setup because startIndex in useCaseTagValueList + /// is not being used by the SDK. + if (global.step == ST_BLIND_SIGN && useCaseTagValueList.nbPairs == 2) { + if (pairIndex < SUMMARY_INDEX_TOTAL_FEES) { + pairIndex += SUMMARY_INDEX_TYPE; + } + } + + char num_buffer[DECIMAL_SIZE] = {0}; + char type[OPERATION_TYPE_STR_LENGTH] = "Micheline\nexpression"; + char + hash[TZ_BASE58_BUFFER_SIZE(sizeof(global.keys.apdu.hash.final_hash))]; + + pair.value = NULL; // A requirement for ui_strings_push switch (pairIndex) { - case 0: - pair.item = "Type"; - pair.value = transaction_type; - break; - case 1: - pair.item = "Hash"; - pair.value = hash; - break; + case SUMMARY_INDEX_NB_OF_TX: { + pair.item = "Number of Tx"; + + snprintf(num_buffer, sizeof(num_buffer), "%d", op->batch_index); + ui_strings_push(num_buffer, strlen(num_buffer), + (char **)&(pair.value)); + } break; + case SUMMARY_INDEX_TOTAL_AMOUNT: { + pair.item = "Total amount"; + + tz_mutez_to_string(num_buffer, sizeof(num_buffer), op->total_amount); + ui_strings_push(num_buffer, strlen(num_buffer), + (char **)&(pair.value)); + + } break; + case SUMMARY_INDEX_TOTAL_FEES: { + pair.item = "Total Fees"; + + tz_mutez_to_string(num_buffer, sizeof(num_buffer), op->total_fee); + ui_strings_push(num_buffer, strlen(num_buffer), + (char **)&(pair.value)); + } break; + case SUMMARY_INDEX_TYPE: { + get_blindsign_type(type); + pair.item = "Type"; + ui_strings_push(type, strlen(type), (char **)&(pair.value)); + } + + break; + case SUMMARY_INDEX_HASH: { + if (tz_format_base58(FINAL_HASH, sizeof(FINAL_HASH), hash, + sizeof(hash))) { + TZ_FAIL(EXC_UNKNOWN); + } + + pair.item = "Hash"; + ui_strings_push(hash, strlen(hash), (char **)&(pair.value)); + } break; default: return NULL; } + + TZ_POSTAMBLE; return &pair; } @@ -907,12 +1061,24 @@ void continue_blindsign_cb(void) { FUNC_ENTER(("void")); + + ui_strings_init(); + nbgl_operationType_t op = TYPE_TRANSACTION; - useCaseTagValueList.pairs = NULL; - useCaseTagValueList.callback = getTagValuePair; - useCaseTagValueList.startIndex = 0; - useCaseTagValueList.nbPairs = 2; + useCaseTagValueList.pairs = NULL; + useCaseTagValueList.callback = getTagValuePair; + useCaseTagValueList.startIndex = 3; + useCaseTagValueList.nbPairs = 2; + if (global.step == ST_SUMMARY_SIGN) { + PRINTF("[DEBUG] SUMMARY_SIGN start_index %d\n", + useCaseTagValueList.startIndex); + useCaseTagValueList.startIndex = 0; + useCaseTagValueList.nbPairs = 5; + } + PRINTF("[DEBUG] SIGN Stauts: %d, start_index %d Number of pairs:%d ", + global.step, useCaseTagValueList.startIndex, + useCaseTagValueList.nbPairs); useCaseTagValueList.smallCaseForValue = false; useCaseTagValueList.wrapping = false; nbgl_useCaseReviewBlindSigning(op, &useCaseTagValueList, &C_tezos, @@ -934,35 +1100,17 @@ handle_data_apdu_blind(void) TZ_SUCCEED(); } - const char *type = "unknown type"; - global.keys.apdu.sign.step = SIGN_ST_WAIT_USER_INPUT; - // clang-format off - switch(global.keys.apdu.sign.tag) { - case 0x01: case 0x11: type = "Block\nproposal"; break; - case 0x03: type = "Manager\noperation"; break; - case 0x02: - case 0x12: case 0x13: type = "Consensus\noperation"; break; - case 0x05: type = "Micheline\nexpression"; break; - default: break; - } - // clang-format on - #ifdef HAVE_BAGL + + char type[OPERATION_TYPE_STR_LENGTH] = "Michelline\nexpression"; + get_blindsign_type(type); tz_ui_stream_push_all(TZ_UI_STREAM_CB_NOCB, "Sign Hash", type, TZ_UI_LAYOUT_BN, TZ_UI_ICON_NONE); tz_ui_stream(); #elif HAVE_NBGL - char obuf[TZ_BASE58_BUFFER_SIZE(sizeof(FINAL_HASH))]; - if (tz_format_base58(FINAL_HASH, sizeof(FINAL_HASH), obuf, - sizeof(obuf))) { - TZ_FAIL(EXC_UNKNOWN); - } - - transaction_type = type; - STRLCPY(hash, obuf); continue_blindsign_cb(); #endif TZ_POSTAMBLE; @@ -973,7 +1121,7 @@ void handle_apdu_sign(command_t *cmd) { bool return_hash = cmd->ins == INS_SIGN_WITH_HASH; - TZ_PREAMBLE(("cmd=0x%p", cmd)); + TZ_PREAMBLE(("cmd=0x%p, \nglobal.step: %d", cmd, global.step)); TZ_ASSERT(EXC_WRONG_LENGTH_FOR_INS, cmd->lc <= MAX_APDU_SIZE); diff --git a/app/src/globals.h b/app/src/globals.h index d2d74d4d3..f811cfb85 100644 --- a/app/src/globals.h +++ b/app/src/globals.h @@ -68,6 +68,19 @@ typedef enum { ST_BLINDSIGN_OFF = 2 } blindsign_state_t; +#ifdef HAVE_BAGL +#define NB_MAX_SCREEN_ALLOWED 20 +#endif +#ifdef HAVE_NBGL +#define NB_MAX_SCREEN_ALLOWED 8 +typedef enum { + REASON_NONE = 0, + REASON_PARSING_ERROR = 1, + REASON_TOO_MANY_SCREENS = 2 +} blindsign_reason_t; + +#endif + /** * @brief Global structure holding state of operations and buffer of the data * to be processed. @@ -101,8 +114,9 @@ typedef struct { #endif #ifdef HAVE_NBGL - char error_code[ERROR_CODE_SIZE]; /// Error codes to be displayed in - /// blindsigning. + blindsign_reason_t + blindsign_reason; /// Blindsigning flow Summary or parsing error. + char error_code[ERROR_CODE_SIZE]; /// Error code for parsing error. #endif main_step_t step; /// Current operational state of app. } globals_t; diff --git a/app/src/ui_stream.h b/app/src/ui_stream.h index 17cabd5dd..a000bafde 100644 --- a/app/src/ui_stream.h +++ b/app/src/ui_stream.h @@ -81,6 +81,7 @@ typedef uint8_t tz_ui_cb_type_t; #define TZ_UI_STREAM_CB_NOCB 0x00u +#define TZ_UI_STREAM_CB_SUMMARY 0x0Du #define TZ_UI_STREAM_CB_BLINDSIGN 0x0Eu #define TZ_UI_STREAM_CB_VALIDATE 0x0Fu #define TZ_UI_STREAM_CB_REFILL 0xEFu diff --git a/app/src/ui_stream_nbgl.c b/app/src/ui_stream_nbgl.c index d0e02f96f..5d65b9af8 100644 --- a/app/src/ui_stream_nbgl.c +++ b/app/src/ui_stream_nbgl.c @@ -28,9 +28,11 @@ bool has_final_screen(void); void tz_ui_stream_start(void); void tz_transaction_choice(bool getMorePairs); -void drop_last_screen(void); -void push_str(const char *text, size_t len, char **out); -void switch_to_blindsigning_on_error(void); +void drop_last_screen(void); +void push_str(const char *text, size_t len, char **out); +void switch_to_blindsigning_on_error(void); +static void ui_stream_init(void); +#define SCREEN_DISPLAYED global.keys.apdu.sign.u.clear.screen_displayed void tz_reject(void) @@ -65,15 +67,39 @@ tz_reject_ui(void) FUNC_LEAVE(); } +static void +blindsign_skip_callback(void) +{ + TZ_PREAMBLE(("Blindsign reason: %d", global.blindsign_reason)); + + if (global.blindsign_reason == REASON_NONE) { + global.blindsign_reason = REASON_TOO_MANY_SCREENS; + tz_ui_stream_close(); + tz_ui_stream_t *s = &global.stream; + s->cb(TZ_UI_STREAM_CB_SUMMARY); + } else if (global.blindsign_reason == REASON_PARSING_ERROR) { + switch_to_blindsigning_on_error(); + } + TZ_POSTAMBLE; +} + static void blindsign_choice(bool confirm) { TZ_PREAMBLE(("void")); if (confirm) { + if (global.blindsign_reason != REASON_TOO_MANY_SCREENS) { + global.step = ST_BLIND_SIGN; + } tz_reject_ui(); } else { tz_ui_stream_t *s = &global.stream; - s->cb(TZ_UI_STREAM_CB_BLINDSIGN); + + if (global.blindsign_reason == REASON_TOO_MANY_SCREENS) { + s->cb(TZ_UI_STREAM_CB_SUMMARY); + } else { + s->cb(TZ_UI_STREAM_CB_BLINDSIGN); + } } TZ_POSTAMBLE; @@ -85,22 +111,18 @@ switch_to_blindsigning_on_error(void) TZ_PREAMBLE(("void")); TZ_ASSERT(EXC_UNEXPECTED_STATE, global.step == ST_CLEAR_SIGN); global.keys.apdu.sign.step = SIGN_ST_WAIT_USER_INPUT; - global.step = ST_BLIND_SIGN; // copy error code - tz_ui_stream_t *s = &global.stream; - size_t bucket = s->current % TZ_UI_STREAM_HISTORY_SCREENS; - const char *err_code = s->screens[bucket].pairs[0].value; PRINTF("[DEBUG] refill_error: global.step = %d\n %s", global.step, - err_code); - char blindsign_msg[150] - = "Transaction could not be decoded correctly. Learn More:\n" - "bit.ly/ledger-tez\nERROR: "; - memcpy(blindsign_msg + strlen(blindsign_msg), err_code, ERROR_CODE_SIZE); + global.error_code); + char blindsign_msg[60] = "Learn More: bit.ly/ledger-tez\nERROR: "; + + strncpy(blindsign_msg + strlen(blindsign_msg), global.error_code, + ERROR_CODE_SIZE); // Show error msg and ask user to proceed to blindsign nbgl_useCaseChoice(&C_Important_Circle_64px, - "The transaction cannot be trusted", blindsign_msg, + "The transaction cannot be decoded", blindsign_msg, "Reject transaction", "Proceed to Blindsign", blindsign_choice); TZ_POSTAMBLE; @@ -202,7 +224,13 @@ tz_ui_stream_cb(void) tz_ui_stream_t *s = &global.stream; tz_ui_stream_display_t *c = &s->current_screen; - nbgl_useCaseReviewStreamingContinue(&c->list, tz_transaction_choice); + if (N_settings.blindsign_status == ST_BLINDSIGN_ON) { + nbgl_useCaseReviewStreamingContinueExt( + &c->list, tz_transaction_choice, blindsign_skip_callback); + } else { + nbgl_useCaseReviewStreamingContinue(&c->list, + tz_transaction_choice); + } } FUNC_LEAVE(); } @@ -246,16 +274,11 @@ tz_transaction_choice(bool getMorePairs) FUNC_LEAVE(); } - -void -tz_ui_stream_init(void (*cb)(tz_ui_cb_type_t cb_type)) +static void +ui_stream_init(void) { tz_ui_stream_t *s = &global.stream; - FUNC_ENTER(("cb=%p", cb)); - memset(s, 0x0, sizeof(*s)); - memset(global.error_code, '\0', sizeof(global.error_code)); - s->cb = cb; s->full = false; s->last = 0; s->current = -1; @@ -263,7 +286,21 @@ tz_ui_stream_init(void (*cb)(tz_ui_cb_type_t cb_type)) s->pressed_right = false; ui_strings_init(); +} +void +tz_ui_stream_init(void (*cb)(tz_ui_cb_type_t cb_type)) +{ + tz_ui_stream_t *s = &global.stream; + memset(s, 0x0, sizeof(*s)); + FUNC_ENTER(("cb=%p", cb)); + ui_stream_init(); + s->cb = cb; + global.blindsign_reason = REASON_NONE; + memset(&global.error_code, '\0', ERROR_CODE_SIZE); nbgl_operationType_t op_type = TYPE_TRANSACTION; + if (N_settings.blindsign_status == ST_BLINDSIGN_ON) { + op_type |= SKIPPABLE_OPERATION; + } nbgl_useCaseReviewStreamingStart(op_type, &C_tezos, "Review request to sign operation", NULL, tz_transaction_choice); @@ -279,8 +316,6 @@ tz_ui_stream_start(void) FUNC_LEAVE(); } - - bool tz_ui_nav_cb(void) { @@ -494,6 +529,7 @@ tz_ui_stream_pushl(tz_ui_cb_type_t cb_type, const char *title, || (!append && (++(s->screens[bucket].nb_pairs) == max_pairs)) || (append && (offset == 0))) { s->total++; + SCREEN_DISPLAYED++; if ((s->total > 0) && ((s->total % TZ_UI_STREAM_HISTORY_SCREENS) == (s->last % TZ_UI_STREAM_HISTORY_SCREENS))) { diff --git a/app/src/ui_strings.c b/app/src/ui_strings.c index fcf14986d..f3818f50a 100644 --- a/app/src/ui_strings.c +++ b/app/src/ui_strings.c @@ -143,6 +143,7 @@ ui_strings_push(const char *in, size_t len, char **out) PRINT_STRINGS; /* Preconditions */ + PRINTF("[DEBUG] in = %p, out = %p\n", in, *out); TZ_ASSERT(EXC_MEMORY_ERROR, (*out == NULL)); TZ_ASSERT_NOTNULL(in); TZ_ASSERT(EXC_MEMORY_ERROR, (len > 0)); diff --git a/tests/integration/touch/snapshots/flex/home.png b/tests/integration/touch/snapshots/flex/home.png old mode 100644 new mode 100755 diff --git a/tests/integration/touch/snapshots/flex/info.png b/tests/integration/touch/snapshots/flex/info.png old mode 100644 new mode 100755 diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/review_screen.png similarity index 100% rename from tests/integration/touch/snapshots/flex/test_blindsign_too_deep/review_request_sign_operation.png rename to tests/integration/touch/snapshots/flex/review_screen.png diff --git a/tests/integration/touch/snapshots/flex/test_basic/settings_BlindsigningStatus-Large_Tx_only.png b/tests/integration/touch/snapshots/flex/settings_BlindsigningStatus_Large_Tx_only.png similarity index 100% rename from tests/integration/touch/snapshots/flex/test_basic/settings_BlindsigningStatus-Large_Tx_only.png rename to tests/integration/touch/snapshots/flex/settings_BlindsigningStatus_Large_Tx_only.png diff --git a/tests/integration/touch/snapshots/flex/test_basic/settings_BlindsigningStatus-OFF.png b/tests/integration/touch/snapshots/flex/settings_BlindsigningStatus_OFF.png old mode 100644 new mode 100755 similarity index 100% rename from tests/integration/touch/snapshots/flex/test_basic/settings_BlindsigningStatus-OFF.png rename to tests/integration/touch/snapshots/flex/settings_BlindsigningStatus_OFF.png diff --git a/tests/integration/touch/snapshots/flex/test_basic/settings_BlindsigningStatus-ON.png b/tests/integration/touch/snapshots/flex/settings_BlindsigningStatus_ON.png similarity index 100% rename from tests/integration/touch/snapshots/flex/test_basic/settings_BlindsigningStatus-ON.png rename to tests/integration/touch/snapshots/flex/settings_BlindsigningStatus_ON.png diff --git a/tests/integration/touch/snapshots/flex/test_basic/settings.png b/tests/integration/touch/snapshots/flex/settings_expert_mode_off.png old mode 100644 new mode 100755 similarity index 100% rename from tests/integration/touch/snapshots/flex/test_basic/settings.png rename to tests/integration/touch/snapshots/flex/settings_expert_mode_off.png diff --git a/tests/integration/touch/snapshots/flex/test_basic/settings_expert_on.png b/tests/integration/touch/snapshots/flex/settings_expert_mode_on.png old mode 100644 new mode 100755 similarity index 100% rename from tests/integration/touch/snapshots/flex/test_basic/settings_expert_on.png rename to tests/integration/touch/snapshots/flex/settings_expert_mode_on.png diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/blindsign_warning_ledger_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/blindsign_warning_ledger_1.png new file mode 100644 index 000000000..4397e0e07 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/blindsign_warning_ledger_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/blindsign_warning_too_many_screens.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/blindsign_warning_too_many_screens.png new file mode 100644 index 000000000..2dda4468a Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/blindsign_warning_too_many_screens.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/expert_mode_splash.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/expert_mode_splash.png new file mode 100644 index 000000000..92e453d5c Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/expert_mode_splash.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/operation_sign.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/operation_sign.png new file mode 100644 index 000000000..5e787d8ed Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/operation_sign.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/operation_sign_summary.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/operation_sign_summary.png new file mode 100644 index 000000000..1b3872252 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/operation_sign_summary.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/signing_successful.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/signing_successful.png new file mode 100644 index 000000000..be51a9d55 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/signing_successful.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/skip_review.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/skip_review.png new file mode 100644 index 000000000..a589f27f6 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/skip_review.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/summary_review_transaction.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/summary_review_transaction.png new file mode 100644 index 000000000..ba9889612 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/summary_review_transaction.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_blind_review_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_blind_review_1.png new file mode 100644 index 000000000..8695d943d Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_blind_review_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_blind_review_2.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_blind_review_2.png new file mode 100644 index 000000000..968870403 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_blind_review_2.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_blindsign_on_screen_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_blindsign_on_screen_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_blindsign_on_screen_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_1.png new file mode 100644 index 000000000..37fce12bc Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_10.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_10.png new file mode 100644 index 000000000..6f870ee1d Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_10.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_11.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_11.png new file mode 100644 index 000000000..f673005fe Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_11.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_12.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_12.png new file mode 100644 index 000000000..55cbb071f Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_12.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_2.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_2.png new file mode 100644 index 000000000..275d27810 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_2.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_3.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_3.png new file mode 100644 index 000000000..b3396b6a7 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_3.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_3_flex_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_3_flex_1.png new file mode 100644 index 000000000..4c442240e Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_3_flex_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_4.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_4.png new file mode 100644 index 000000000..d80215c11 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_4.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_4_flex_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_4_flex_1.png new file mode 100644 index 000000000..f400adc78 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_4_flex_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_4_flex_2.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_4_flex_2.png new file mode 100644 index 000000000..ea10f9e6d Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_4_flex_2.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_5.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_5.png new file mode 100644 index 000000000..78e2c57b0 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_5.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_6.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_6.png new file mode 100644 index 000000000..5e26760b5 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_6.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_7.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_7.png new file mode 100644 index 000000000..048ec804b Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_7.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_8.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_8.png new file mode 100644 index 000000000..ad3a93745 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_8.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_9.png b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_9.png new file mode 100644 index 000000000..ad3a93745 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_different_modes/tbdm_op_0_screen_9.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/blindsign_review_transaction.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/blindsign_review_transaction.png new file mode 100644 index 000000000..ed5dfab30 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/blindsign_review_transaction.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/blindsign_warning_ledger_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/blindsign_warning_ledger_1.png new file mode 100644 index 000000000..4397e0e07 Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/blindsign_warning_ledger_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/operation_sign.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/operation_sign_blindsign.png similarity index 100% rename from tests/integration/touch/snapshots/flex/test_blindsign_too_deep/operation_sign.png rename to tests/integration/touch/snapshots/flex/test_blindsign_too_deep/operation_sign_blindsign.png diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/signing_successful.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/signing_successful.png index 2f04101d6..be51a9d55 100644 Binary files a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/signing_successful.png and b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/signing_successful.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/tbtd_review_blindsign_0.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/tbtd_review_blindsign_0.png new file mode 100644 index 000000000..bf1e0ab7f Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/tbtd_review_blindsign_0.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/tbtd_review_blindsign_on_0.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/tbtd_review_blindsign_on_0.png new file mode 100644 index 000000000..19d239e7a Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/tbtd_review_blindsign_on_0.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/too_deep_blindsign_warning.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/too_deep_blindsign_warning.png new file mode 100644 index 000000000..ca0ed21bf Binary files /dev/null and b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/too_deep_blindsign_warning.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/unsafe_operation_warning_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/unsafe_operation_warning_1.png index 436a4fa66..ca0ed21bf 100644 Binary files a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/unsafe_operation_warning_1.png and b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep/unsafe_operation_warning_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep_rejections/operation_sign.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep_rejections/operation_sign_blindsign.png similarity index 100% rename from tests/integration/touch/snapshots/flex/test_blindsign_too_deep_rejections/operation_sign.png rename to tests/integration/touch/snapshots/flex/test_blindsign_too_deep_rejections/operation_sign_blindsign.png diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep_rejections/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep_rejections/review_request_sign_operation.png deleted file mode 100644 index 00bec06df..000000000 Binary files a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep_rejections/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep_rejections/unsafe_operation_warning_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep_rejections/unsafe_operation_warning_1.png index 436a4fa66..ca0ed21bf 100644 Binary files a/tests/integration/touch/snapshots/flex/test_blindsign_too_deep_rejections/unsafe_operation_warning_1.png and b/tests/integration/touch/snapshots/flex/test_blindsign_too_deep_rejections/unsafe_operation_warning_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_large/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_large/review_request_sign_operation.png deleted file mode 100644 index 00bec06df..000000000 Binary files a/tests/integration/touch/snapshots/flex/test_blindsign_too_large/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_large/signing_successful.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_large/signing_successful.png index 2f04101d6..be51a9d55 100644 Binary files a/tests/integration/touch/snapshots/flex/test_blindsign_too_large/signing_successful.png and b/tests/integration/touch/snapshots/flex/test_blindsign_too_large/signing_successful.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_too_large/unsafe_operation_warning_1.png b/tests/integration/touch/snapshots/flex/test_blindsign_too_large/unsafe_operation_warning_1.png index 7335b29c2..f9d0fbf95 100644 Binary files a/tests/integration/touch/snapshots/flex/test_blindsign_too_large/unsafe_operation_warning_1.png and b/tests/integration/touch/snapshots/flex/test_blindsign_too_large/unsafe_operation_warning_1.png differ diff --git a/tests/integration/touch/snapshots/flex/test_blindsign_valid/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/test_blindsign_valid/review_request_sign_operation.png deleted file mode 100644 index 00bec06df..000000000 Binary files a/tests/integration/touch/snapshots/flex/test_blindsign_valid/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/flex/test_expert_mode_rejections/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/test_expert_mode_rejections/review_request_sign_operation.png deleted file mode 100644 index 00bec06df..000000000 Binary files a/tests/integration/touch/snapshots/flex/test_expert_mode_rejections/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/flex/test_parsing_errors/invalid_tag.png b/tests/integration/touch/snapshots/flex/test_parsing_errors/invalid_tag.png index 3f045a3f9..07ecd0df2 100644 Binary files a/tests/integration/touch/snapshots/flex/test_parsing_errors/invalid_tag.png and b/tests/integration/touch/snapshots/flex/test_parsing_errors/invalid_tag.png differ diff --git a/tests/integration/touch/snapshots/flex/test_parsing_errors/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/test_parsing_errors/review_request_sign_operation.png deleted file mode 100644 index 00bec06df..000000000 Binary files a/tests/integration/touch/snapshots/flex/test_parsing_errors/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/flex/test_parsing_errors/too_deep.png b/tests/integration/touch/snapshots/flex/test_parsing_errors/too_deep.png index 436a4fa66..ca0ed21bf 100644 Binary files a/tests/integration/touch/snapshots/flex/test_parsing_errors/too_deep.png and b/tests/integration/touch/snapshots/flex/test_parsing_errors/too_deep.png differ diff --git a/tests/integration/touch/snapshots/flex/test_parsing_errors/too_large.png b/tests/integration/touch/snapshots/flex/test_parsing_errors/too_large.png index 7335b29c2..f9d0fbf95 100644 Binary files a/tests/integration/touch/snapshots/flex/test_parsing_errors/too_large.png and b/tests/integration/touch/snapshots/flex/test_parsing_errors/too_large.png differ diff --git a/tests/integration/touch/snapshots/flex/test_reject_review_operation/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/test_reject_review_operation/review_request_sign_operation.png deleted file mode 100644 index 00bec06df..000000000 Binary files a/tests/integration/touch/snapshots/flex/test_reject_review_operation/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/flex/test_reject_transfer/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/test_reject_transfer/review_request_sign_operation.png deleted file mode 100644 index 00bec06df..000000000 Binary files a/tests/integration/touch/snapshots/flex/test_reject_transfer/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/flex/test_sign_complex_operation/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/test_sign_complex_operation/review_request_sign_operation.png deleted file mode 100644 index 00bec06df..000000000 Binary files a/tests/integration/touch/snapshots/flex/test_sign_complex_operation/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/flex/test_sign_execute_outbox_messages/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/test_sign_execute_outbox_messages/review_request_sign_operation.png deleted file mode 100644 index 00bec06df..000000000 Binary files a/tests/integration/touch/snapshots/flex/test_sign_execute_outbox_messages/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/flex/test_sign_transfer/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/test_sign_transfer/review_request_sign_operation.png deleted file mode 100644 index 00bec06df..000000000 Binary files a/tests/integration/touch/snapshots/flex/test_sign_transfer/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/flex/test_sign_transfer_without_hash/review_request_sign_operation.png b/tests/integration/touch/snapshots/flex/test_sign_transfer_without_hash/review_request_sign_operation.png deleted file mode 100644 index 00bec06df..000000000 Binary files a/tests/integration/touch/snapshots/flex/test_sign_transfer_without_hash/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/stax/home.png b/tests/integration/touch/snapshots/stax/home.png old mode 100644 new mode 100755 diff --git a/tests/integration/touch/snapshots/stax/info.png b/tests/integration/touch/snapshots/stax/info.png old mode 100644 new mode 100755 diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/review_screen.png similarity index 100% rename from tests/integration/touch/snapshots/stax/test_blindsign_too_deep/review_request_sign_operation.png rename to tests/integration/touch/snapshots/stax/review_screen.png diff --git a/tests/integration/touch/snapshots/stax/test_basic/settings_BlindsigningStatus-Large_Tx_only.png b/tests/integration/touch/snapshots/stax/settings_BlindsigningStatus_Large_Tx_only.png similarity index 100% rename from tests/integration/touch/snapshots/stax/test_basic/settings_BlindsigningStatus-Large_Tx_only.png rename to tests/integration/touch/snapshots/stax/settings_BlindsigningStatus_Large_Tx_only.png diff --git a/tests/integration/touch/snapshots/stax/test_basic/settings_BlindsigningStatus-OFF.png b/tests/integration/touch/snapshots/stax/settings_BlindsigningStatus_OFF.png similarity index 100% rename from tests/integration/touch/snapshots/stax/test_basic/settings_BlindsigningStatus-OFF.png rename to tests/integration/touch/snapshots/stax/settings_BlindsigningStatus_OFF.png diff --git a/tests/integration/touch/snapshots/stax/test_basic/settings_BlindsigningStatus-ON.png b/tests/integration/touch/snapshots/stax/settings_BlindsigningStatus_ON.png similarity index 100% rename from tests/integration/touch/snapshots/stax/test_basic/settings_BlindsigningStatus-ON.png rename to tests/integration/touch/snapshots/stax/settings_BlindsigningStatus_ON.png diff --git a/tests/integration/touch/snapshots/stax/test_basic/settings.png b/tests/integration/touch/snapshots/stax/settings_expert_mode_off.png similarity index 100% rename from tests/integration/touch/snapshots/stax/test_basic/settings.png rename to tests/integration/touch/snapshots/stax/settings_expert_mode_off.png diff --git a/tests/integration/touch/snapshots/stax/test_basic/settings_expert_on.png b/tests/integration/touch/snapshots/stax/settings_expert_mode_on.png similarity index 100% rename from tests/integration/touch/snapshots/stax/test_basic/settings_expert_on.png rename to tests/integration/touch/snapshots/stax/settings_expert_mode_on.png diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/blindsign_warning_ledger_1.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/blindsign_warning_ledger_1.png new file mode 100644 index 000000000..04055db7b Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/blindsign_warning_ledger_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/blindsign_warning_too_many_screens.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/blindsign_warning_too_many_screens.png new file mode 100644 index 000000000..bbde06149 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/blindsign_warning_too_many_screens.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/expert_mode_splash.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/expert_mode_splash.png new file mode 100644 index 000000000..5bc079b4f Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/expert_mode_splash.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/operation_sign.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/operation_sign.png new file mode 100644 index 000000000..c1e5457de Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/operation_sign.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/operation_sign_summary.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/operation_sign_summary.png new file mode 100644 index 000000000..3df2d847e Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/operation_sign_summary.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/signing_successful.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/signing_successful.png new file mode 100644 index 000000000..392165d4f Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/signing_successful.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/skip_review.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/skip_review.png new file mode 100644 index 000000000..04dc3a1db Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/skip_review.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/summary_review_transaction.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/summary_review_transaction.png new file mode 100644 index 000000000..957ca54f3 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/summary_review_transaction.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_blind_review_1.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_blind_review_1.png new file mode 100644 index 000000000..f30e529bb Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_blind_review_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_blind_review_2.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_blind_review_2.png new file mode 100644 index 000000000..7769982cf Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_blind_review_2.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_blindsign_on_screen_1.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_blindsign_on_screen_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_blindsign_on_screen_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_1.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_1.png new file mode 100644 index 000000000..e56749926 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_10.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_10.png new file mode 100644 index 000000000..8777eea1b Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_10.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_11.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_11.png new file mode 100644 index 000000000..cf34bd7e0 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_11.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_12.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_12.png new file mode 100644 index 000000000..dfe606e4b Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_12.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_2.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_2.png new file mode 100644 index 000000000..2c5021a1d Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_2.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_3.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_3.png new file mode 100644 index 000000000..5ec3823ba Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_3.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_4.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_4.png new file mode 100644 index 000000000..83a308e72 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_4.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_5.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_5.png new file mode 100644 index 000000000..d0656738c Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_5.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_6.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_6.png new file mode 100644 index 000000000..f449a4a93 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_6.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_7.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_7.png new file mode 100644 index 000000000..7a89ff25a Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_7.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_8.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_8.png new file mode 100644 index 000000000..a2f54dab3 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_8.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_9.png b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_9.png new file mode 100644 index 000000000..a7cb0664e Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_different_modes/tbdm_op_0_screen_9.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/blindsign_review_transaction.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/blindsign_review_transaction.png new file mode 100644 index 000000000..d8b1eabdf Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/blindsign_review_transaction.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/blindsign_warning_ledger_1.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/blindsign_warning_ledger_1.png new file mode 100644 index 000000000..04055db7b Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/blindsign_warning_ledger_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/operation_sign.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/operation_sign_blindsign.png similarity index 100% rename from tests/integration/touch/snapshots/stax/test_blindsign_too_deep/operation_sign.png rename to tests/integration/touch/snapshots/stax/test_blindsign_too_deep/operation_sign_blindsign.png diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/signing_successful.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/signing_successful.png index a24543af4..392165d4f 100644 Binary files a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/signing_successful.png and b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/signing_successful.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/tbtd_review_blindsign_0.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/tbtd_review_blindsign_0.png new file mode 100644 index 000000000..47c2e3d90 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/tbtd_review_blindsign_0.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/tbtd_review_blindsign_on_0.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/tbtd_review_blindsign_on_0.png new file mode 100644 index 000000000..06998759e Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/tbtd_review_blindsign_on_0.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/too_deep_blindsign_warning.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/too_deep_blindsign_warning.png new file mode 100644 index 000000000..744644fc0 Binary files /dev/null and b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/too_deep_blindsign_warning.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/unsafe_operation_warning_1.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/unsafe_operation_warning_1.png index 981032c5a..744644fc0 100644 Binary files a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/unsafe_operation_warning_1.png and b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep/unsafe_operation_warning_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep_rejections/operation_sign.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep_rejections/operation_sign_blindsign.png similarity index 100% rename from tests/integration/touch/snapshots/stax/test_blindsign_too_deep_rejections/operation_sign.png rename to tests/integration/touch/snapshots/stax/test_blindsign_too_deep_rejections/operation_sign_blindsign.png diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep_rejections/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep_rejections/review_request_sign_operation.png deleted file mode 100644 index 68c268b95..000000000 Binary files a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep_rejections/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep_rejections/unsafe_operation_warning_1.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep_rejections/unsafe_operation_warning_1.png index 981032c5a..744644fc0 100644 Binary files a/tests/integration/touch/snapshots/stax/test_blindsign_too_deep_rejections/unsafe_operation_warning_1.png and b/tests/integration/touch/snapshots/stax/test_blindsign_too_deep_rejections/unsafe_operation_warning_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_large/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_large/review_request_sign_operation.png deleted file mode 100644 index 68c268b95..000000000 Binary files a/tests/integration/touch/snapshots/stax/test_blindsign_too_large/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_large/signing_successful.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_large/signing_successful.png index a24543af4..392165d4f 100644 Binary files a/tests/integration/touch/snapshots/stax/test_blindsign_too_large/signing_successful.png and b/tests/integration/touch/snapshots/stax/test_blindsign_too_large/signing_successful.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_too_large/unsafe_operation_warning_1.png b/tests/integration/touch/snapshots/stax/test_blindsign_too_large/unsafe_operation_warning_1.png index 1bd4a7cc6..8f663d539 100644 Binary files a/tests/integration/touch/snapshots/stax/test_blindsign_too_large/unsafe_operation_warning_1.png and b/tests/integration/touch/snapshots/stax/test_blindsign_too_large/unsafe_operation_warning_1.png differ diff --git a/tests/integration/touch/snapshots/stax/test_blindsign_valid/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/test_blindsign_valid/review_request_sign_operation.png deleted file mode 100644 index 68c268b95..000000000 Binary files a/tests/integration/touch/snapshots/stax/test_blindsign_valid/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/stax/test_expert_mode_rejections/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/test_expert_mode_rejections/review_request_sign_operation.png deleted file mode 100644 index 68c268b95..000000000 Binary files a/tests/integration/touch/snapshots/stax/test_expert_mode_rejections/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/stax/test_parsing_errors/invalid_tag.png b/tests/integration/touch/snapshots/stax/test_parsing_errors/invalid_tag.png index 8008b08ca..a37f4ee1e 100644 Binary files a/tests/integration/touch/snapshots/stax/test_parsing_errors/invalid_tag.png and b/tests/integration/touch/snapshots/stax/test_parsing_errors/invalid_tag.png differ diff --git a/tests/integration/touch/snapshots/stax/test_parsing_errors/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/test_parsing_errors/review_request_sign_operation.png deleted file mode 100644 index 68c268b95..000000000 Binary files a/tests/integration/touch/snapshots/stax/test_parsing_errors/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/stax/test_parsing_errors/too_deep.png b/tests/integration/touch/snapshots/stax/test_parsing_errors/too_deep.png index 981032c5a..744644fc0 100644 Binary files a/tests/integration/touch/snapshots/stax/test_parsing_errors/too_deep.png and b/tests/integration/touch/snapshots/stax/test_parsing_errors/too_deep.png differ diff --git a/tests/integration/touch/snapshots/stax/test_parsing_errors/too_large.png b/tests/integration/touch/snapshots/stax/test_parsing_errors/too_large.png index 1bd4a7cc6..8f663d539 100644 Binary files a/tests/integration/touch/snapshots/stax/test_parsing_errors/too_large.png and b/tests/integration/touch/snapshots/stax/test_parsing_errors/too_large.png differ diff --git a/tests/integration/touch/snapshots/stax/test_reject_review_operation/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/test_reject_review_operation/review_request_sign_operation.png deleted file mode 100644 index 68c268b95..000000000 Binary files a/tests/integration/touch/snapshots/stax/test_reject_review_operation/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/stax/test_reject_transfer/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/test_reject_transfer/review_request_sign_operation.png deleted file mode 100644 index 68c268b95..000000000 Binary files a/tests/integration/touch/snapshots/stax/test_reject_transfer/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/stax/test_sign_complex_operation/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/test_sign_complex_operation/review_request_sign_operation.png deleted file mode 100644 index 68c268b95..000000000 Binary files a/tests/integration/touch/snapshots/stax/test_sign_complex_operation/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/stax/test_sign_execute_outbox_messages/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/test_sign_execute_outbox_messages/review_request_sign_operation.png deleted file mode 100644 index 68c268b95..000000000 Binary files a/tests/integration/touch/snapshots/stax/test_sign_execute_outbox_messages/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/stax/test_sign_transfer/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/test_sign_transfer/review_request_sign_operation.png deleted file mode 100644 index 68c268b95..000000000 Binary files a/tests/integration/touch/snapshots/stax/test_sign_transfer/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/snapshots/stax/test_sign_transfer_without_hash/review_request_sign_operation.png b/tests/integration/touch/snapshots/stax/test_sign_transfer_without_hash/review_request_sign_operation.png deleted file mode 100644 index 68c268b95..000000000 Binary files a/tests/integration/touch/snapshots/stax/test_sign_transfer_without_hash/review_request_sign_operation.png and /dev/null differ diff --git a/tests/integration/touch/test_basic.py b/tests/integration/touch/test_basic.py index 1e5095dfc..fb91fe8c8 100755 --- a/tests/integration/touch/test_basic.py +++ b/tests/integration/touch/test_basic.py @@ -14,32 +14,26 @@ # limitations under the License. from utils import tezos_app, BlindsigningStatus +import os if __name__ == "__main__": app = tezos_app(__file__) - app.remove_info_page() app.assert_home() app.welcome.settings() - app.assert_expert_mode() - - app.settings.toggle_expert_mode() - app.assert_expert_mode(expert_mode=True) - - app.settings.toggle_expert_mode() - app.assert_expert_mode() + app.set_expert_mode(initial_status=False) + app.set_expert_mode(initial_status=True) + app.set_blindsigning_status(BlindsigningStatus.Large_Tx_only) + app.set_blindsigning_status(BlindsigningStatus.ON) + app.set_blindsigning_status(BlindsigningStatus.OFF) + app.welcome.settings() app.settings.next() - app.assert_blindsigning_status(blindsignStatus=BlindsigningStatus.Large_Tx_only) - app.settings.set_blindigning(2) - app.assert_blindsigning_status(blindsignStatus=BlindsigningStatus.ON) - app.settings.set_blindigning(3) - app.assert_blindsigning_status(blindsignStatus=BlindsigningStatus.OFF) app.settings.next() app.assert_info() - app.settings.exit() + app.settings.multi_page_exit() app.assert_home() app.quit() diff --git a/tests/integration/touch/test_blindsign_different_modes.py b/tests/integration/touch/test_blindsign_different_modes.py new file mode 100755 index 000000000..8c28921cd --- /dev/null +++ b/tests/integration/touch/test_blindsign_different_modes.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# Copyright 2023 Trilitech + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from utils import ( + tezos_app, + TezosAppScreen, + send_payload, BlindsigningStatus +) + +from ragger.firmware import Firmware +#Response: c9fc57555a59876454427adadeb62cf365bf936e346def12f0729e6a1c9d0eed81e1acced76fddb6ec90619a12d8904dd9ba07f64a9f2c4e05a692224ec7bdb1d357b90a03a0d8f441b048d0cff72e997aac00d657725f67afb68c76eacb79029000 + +def blindsign_common(app: TezosAppScreen): + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") + send_payload(app, "800f01ffeb0300000000000000000000000000000000000000000000000000000000000000006b00ffdd6102321bc251e4a5190ad5b12b251069d9b4c0843d0b0104020320182716513907b6bab33f905396d031931c07e01bddd780780c1a56b9c086da6c00ffdd6102321bc251e4a5190ad5b12b251069d9b480897a0c0107c08db701000278eb8b6ab9a768579cd5146b480789650c83f28effff0d7570646174655f636f6e6669670000000607070005030a6e00ffdd6102321bc251e4a5190ad5b12b251069d9b4c08db7010d0105ff01ee572f02e5be5d097ba17369789582882e8abb87c900ffdd6102321bc2") + app.review.next() + app.assert_screen("tbdm_op_0_screen_1") + app.review.next() + app.assert_screen("tbdm_op_0_screen_2") + app.review.next() + app.assert_screen("tbdm_op_0_screen_3") + app.review.next() + if(app.firmware == Firmware.FLEX): + app.assert_screen("tbdm_op_0_screen_3_flex_1") + app.review.next() + app.assert_screen("expert_mode_splash") + app.review.next() + app.assert_screen("tbdm_op_0_screen_4") + app.review.next() + if(app.firmware == Firmware.FLEX): + app.assert_screen("tbdm_op_0_screen_4_flex_1") + app.review.next() + app.expect_apdu_return("9000") + app.send_apdu("800f01ffeb51e4a5190ad5b12b251069d9b48092f4010e0106000000fa000000086d65737361676530000000086d65737361676531000000086d65737361676532000000086d65737361676533000000086d65737361676534000000086d65737361676535000000086d65737361676536000000086d65737361676537000000086d65737361676538000000086d65737361676539000000096d6573736167653130000000096d6573736167653131000000096d6573736167653132000000096d6573736167653133000000096d6573736167653134000000096d6573736167653135000000096d6573736167653136") + if app.firmware == Firmware.FLEX: + app.assert_screen("tbdm_op_0_screen_4_flex_2") + app.review.next() + app.assert_screen("tbdm_op_0_screen_5") + app.review.next() + + +def blindsign_review_sign(app: TezosAppScreen): + app.assert_screen("blindsign_warning_ledger_1") + app.review.enable_blindsign.reject() + app.assert_screen("summary_review_transaction") + app.review.next() + app.assert_screen("tbdm_blind_review_1") + app.review.next() + app.assert_screen("tbdm_blind_review_2") + expected_apdu = "a2ef5aec1ad8cc9b35dee48e8a47e418108dec7652159f3a4314c29d91f172f4645db9554b5a8a565307d9a9e65260957409efef54835573b8fc43d6162f99b8e17a557f7f82c46a53ca7c2be7aa540239d394cd5e9dbf14312c8e1e331a2b099000" + app.review_confirm_signing(expected_apdu, True) + +if __name__ == "__main__": + app = tezos_app(__file__) + +# Blindsign status OFF + app.assert_home() + app.set_expert_mode(initial_status= False) # need to know the current status of expert mode + app.set_blindsigning_status(BlindsigningStatus.OFF) + blindsign_common(app) + app.assert_screen("tbdm_op_0_screen_6") + app.review.next() + app.assert_screen("tbdm_op_0_screen_7") + app.review.next() + app.assert_screen("tbdm_op_0_screen_8") + app.review.next() + app.assert_screen("tbdm_op_0_screen_9") + app.review.next() + if app.firmware == Firmware.FLEX: + app.expect_apdu_return("9000") + app.send_apdu("800f81ff48000000096d6573736167653137000000096d6573736167653138000000096d65737361676531397000ffdd6102321bc251e4a5190ad5b12b251069d9b4c0843d0f0103ff80ade204") + app.assert_screen("tbdm_op_0_screen_10") + app.review.next() + if app.firmware == Firmware.STAX: + app.expect_apdu_return("9000") + app.send_apdu("800f81ff48000000096d6573736167653137000000096d6573736167653138000000096d65737361676531397000ffdd6102321bc251e4a5190ad5b12b251069d9b4c0843d0f0103ff80ade204") + app.assert_screen("tbdm_op_0_screen_11") + app.review.next() + app.assert_screen("tbdm_op_0_screen_12") + expected_apdu = "a2ef5aec1ad8cc9b35dee48e8a47e418108dec7652159f3a4314c29d91f172f4645db9554b5a8a565307d9a9e65260957409efef54835573b8fc43d6162f99b8e17a557f7f82c46a53ca7c2be7aa540239d394cd5e9dbf14312c8e1e331a2b099000" + app.review_confirm_signing(expected_apdu) +# +# Blindsign status For Large Tx only + app.assert_home() + app.set_blindsigning_status(BlindsigningStatus.Large_Tx_only) + + blindsign_common(app) + if app.firmware == Firmware.STAX: + app.assert_screen("tbdm_op_0_screen_6") + app.review.next() + app.assert_screen("tbdm_op_0_screen_7") + app.review.next() + app.assert_screen("tbdm_op_0_screen_8") + app.review.next() + app.assert_screen("blindsign_warning_too_many_screens") + app.review.enable_blindsign.reject() + app.expect_apdu_return("9000") + app.send_apdu("800f81ff48000000096d6573736167653137000000096d6573736167653138000000096d65737361676531397000ffdd6102321bc251e4a5190ad5b12b251069d9b4c0843d0f0103ff80ade204") + blindsign_review_sign(app) + +# Blindsign status ON + app.assert_home() + app.set_blindsigning_status(BlindsigningStatus.ON) + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") + send_payload(app, "800f01ffeb0300000000000000000000000000000000000000000000000000000000000000006b00ffdd6102321bc251e4a5190ad5b12b251069d9b4c0843d0b0104020320182716513907b6bab33f905396d031931c07e01bddd780780c1a56b9c086da6c00ffdd6102321bc251e4a5190ad5b12b251069d9b480897a0c0107c08db701000278eb8b6ab9a768579cd5146b480789650c83f28effff0d7570646174655f636f6e6669670000000607070005030a6e00ffdd6102321bc251e4a5190ad5b12b251069d9b4c08db7010d0105ff01ee572f02e5be5d097ba17369789582882e8abb87c900ffdd6102321bc2") + app.review.next() + app.assert_screen("tbdm_blindsign_on_screen_1") + app.welcome.settings() # skip button is at the same position as settings button on Home screen + app.assert_screen("skip_review") + app.review.enable_blindsign.confirm() + app.expect_apdu_return("9000") + app.send_apdu("800f01ffeb51e4a5190ad5b12b251069d9b48092f4010e0106000000fa000000086d65737361676530000000086d65737361676531000000086d65737361676532000000086d65737361676533000000086d65737361676534000000086d65737361676535000000086d65737361676536000000086d65737361676537000000086d65737361676538000000086d65737361676539000000096d6573736167653130000000096d6573736167653131000000096d6573736167653132000000096d6573736167653133000000096d6573736167653134000000096d6573736167653135000000096d6573736167653136") + app.expect_apdu_return("9000") + app.send_apdu("800f81ff48000000096d6573736167653137000000096d6573736167653138000000096d65737361676531397000ffdd6102321bc251e4a5190ad5b12b251069d9b4c0843d0f0103ff80ade204") + blindsign_review_sign(app) + + app.set_blindsigning_status(BlindsigningStatus.Large_Tx_only) + app.set_expert_mode(initial_status=True) diff --git a/tests/integration/touch/test_blindsign_too_deep.py b/tests/integration/touch/test_blindsign_too_deep.py index e75dcd5b8..1f5aa0507 100755 --- a/tests/integration/touch/test_blindsign_too_deep.py +++ b/tests/integration/touch/test_blindsign_too_deep.py @@ -15,8 +15,8 @@ from utils import ( tezos_app, - send_initialize_msg, - send_payload + BlindsigningType, + BlindsigningStatus, ) if __name__ == "__main__": @@ -24,8 +24,8 @@ app.assert_home() - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") - send_payload(app, "800f0100eb0502000000f702000000f202000000ed02000000e802000000e302000000de02000000d902000000d402000000cf02000000ca02000000c502000000c002000000bb02000000b602000000b102000000ac02000000a702000000a2020000009d02000000980200000093020000008e02000000890200000084020000007f020000007a02000000750200000070020000006b02000000660200000061020000005c02000000570200000052020000004d02000000480200000043020000003e02000000390200000034020000002f020000002a02000000250200000020020000001b020000001602000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") + app.send_apdu("800f0100eb0502000000f702000000f202000000ed02000000e802000000e302000000de02000000d902000000d402000000cf02000000ca02000000c502000000c002000000bb02000000b602000000b102000000ac02000000a702000000a2020000009d02000000980200000093020000008e02000000890200000084020000007f020000007a02000000750200000070020000006b02000000660200000061020000005c02000000570200000052020000004d02000000480200000043020000003e02000000390200000034020000002f020000002a02000000250200000020020000001b020000001602000000") app.review.next() app.assert_screen("tbtd_review_0") @@ -36,11 +36,33 @@ app.assert_screen("tbtd_start_review_blindsign") app.review.next() app.assert_screen("tbtd_review_1") + expected_apdu = "93070b00990e4cf29c31f6497307bea0ad86a9d0dc08dba8b607e8dc0e23652f8309e41ed87ac1d33006806b688cfcff7632c4fbe499ff3ea4983ae4f06dea7790ec25db045689bca2c63967b5c563aabff86c4ef163bff92af3bb2ca9392d099000" + app.review_confirm_signing(expected_apdu, blindsigning_type=BlindsigningType.BLINDSIGN) + + app.assert_home() + + app.set_blindsigning_status(BlindsigningStatus.ON) + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") + app.send_apdu("800f0100eb0502000000f702000000f202000000ed02000000e802000000e302000000de02000000d902000000d402000000cf02000000ca02000000c502000000c002000000bb02000000b602000000b102000000ac02000000a702000000a2020000009d02000000980200000093020000008e02000000890200000084020000007f020000007a02000000750200000070020000006b02000000660200000061020000005c02000000570200000052020000004d02000000480200000043020000003e02000000390200000034020000002f020000002a02000000250200000020020000001b020000001602000000") app.review.next() - app.assert_screen("operation_sign") - expected_apdu = "93070b00990e4cf29c31f6497307bea0ad86a9d0dc08dba8b607e8dc0e23652f8309e41ed87ac1d33006806b688cfcff7632c4fbe499ff3ea4983ae4f06dea7790ec25db045689bca2c63967b5c563aabff86c4ef163bff92af3bb2ca9392d099000" - app.review_confirm_signing(expected_apdu) + app.assert_screen("tbtd_review_blindsign_on_0") + app.welcome.settings() # skip button + app.review.enable_blindsign.confirm() + app.assert_screen("too_deep_blindsign_warning") + with app.fading_screen("loading_operation"): + app.review.enable_blindsign.reject() + app.expect_apdu_return("9000") + app.send_apdu("800f82001211020000000c02000000070200000002002a") + app.assert_screen("blindsign_warning_ledger_1") + app.review.enable_blindsign.reject() + app.assert_screen("blindsign_review_transaction") + app.review.next() + app.assert_screen("tbtd_review_blindsign_0") + app.review.next() + app.review_confirm_signing(expected_apdu, blindsigning_type=BlindsigningType.BLINDSIGN) app.assert_home() + + app.quit() diff --git a/tests/integration/touch/test_blindsign_too_deep_rejections.py b/tests/integration/touch/test_blindsign_too_deep_rejections.py index 03034034d..53d57440f 100755 --- a/tests/integration/touch/test_blindsign_too_deep_rejections.py +++ b/tests/integration/touch/test_blindsign_too_deep_rejections.py @@ -15,7 +15,7 @@ from utils import ( tezos_app, - send_initialize_msg, + send_payload, verify_err_reject_response, reject_flow, assert_home_with_code @@ -27,7 +27,7 @@ app.assert_home() # Rejecting at 1st warning msg - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f0100eb0502000000f702000000f202000000ed02000000e802000000e302000000de02000000d902000000d402000000cf02000000ca02000000c502000000c002000000bb02000000b602000000b102000000ac02000000a702000000a2020000009d02000000980200000093020000008e02000000890200000084020000007f020000007a02000000750200000070020000006b02000000660200000061020000005c02000000570200000052020000004d02000000480200000043020000003e02000000390200000034020000002f020000002a02000000250200000020020000001b020000001602000000") app.review.next() app.assert_screen("tbtdr_review_0") @@ -40,7 +40,7 @@ # Rejecting at 2nd warning - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f0100eb0502000000f702000000f202000000ed02000000e802000000e302000000de02000000d902000000d402000000cf02000000ca02000000c502000000c002000000bb02000000b602000000b102000000ac02000000a702000000a2020000009d02000000980200000093020000008e02000000890200000084020000007f020000007a02000000750200000070020000006b02000000660200000061020000005c02000000570200000052020000004d02000000480200000043020000003e02000000390200000034020000002f020000002a02000000250200000020020000001b020000001602000000") app.review.next() app.assert_screen("tbtdr_review_0") @@ -56,7 +56,7 @@ # Rejecting at review blindsign operation - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f0100eb0502000000f702000000f202000000ed02000000e802000000e302000000de02000000d902000000d402000000cf02000000ca02000000c502000000c002000000bb02000000b602000000b102000000ac02000000a702000000a2020000009d02000000980200000093020000008e02000000890200000084020000007f020000007a02000000750200000070020000006b02000000660200000061020000005c02000000570200000052020000004d02000000480200000043020000003e02000000390200000034020000002f020000002a02000000250200000020020000001b020000001602000000") app.review.next() app.assert_screen("tbtdr_review_0") @@ -65,7 +65,7 @@ verify_err_reject_response(app, "tbtdr_start_review_blindsign") # Rejecting at blindsign review screen - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f0100eb0502000000f702000000f202000000ed02000000e802000000e302000000de02000000d902000000d402000000cf02000000ca02000000c502000000c002000000bb02000000b602000000b102000000ac02000000a702000000a2020000009d02000000980200000093020000008e02000000890200000084020000007f020000007a02000000750200000070020000006b02000000660200000061020000005c02000000570200000052020000004d02000000480200000043020000003e02000000390200000034020000002f020000002a02000000250200000020020000001b020000001602000000") app.review.next() app.assert_screen("tbtdr_review_0") @@ -77,7 +77,7 @@ # Rejecting at final sign operation screen - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f0100eb0502000000f702000000f202000000ed02000000e802000000e302000000de02000000d902000000d402000000cf02000000ca02000000c502000000c002000000bb02000000b602000000b102000000ac02000000a702000000a2020000009d02000000980200000093020000008e02000000890200000084020000007f020000007a02000000750200000070020000006b02000000660200000061020000005c02000000570200000052020000004d02000000480200000043020000003e02000000390200000034020000002f020000002a02000000250200000020020000001b020000001602000000") app.review.next() app.assert_screen("tbtdr_review_0") @@ -87,6 +87,6 @@ app.review.next() app.assert_screen("tbtd_review_1") app.review.next() - verify_err_reject_response(app,"operation_sign") + verify_err_reject_response(app,"operation_sign_blindsign") app.quit() diff --git a/tests/integration/touch/test_blindsign_too_large.py b/tests/integration/touch/test_blindsign_too_large.py index ef33df298..c8cec87a4 100755 --- a/tests/integration/touch/test_blindsign_too_large.py +++ b/tests/integration/touch/test_blindsign_too_large.py @@ -15,7 +15,7 @@ from utils import ( tezos_app, - send_initialize_msg, + send_payload ) @@ -24,7 +24,7 @@ app.assert_home() - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f810028050092abf8e3d9e5f8cfd9ae8a9fe5f28ea1d5b5abf1af82dae8a4b68df3d1889eb6f988f5e8d31a") app.review.next() @@ -32,9 +32,6 @@ app.assert_screen("tbtd_start_review_blindsign") app.review.next() app.assert_screen("tbtl_review_1") - app.review.next() - app.assert_screen("operation_sign") - expected_apdu = "ef565fa445d815cd77518a4d14ce90b7a536627455f0930c9dbfa22a75d478d83e2bcb333ba0d639dd28c1b77c5860e552ab02092a50a57f1424f573278230ab8ba81d8a40956415278a27e3f28cae64d1f1f13bf613e6e9a57035e9e14511029000" app.review_confirm_signing(expected_apdu) diff --git a/tests/integration/touch/test_blindsign_valid.py b/tests/integration/touch/test_blindsign_valid.py index 9b7df00fb..69b88668e 100755 --- a/tests/integration/touch/test_blindsign_valid.py +++ b/tests/integration/touch/test_blindsign_valid.py @@ -19,7 +19,7 @@ from utils import ( tezos_app, - send_initialize_msg, + send_payload, index_screen ) @@ -29,8 +29,8 @@ app.assert_home() - send_initialize_msg(app,"800f000011048000002c800006c18000000080000000") - send_payload(app,"800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316") + app.send_initialize_msg("800f000011048000002c800006c18000000080000000") + app.send_apdu("800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316") screen = "tst_review" nb_screen = 2 @@ -45,9 +45,6 @@ app.review.next() app.assert_screen(index_screen(screen, index+1)) - app.review.next() - app.assert_screen("operation_sign") - expected_apdu = "f6d5fa0e79cac216e25104938ac873ca17ee9d7f06763719293b413cf2ed475cf63d045a1cc9f73eee5775c5d496fa9d3aa9ae57fb97217f746a8728639795b7b2220e84ce5759ed111399ea3263d810c230d6a4fffcb6e82797c5ca673a17089000" app.review_confirm_signing(expected_apdu) diff --git a/tests/integration/touch/test_expert_mode_rejections.py b/tests/integration/touch/test_expert_mode_rejections.py index e1608e254..10adeaa67 100755 --- a/tests/integration/touch/test_expert_mode_rejections.py +++ b/tests/integration/touch/test_expert_mode_rejections.py @@ -15,7 +15,7 @@ from utils import ( tezos_app, - send_initialize_msg, + send_payload, verify_reject_response, index_screen @@ -29,7 +29,7 @@ def sign_transfer_initialize(app): app.assert_home() - send_initialize_msg(app,"800f000011048000002c800006c18000000080000000") + app.send_initialize_msg("800f000011048000002c800006c18000000080000000") send_payload(app,"800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316") screen = "tst_review" diff --git a/tests/integration/touch/test_parsing_errors.py b/tests/integration/touch/test_parsing_errors.py index 50c7459b3..9ee14d848 100755 --- a/tests/integration/touch/test_parsing_errors.py +++ b/tests/integration/touch/test_parsing_errors.py @@ -17,7 +17,7 @@ from utils import ( tezos_app, - send_initialize_msg, + send_payload, verify_err_reject_response, reject_flow, verify_parsing_err_reject_response ) @@ -30,18 +30,18 @@ # original operation : 0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316 print("Invalid input: Unknown magic bytes") - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f81005e0100000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316") app.review.next() verify_parsing_err_reject_response(app, "invalid_tag") - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f81005e03000000000000000000000000000000000000000000000000000000000000000001016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316") app.review.next() verify_parsing_err_reject_response(app, "invalid_tag") print("Invalid input: 1 byte removed inside") - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f81005d0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e010000000000000000000000000000000000000000ff02000000020316") app.review.next() app.assert_screen("tpe_review_0_01") @@ -51,7 +51,7 @@ verify_parsing_err_reject_response(app, "invalid_tag") print("Invalid input: 1 byte introduce at the end") - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f81005f0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff0200000002031645") app.review.next() app.assert_screen("tpe_review_0_01") @@ -65,7 +65,7 @@ verify_parsing_err_reject_response(app, "invalid_tag") print("Invalid input: 1 byte introduced inside") - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f81005f0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e0100000000000000000000000000000000000000000000ff02000000020316") app.review.next() app.assert_screen("tpe_review_0_01") @@ -76,14 +76,14 @@ # full output: 12345678901234567890123456789012345678901234567890123456789012345678901234567890 print("Too Large input") - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f810028050092abf8e3d9e5f8cfd9ae8a9fe5f28ea1d5b5abf1af82dae8a4b68df3d1889eb6f988f5e8d31a") app.review.next() verify_parsing_err_reject_response(app, "too_large") # full output: {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{42}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} print("Too Deep expression") - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f0100eb0502000000f702000000f202000000ed02000000e802000000e302000000de02000000d902000000d402000000cf02000000ca02000000c502000000c002000000bb02000000b602000000b102000000ac02000000a702000000a2020000009d02000000980200000093020000008e02000000890200000084020000007f020000007a02000000750200000070020000006b02000000660200000061020000005c02000000570200000052020000004d02000000480200000043020000003e02000000390200000034020000002f020000002a02000000250200000020020000001b020000001602000000") app.review.next() app.assert_screen('tpe_review_too_deep_0') @@ -91,7 +91,7 @@ verify_parsing_err_reject_response(app, "too_deep") print("wrong last packet") - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f8100eb030000000000000000000000000000000000000000000000000000000000000000ce00ffdd6102321bc251e4a5190ad5b12b251069d9b4904e02030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c63966303966323935326433343532386337333366393436313563666333396263353535363139666335353064643461363762613232303863653865383637616133643133613665663939646662653332633639373461613961323135306432316563613239633333343965353963313362393038316631") app.review.next() app.assert_screen("tpe_review_1_01") diff --git a/tests/integration/touch/test_reject_review_operation.py b/tests/integration/touch/test_reject_review_operation.py index dc120cfa4..65969a16b 100755 --- a/tests/integration/touch/test_reject_review_operation.py +++ b/tests/integration/touch/test_reject_review_operation.py @@ -15,7 +15,7 @@ from utils import ( tezos_app, - send_initialize_msg, + send_payload ) @@ -27,12 +27,12 @@ def short_reject(app): app.assert_home() - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316") app.review_reject_signing(cancel_rejection=True) # Cancelling rejection lands us back on the same page - app.assert_screen("review_request_sign_operation") + app.assert_screen("review_screen", True) app.review_reject_signing() app.assert_home() diff --git a/tests/integration/touch/test_reject_transfer.py b/tests/integration/touch/test_reject_transfer.py index 35d3610b5..8fef221ac 100755 --- a/tests/integration/touch/test_reject_transfer.py +++ b/tests/integration/touch/test_reject_transfer.py @@ -28,11 +28,11 @@ app.send_apdu("800f000011048000002c800006c18000000080000000") app.expect_apdu_return("9000") - app.assert_screen("review_request_sign_operation") + app.assert_screen("review_screen", True) app.review.next() # Ensure we don't advance to a blank screen - app.assert_screen("review_request_sign_operation") + app.assert_screen("review_screen", True) app.send_apdu("800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316"); @@ -47,11 +47,11 @@ app.send_apdu("800f000011048000002c800006c18000000080000000") app.expect_apdu_return("9000") - app.assert_screen("review_request_sign_operation") + app.assert_screen("review_screen", True) app.review.next() # Ensure we don't advance to a blank screen - app.assert_screen("review_request_sign_operation") + app.assert_screen("review_screen", True) app.send_apdu("800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316"); diff --git a/tests/integration/touch/test_sign_complex_operation.py b/tests/integration/touch/test_sign_complex_operation.py old mode 100644 new mode 100755 index d27e9fa64..c7879983e --- a/tests/integration/touch/test_sign_complex_operation.py +++ b/tests/integration/touch/test_sign_complex_operation.py @@ -15,7 +15,6 @@ from utils import ( tezos_app, - send_initialize_msg, send_payload, index_screen ) @@ -44,8 +43,8 @@ app.assert_home() - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") - send_payload(app, "800f81ffb40300000000000000000000000000000000000000000000000000000000000000006d00ffdd6102321bc251e4a5190ad5b12b251069d9b4a0c21e040304c0843d0000000004050d036a000000060764035c038d9e00ffdd6102321bc251e4a5190ad5b12b251069d9b4904e05040500000002030600000004056303620000591e842444265757d6a65e3670ca18b5e662f9c0070002cc8e146741cf31fc00123b8c26baf95c57421a3c0000000764656661756c74") + app.send_initialize_msg("800f000011048000002c800006c18000000080000000") + app.send_apdu("800f81ffb40300000000000000000000000000000000000000000000000000000000000000006d00ffdd6102321bc251e4a5190ad5b12b251069d9b4a0c21e040304c0843d0000000004050d036a000000060764035c038d9e00ffdd6102321bc251e4a5190ad5b12b251069d9b4904e05040500000002030600000004056303620000591e842444265757d6a65e3670ca18b5e662f9c0070002cc8e146741cf31fc00123b8c26baf95c57421a3c0000000764656661756c74") screen = "review" nb_screen = 2 diff --git a/tests/integration/touch/test_sign_execute_outbox_messages.py b/tests/integration/touch/test_sign_execute_outbox_messages.py index 556af67a9..4bbe8db2e 100755 --- a/tests/integration/touch/test_sign_execute_outbox_messages.py +++ b/tests/integration/touch/test_sign_execute_outbox_messages.py @@ -16,7 +16,7 @@ from utils import ( tezos_app, - send_initialize_msg, + send_payload ) @@ -29,7 +29,7 @@ app.assert_home() - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f0100eb030000000000000000000000000000000000000000000000000000000000000000ce00ffdd6102321bc251e4a5190ad5b12b251069d9b4904e02030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c63966303966323935326433343532386337333366393436313563666333396263353535363139666335353064643461363762613232303863653865383637616133643133613665663939646662653332633639373461613961323135306432316563613239633333343965353963313362393038316631") app.review.next() app.assert_screen("tseom_review_00") @@ -51,9 +51,6 @@ app.review.next() app.assert_screen("operation_proof_396...834_1") - app.review.next() - app.assert_screen("operation_sign") - expected_apdu = "c08f5e1a02d15b05c4066b43fc31aa1ccad30f6c7a18f44723e5af0b6584292236e919219e90793ef502e8883f5317206277607438695933fcb954f4ef451db19628a114880836193c755ddda4bf188b9764231975b2c5ecb64bc4bdc9c459039000" app.review_confirm_signing(expected_apdu) diff --git a/tests/integration/touch/test_sign_transfer.py b/tests/integration/touch/test_sign_transfer.py index 2f7c47905..0eb30d6a0 100755 --- a/tests/integration/touch/test_sign_transfer.py +++ b/tests/integration/touch/test_sign_transfer.py @@ -15,7 +15,7 @@ from utils import ( tezos_app, - send_initialize_msg, + send_payload, index_screen ) @@ -30,7 +30,7 @@ app.assert_home() - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316") screen = "tst_review" @@ -46,16 +46,13 @@ app.review.next() app.assert_screen(index_screen(screen, index+1)) - app.review.next() - app.assert_screen("operation_sign") - expected_apdu = "f6d5fa0e79cac216e25104938ac873ca17ee9d7f06763719293b413cf2ed475cf63d045a1cc9f73eee5775c5d496fa9d3aa9ae57fb97217f746a8728639795b7b2220e84ce5759ed111399ea3263d810c230d6a4fffcb6e82797c5ca673a17089000" app.review_confirm_signing(expected_apdu) app.assert_home() # Now with expert enabled - send_initialize_msg(app, "800f000011048000002c800006c18000000080000000") + app.send_initialize_msg( "800f000011048000002c800006c18000000080000000") send_payload(app, "800f81005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316") screen = "tst_review" @@ -71,8 +68,7 @@ app.review.next() app.assert_screen(index_screen(screen, index+1)) - app.review.next() - app.assert_screen("operation_sign") + expected_apdu = "f6d5fa0e79cac216e25104938ac873ca17ee9d7f06763719293b413cf2ed475cf63d045a1cc9f73eee5775c5d496fa9d3aa9ae57fb97217f746a8728639795b7b2220e84ce5759ed111399ea3263d810c230d6a4fffcb6e82797c5ca673a17089000" app.review_confirm_signing(expected_apdu) diff --git a/tests/integration/touch/test_sign_transfer_without_hash.py b/tests/integration/touch/test_sign_transfer_without_hash.py index 73a974d58..fcbd49205 100755 --- a/tests/integration/touch/test_sign_transfer_without_hash.py +++ b/tests/integration/touch/test_sign_transfer_without_hash.py @@ -15,7 +15,7 @@ from utils import ( tezos_app, - send_initialize_msg, + send_payload, index_screen ) @@ -30,7 +30,7 @@ app.assert_home() - send_initialize_msg(app, "8004000011048000002c800006c18000000080000000") + app.send_initialize_msg( "8004000011048000002c800006c18000000080000000") send_payload(app, "800481005e0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316") screen = "review" @@ -46,9 +46,6 @@ app.review.next() app.assert_screen(index_screen(screen, index+1)) - app.review.next() - app.assert_screen("operation_sign") - expected_apdu = "f63d045a1cc9f73eee5775c5d496fa9d3aa9ae57fb97217f746a8728639795b7b2220e84ce5759ed111399ea3263d810c230d6a4fffcb6e82797c5ca673a17089000" app.review_confirm_signing(expected_apdu) diff --git a/tests/integration/touch/utils.py b/tests/integration/touch/utils.py index 6f4e4b332..60be39042 100644 --- a/tests/integration/touch/utils.py +++ b/tests/integration/touch/utils.py @@ -53,7 +53,7 @@ def with_retry(f, attempts=MAX_ATTEMPTS): return f() except Exception as e: if attempts <= 0: - print("- with_retry: attempts exhausted -") + print("- with_retry: attempts exhausted -{e}") raise e attempts -= 1 # Give plenty of time for speculos to update - can take a long time on CI machines @@ -124,6 +124,17 @@ def show_qr(self) -> None: self.client.finger_touch(*self.qr_position) +class BlindsigningStatus(Enum): + Large_Tx_only = 1 + ON = 2 + OFF = 3 + +class BlindsigningType(Enum): + NO_BLINDSIGN = 0 + BLINDSIGN = 2 + SUMMARYSIGN = 3 + + class UseCaseSettings(OriginalUseCaseSettings): """Extension of UseCaseSettings for our app.""" @@ -137,21 +148,20 @@ def toggle_expert_mode(self): """Toggle the expert_mode switch.""" self._toggle_list.choose(1) - def set_blindigning(self, value: int): - if value not in [1, 2, 3]: - raise ValueError("Value must be 1, 2 or 3") - self._toggle_list.choose(value) + def set_blindigning(self, status: BlindsigningStatus): + if status == BlindsigningStatus.Large_Tx_only: + if self.firmware == Firmware.STAX: + self.client.finger_touch(200, 180) + else: + self.client.finger_touch(240, 140) + else: + self._toggle_list.choose(status.value) def exit(self) -> None: """Exits settings.""" self.multi_page_exit() -class BlindsigningStatus(Enum): - Large_Tx_only = 1 - ON = 2 - OFF = 3 - class TezosAppScreen(metaclass=MetaScreen): use_case_welcome = UseCaseHomeExt use_case_settings = UseCaseSettings @@ -171,7 +181,7 @@ class TezosAppScreen(metaclass=MetaScreen): __golden: bool __snapshots_path: str __prefixed_snapshots_path: str - __snapshotted: List[str] = [] + __snapshotted: List[str] = [ ] def __init__(self, backend: BackendInterface, @@ -190,20 +200,20 @@ def __init__(self, self.commit = commit self.version = version self.__golden = golden + self.__update_fixed = os.getenv("UPDATE_FIXED") is not None if golden: # Setup for golden path = f"{self.__prefixed_snapshots_path}" Path(path).mkdir(parents=True, exist_ok=True) for filename in os.listdir(path): os.remove(os.path.join(path, filename)) - path = f"{self.__snapshots_path}" - home_path = os.path.join(path, "home.png") - if os.path.exists(home_path): - os.remove(home_path) - def send_apdu(self, data): + def send_apdu(self, data, raw=True): """Send hex-encoded bytes to the apdu""" - self.__backend.send_raw(bytes.fromhex(data)) + if raw: + self.__backend.send_raw(bytes.fromhex(data)) + else: + self.__backend.send(0x80, 0x0f, 0x00, 0x00, data) def remove_info_page(self): """ Delete the info page for golden tests""" @@ -212,6 +222,29 @@ def remove_info_page(self): if os.path.exists(info_path): os.remove(info_path) + def remove_expert_mode_pages(self): + """ Delete the info page for golden tests""" + if self.__golden: + info_path=os.path.join(self.__snapshots_path, "settings_expert_mode_on.png") + if os.path.exists(info_path): + os.remove(info_path) + info_path=os.path.join(self.__snapshots_path, "settings_expert_mode_off.png") + if os.path.exists(info_path): + os.remove(info_path) + + def remove_blindsigning_pages(self): + """ Delete the blindsigning pages for golden tests""" + if self.__golden: + blindsigning_path=os.path.join(self.__snapshots_path, "settings_BlindsigningStatus_Large_Tx_only.png") + if os.path.exists(blindsigning_path): + os.remove(blindsigning_path) + blindsigning_path=os.path.join(self.__snapshots_path, "settings_BlindsigningStatus_ON.png") + if os.path.exists(blindsigning_path): + os.remove(blindsigning_path) + blindsigning_path=os.path.join(self.__snapshots_path, "settings_BlindsigningStatus_OFF.png") + if os.path.exists(blindsigning_path): + os.remove(blindsigning_path) + def expect_apdu_return(self, expected): """Expect hex-encoded response from the apdu""" response = self.__backend.receive().raw @@ -230,15 +263,17 @@ def send_async_apdu(self, data): def assert_screen(self, screen, fixed: bool = False): golden = self.__golden and screen not in self.__snapshotted - if golden: - self.__snapshotted = self.__snapshotted + [screen] - input(f"Press ENTER to snapshot {screen}") if fixed: path = f'{self.__snapshots_path}/{screen}.png' + golden = golden and self.__update_fixed else: path = f'{self.__prefixed_snapshots_path}/{screen}.png' + if golden: + self.__snapshotted = self.__snapshotted + [screen] + input(f"Press ENTER to snapshot {screen}") + def check(): print(f"- Expecting {screen} -") assert self.__backend.compare_screen_with_snapshot(path, golden_run=golden) @@ -257,11 +292,9 @@ def assert_expert_mode(self, expert_mode=False): suffix += "_expert_on" self.assert_screen("settings" + suffix) - def assert_blindsigning_status( - self, blindsignStatus=BlindsigningStatus.Large_Tx_only - ): - suffix = "_" + str(blindsignStatus).replace(".", "-") - self.assert_screen("settings" + suffix) + def assert_blindsigning_status(self, blindsignStatus=BlindsigningStatus.Large_Tx_only): + suffix = "settings_" + str(blindsignStatus).replace(".", "_") + self.assert_screen(suffix, True) def quit(self): if os.getenv("NOQUIT") == None: @@ -282,10 +315,10 @@ def manual_ticker(self) -> Generator[None, None, None]: self.__backend.resume_ticker() @contextmanager - def fading_screen(self, screen) -> Generator[None, None, None]: + def fading_screen(self, screen, fixed=False) -> Generator[None, None, None]: with self.manual_ticker(): yield - self.assert_screen(screen) + self.assert_screen(screen, fixed) self.review.tap() # Not waiting for the screen to fade on its own def start_loading_operation(self, first_packet): @@ -298,7 +331,15 @@ def start_loading_operation(self, first_packet): self.send_apdu(first_packet) self.expect_apdu_return("9000") - def review_confirm_signing(self, expected_apdu): + def review_confirm_signing(self, expected_apdu, blindsigning_type : BlindsigningType= BlindsigningType.NO_BLINDSIGN): + self.review.next() + if blindsigning_type == BlindsigningType.NO_BLINDSIGN: + self.assert_screen("operation_sign") + elif blindsigning_type == BlindsigningType.BLINDSIGN: + self.assert_screen("operation_sign_blindsign") + else: + self.assert_screen("operation_sign_summary") + with self.fading_screen("signing_successful"): self.review.confirm() self.expect_apdu_return(expected_apdu) @@ -308,6 +349,25 @@ def enable_expert_mode(self): with self.fading_screen("enabled_expert_mode"): self.review.enable_expert.confirm() + + def set_expert_mode(self,initial_status: bool): + self.assert_home() + suffix = initial_status and "_on" or "_off" + suffix_2 = initial_status and "_off" or "_on" + self.welcome.settings() + self.assert_screen("settings_expert_mode" + suffix, True) + self.settings.toggle_expert_mode() + self.assert_screen("settings_expert_mode" + suffix_2, True ) + self.settings.multi_page_exit() + + def set_blindsigning_status(self, status: BlindsigningStatus): + self.assert_home() + self.welcome.settings() + self.settings.next() + self.settings.set_blindigning(status) + self.assert_blindsigning_status(status) + self.settings.multi_page_exit() + def expert_mode_splash(self): self.enable_expert_mode() self.assert_screen("expert_mode_splash") @@ -335,6 +395,12 @@ def process_blindsign_warnings(self, loading_operation: bool = False, apdu: str self.review.enable_blindsign.reject() + def send_initialize_msg(self, apdu): + self.send_apdu(apdu) + self.expect_apdu_return("9000") + self.assert_screen("review_screen", True) + + def tezos_app(prefix) -> TezosAppScreen: port = os.environ["PORT"] commit = os.environ["COMMIT_BYTES"] @@ -351,15 +417,9 @@ def assert_home_with_code(app, code): app.expect_apdu_failure(code) -def send_initialize_msg(app, apdu): - app.send_apdu(apdu) - app.expect_apdu_return("9000") - app.assert_screen("review_request_sign_operation") - - def send_payload(app, apdu): app.send_apdu(apdu) - app.assert_screen("review_request_sign_operation") + app.assert_screen("review_screen", True) def verify_parsing_err_reject_response(app, tag): @@ -368,7 +428,7 @@ def verify_parsing_err_reject_response(app, tag): reject_flow(app, "9405") def verify_err_reject_response(app, tag): - verify_reject_response_common(app, tag, "9405") + verify_reject_response_common(app, tag, "9405" ) def verify_reject_response(app, tag): @@ -385,7 +445,6 @@ def reject_flow(app, err_code): app.assert_screen("reject_review") with app.fading_screen("rejected"): app.review.reject_tx.confirm() - print("Clicked on confirm") assert_home_with_code(app, err_code)