diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efb29f046..a9d1f94c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: device: [nanos, nanosp, nanox, stax] runs-on: ubuntu-latest container: - image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:3.11.0 + image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:3.12.0 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/swap.yml b/.github/workflows/swap.yml index 69f993ba2..3583b3775 100644 --- a/.github/workflows/swap.yml +++ b/.github/workflows/swap.yml @@ -1,18 +1,18 @@ -name: Swap feature tests +name: Swap functional tests on: workflow_dispatch: push: branches: - main + - develop pull_request: jobs: job_functional_tests: - uses: functori/app-exchange/.github/workflows/reusable_swap_functional_tests.yml@ebc5932d939e2bad5eaf3d5e316626169da6ff23 + uses: LedgerHQ/app-exchange/.github/workflows/reusable_swap_functional_tests.yml@develop with: - repo_for_exchange: 'functori/app-exchange' - branch_for_exchange: 'ajinkyaraj-23@display-source-field' + branch_for_exchange: 'develop' branch_for_tezos: ${{ github.ref }} - run_for_devices: '["nanos", "nanosp", "stax"]' - test_filter: '"tezos_new"' + repo_for_tezos: ${{ github.repository }} + test_filter: '"tezos"' diff --git a/Makefile b/Makefile index c8ec568f5..c2586ccf7 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ docker_speculos: $(DOCKER) image tag $(LEDGERHQ)/speculos speculos docker_ledger_app_builder: - $(DOCKER) pull $(LEDGERHQ)/ledger-app-builder/ledger-app-builder:3.11.0 - $(DOCKER) image tag $(LEDGERHQ)/ledger-app-builder/ledger-app-builder:3.11.0 \ + $(DOCKER) pull $(LEDGERHQ)/ledger-app-builder/ledger-app-builder:3.12.0 + $(DOCKER) image tag $(LEDGERHQ)/ledger-app-builder/ledger-app-builder:3.12.0 \ ledger-app-builder docker_ledger_app_ocaml: diff --git a/app/src/apdu_pubkey.c b/app/src/apdu_pubkey.c index a80d7bb7f..e2dd49759 100644 --- a/app/src/apdu_pubkey.c +++ b/app/src/apdu_pubkey.c @@ -167,7 +167,8 @@ handle_apdu_get_public_key(command_t *cmd) bool prompt = cmd->ins == INS_PROMPT_PUBLIC_KEY; TZ_PREAMBLE(("cmd=%p", cmd)); - TZ_ASSERT(EXC_UNEXPECTED_STATE, global.step == ST_IDLE); + TZ_ASSERT(EXC_UNEXPECTED_STATE, + global.step == ST_IDLE || global.step == ST_SWAP_SIGN); TZ_ASSERT(EXC_WRONG_PARAM, cmd->p1 == 0); // do not expose pks without prompt through U2F (permissionless legacy diff --git a/app/src/apdu_sign.c b/app/src/apdu_sign.c index 90c7057fb..6973f8085 100644 --- a/app/src/apdu_sign.c +++ b/app/src/apdu_sign.c @@ -30,6 +30,10 @@ #include #include +#ifdef HAVE_SWAP +#include +#endif + #include "apdu.h" #include "apdu_sign.h" #include "globals.h" @@ -51,7 +55,6 @@ static void send_reject(int); static void send_continue(void); static void send_cancel(void); static void refill(void); -static void pass_from_clear_to_blind(void); static void stream_cb(tz_ui_cb_type_t); static void handle_first_apdu(command_t *); static void handle_first_apdu_clear(command_t *); @@ -151,82 +154,6 @@ send_continue(void) TZ_POSTAMBLE; } -#ifdef HAVE_NBGL - -static void -cancel_operation(uint8_t reject_code) -{ - TZ_PREAMBLE(("void")); - global.keys.apdu.sign.received_last_msg = true; - stream_cb(reject_code); - global.step = ST_IDLE; - nbgl_useCaseStatus("Transaction rejected", false, ui_home_init); - - TZ_POSTAMBLE; -} - -static void -cancel_operation_blindsign(void) -{ - cancel_operation(TZ_UI_STREAM_CB_BLINDSIGN_REJECT); -} - -static void -blindsign_splash(void) -{ - TZ_PREAMBLE(("void")); - nbgl_useCaseReviewStart( - &C_round_warning_64px, "Blind signing", - "This transaction can not be securely interpreted by Ledger Stax. It " - "might put your assets at risk.", - "Reject transaction", pass_from_clear_to_blind, - cancel_operation_blindsign); - - TZ_POSTAMBLE; -} - -static void -handle_blindsigning(bool confirm) -{ - TZ_PREAMBLE(("void")); - if (confirm) { - if (!N_settings.blindsigning) - toggle_blindsigning(); - nbgl_useCaseReviewStart(&C_round_check_64px, "Blind signing enabled", - NULL, "Reject transaction", blindsign_splash, - cancel_operation_blindsign); - - } else { - cancel_operation_blindsign(); - } - TZ_POSTAMBLE; -} - -void -switch_to_blindsigning(__attribute__((unused)) const char *err_type, - const char *err_code) -{ - TZ_PREAMBLE(("void")); - PRINTF("[DEBUG] refill_error: global.step = %d\n", global.step); - 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; - if (N_settings.blindsigning) { - nbgl_useCaseReviewStart(&C_round_warning_64px, - "Blind signing required:\nParsing Error", - err_code, "Reject transaction", - blindsign_splash, cancel_operation_blindsign); - } else { - nbgl_useCaseChoice(&C_round_warning_64px, - "Enable blind signing to authorize this " - "transaction:\nParsing Error", - err_code, "Enable blind signing", - "Reject transaction", handle_blindsigning); - } - - TZ_POSTAMBLE; -} -#endif static void refill_blo_im_full(void) @@ -235,8 +162,15 @@ refill_blo_im_full(void) size_t wrote = 0; TZ_PREAMBLE(("void")); - global.keys.apdu.sign.step = SIGN_ST_WAIT_USER_INPUT; +#ifdef HAVE_SWAP + if (G_called_from_swap) { + tz_parser_flush(st, global.line_buf, TZ_UI_STREAM_CONTENTS_SIZE); + // invoke refill until we consume entire msg. + TZ_SUCCEED(); + } +#endif + global.keys.apdu.sign.step = SIGN_ST_WAIT_USER_INPUT; #ifdef HAVE_BAGL if (st->field_info.is_field_complex && !N_settings.expert_mode) { tz_ui_stream_push(TZ_UI_STREAM_CB_NOCB, st->field_info.field_name, @@ -285,7 +219,6 @@ refill_blo_im_full(void) } #endif - tz_parser_flush_up_to(st, global.line_buf, TZ_UI_STREAM_CONTENTS_SIZE, wrote); TZ_POSTAMBLE; @@ -305,7 +238,12 @@ refill_blo_done(void) refill_blo_im_full(); TZ_SUCCEED(); } + global.keys.apdu.sign.step = SIGN_ST_WAIT_USER_INPUT; + if (global.step == ST_SWAP_SIGN) { + TZ_CHECK(sign_packet()); + TZ_SUCCEED(); + } #ifdef HAVE_BAGL tz_ui_stream_push_accept_reject(); #endif @@ -321,6 +259,12 @@ refill_error(void) TZ_PREAMBLE(("void")); global.keys.apdu.sign.step = SIGN_ST_WAIT_USER_INPUT; +#ifdef HAVE_SWAP + if (G_called_from_swap) { + global.keys.apdu.sign.u.clear.received_msg = false; + TZ_FAIL(EXC_PARSE_ERROR); + } +#endif #ifdef HAVE_BAGL tz_ui_stream_push_all(TZ_UI_STREAM_CB_NOCB, "Parsing error", @@ -515,10 +459,11 @@ handle_first_apdu(command_t *cmd) */ global.keys.apdu.sign.tag = 0; - TZ_ASSERT(EXC_UNEXPECTED_STATE, global.step == ST_CLEAR_SIGN); - TZ_CHECK(handle_first_apdu_clear(cmd)); + TZ_ASSERT(EXC_UNEXPECTED_STATE, + global.step == ST_CLEAR_SIGN || global.step == ST_SWAP_SIGN); + io_send_sw(SW_OK); global.keys.apdu.sign.step = SIGN_ST_WAIT_DATA; @@ -528,23 +473,36 @@ handle_first_apdu(command_t *cmd) static void handle_first_apdu_clear(__attribute__((unused)) command_t *cmd) { + TZ_PREAMBLE(("global.step=%d", global.step)); tz_parser_state *st = &global.keys.apdu.sign.u.clear.parser_state; global.keys.apdu.sign.u.clear.received_msg = false; - - tz_ui_stream_init(stream_cb); - + // NO ui display during swap. +#ifdef HAVE_SWAP + if (!G_called_from_swap) { +#endif + tz_ui_stream_init(stream_cb); + global.step = ST_CLEAR_SIGN; + if (global.step == ST_CLEAR_SIGN) { #ifdef TARGET_NANOS - tz_ui_stream_push(TZ_UI_STREAM_CB_NOCB, "Review operation", "", - TZ_UI_LAYOUT_HOME_PB, TZ_UI_ICON_EYE); + tz_ui_stream_push(TZ_UI_STREAM_CB_NOCB, "Review operation", "", + TZ_UI_LAYOUT_HOME_PB, TZ_UI_ICON_EYE); #elif defined(HAVE_BAGL) - tz_ui_stream_push(TZ_UI_STREAM_CB_NOCB, "Review", "operation", - TZ_UI_LAYOUT_HOME_PB, TZ_UI_ICON_EYE); + tz_ui_stream_push(TZ_UI_STREAM_CB_NOCB, "Review", "operation", + TZ_UI_LAYOUT_HOME_PB, TZ_UI_ICON_EYE); +#endif + } +#ifdef HAVE_SWAP + } else { + PRINTF("[DEBUG] If called from SWAP : global.step =%d\n", + global.step); + } #endif - tz_operation_parser_init(st, TZ_UNKNOWN_SIZE, false); tz_parser_refill(st, NULL, 0); tz_parser_flush(st, global.line_buf, TZ_UI_STREAM_CONTENTS_SIZE); + + TZ_POSTAMBLE; } static void @@ -580,7 +538,9 @@ handle_data_apdu(command_t *cmd) // clang-format off switch (global.step) { - case ST_CLEAR_SIGN: TZ_CHECK(handle_data_apdu_clear(cmd)); break; + case ST_CLEAR_SIGN: + case ST_SWAP_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; } @@ -608,10 +568,16 @@ handle_data_apdu_clear(command_t *cmd) if (PKT_IS_LAST(cmd)) tz_operation_parser_set_size( st, global.keys.apdu.sign.u.clear.total_length); - TZ_CHECK(refill()); - if (global.keys.apdu.sign.step == SIGN_ST_WAIT_USER_INPUT) - tz_ui_stream(); - + if (global.step == ST_SWAP_SIGN) { + do { + TZ_CHECK(refill()); + } while (global.keys.apdu.sign.u.clear.received_msg); + } else { + TZ_CHECK(refill()); + if (global.keys.apdu.sign.step == SIGN_ST_WAIT_USER_INPUT + && global.step != ST_SWAP_SIGN) + tz_ui_stream(); + } TZ_POSTAMBLE; } @@ -658,8 +624,7 @@ reviewChoice(bool confirm) if (confirm) { nbgl_useCaseStatus("TRANSACTION\nSIGNED", true, accept_blindsign_cb); } else { - nbgl_useCaseStatus("Transaction rejected", false, - reject_blindsign_cb); + tz_reject_ui(); } FUNC_LEAVE(); @@ -763,19 +728,18 @@ handle_apdu_sign(command_t *cmd) TZ_ASSERT(EXC_WRONG_LENGTH_FOR_INS, cmd->lc <= MAX_APDU_SIZE); if (PKT_IS_FIRST(cmd)) { - TZ_ASSERT(EXC_UNEXPECTED_STATE, global.step == ST_IDLE); + TZ_ASSERT(EXC_UNEXPECTED_STATE, + global.step == ST_IDLE || global.step == ST_SWAP_SIGN); memset(&global.keys, 0, sizeof(global.keys)); - - global.step = ST_CLEAR_SIGN; - TZ_CHECK(handle_first_apdu(cmd)); global.keys.apdu.sign.return_hash = return_hash; goto end; } - TZ_ASSERT(EXC_UNEXPECTED_STATE, - global.step == ST_BLIND_SIGN || global.step == ST_CLEAR_SIGN); + TZ_ASSERT(EXC_UNEXPECTED_STATE, global.step == ST_BLIND_SIGN + || global.step == ST_CLEAR_SIGN + || global.step == ST_SWAP_SIGN); TZ_ASSERT(EXC_INVALID_INS, return_hash == global.keys.apdu.sign.return_hash); TZ_CHECK(handle_data_apdu(cmd)); diff --git a/app/src/apdu_sign.h b/app/src/apdu_sign.h index b62094a0c..0880a6bed 100644 --- a/app/src/apdu_sign.h +++ b/app/src/apdu_sign.h @@ -66,7 +66,3 @@ typedef struct { } blind; } u; } apdu_sign_state_t; - -#ifdef HAVE_NBGL -void switch_to_blindsigning(const char *, const char *); -#endif diff --git a/app/src/app_main.c b/app/src/app_main.c index 00726792d..c1505899a 100644 --- a/app/src/app_main.c +++ b/app/src/app_main.c @@ -24,7 +24,9 @@ #include #include #include - +#ifdef HAVE_SWAP +#include +#endif #include "apdu.h" #include "app_main.h" #include "globals.h" @@ -124,9 +126,15 @@ app_main(void) /* ST_ERROR implies that we are completely unknown and need to reset */ global.step = ST_ERROR; - for (;;) { TZ_PREAMBLE(("void")); +#ifdef HAVE_SWAP + if (G_called_from_swap) { + global.step = ST_SWAP_SIGN; + } + PRINTF("[SWAP] : G_called_from_swap = %d , global.step = %d", + G_called_from_swap, global.step); +#endif if (global.step == ST_ERROR) { global.step = ST_IDLE; ui_home_init(); diff --git a/app/src/globals.h b/app/src/globals.h index 2da08ad67..b0510da81 100644 --- a/app/src/globals.h +++ b/app/src/globals.h @@ -75,6 +75,7 @@ typedef enum { ST_CLEAR_SIGN, ST_BLIND_SIGN, ST_PROMPT, + ST_SWAP_SIGN, ST_ERROR } main_step_t; diff --git a/app/src/handle_swap.c b/app/src/handle_swap.c index 7d4278801..2a08a1b4a 100644 --- a/app/src/handle_swap.c +++ b/app/src/handle_swap.c @@ -33,8 +33,10 @@ #include "parser/num_parser.h" // based on app-exchange -#define TICKER_MAX_SIZE 9 +#define TICKER "XTZ" #define ADDRESS_MAX_SIZE 63 +/* the smallest unit is microtez */ +#define DECIMALS 6 /* Check check_address_parameters_t.address_to_check against specified * parameters. @@ -56,17 +58,6 @@ swap_handle_check_address(check_address_parameters_t *params) goto error; } - if (params->extra_id_to_check == NULL) { - PRINTF("[ERROR] Extra id is null\n"); - goto error; - } - - if (params->extra_id_to_check[0] != '\0') { - PRINTF("[ERROR] Extra id is not empty: %s\n", - params->extra_id_to_check); - goto error; - } - char address[TZ_CAPTURE_BUFFER_SIZE] = {0}; // Always tz1 @@ -102,15 +93,6 @@ swap_handle_get_printable_amount(get_printable_amount_parameters_t *params) FUNC_ENTER(("params=%p", params)); uint64_t amount; - uint8_t decimals; - char ticker[TICKER_MAX_SIZE]; - - if (!swap_parse_config(params->coin_configuration, - params->coin_configuration_length, ticker, - sizeof(ticker), &decimals)) { - PRINTF("[ERROR] Fail to parse config\n"); - goto error; - } if (!swap_str_to_u64(params->amount, params->amount_length, &amount)) { PRINTF("[ERROR] Fail to parse amount\n"); @@ -119,13 +101,13 @@ swap_handle_get_printable_amount(get_printable_amount_parameters_t *params) if (!format_fpu64_trimmed(params->printable_amount, sizeof(params->printable_amount), amount, - decimals)) { + DECIMALS)) { PRINTF("[ERROR] Fail to print amount\n"); goto error; } strlcat(params->printable_amount, " ", sizeof(params->printable_amount)); - strlcat(params->printable_amount, ticker, + strlcat(params->printable_amount, TICKER, sizeof(params->printable_amount)); FUNC_LEAVE(); @@ -184,17 +166,6 @@ swap_copy_transaction_parameters(create_transaction_parameters_t *params) goto error; } - if (params->destination_address_extra_id == NULL) { - PRINTF("[ERROR] Destination address extra id is null\n"); - goto error; - } - - if (params->destination_address_extra_id[0] != '\0') { - PRINTF("[ERROR] Destination address extra id is not empty: %s\n", - params->destination_address_extra_id); - goto error; - } - os_explicit_zero_BSS_segment(); G_swap_transaction_result = ¶ms->result; @@ -224,9 +195,10 @@ swap_check_validity(void) os_sched_exit(-1); G_swap_response_ready = true; - PRINTF("[DEBUG] batch_index = %u, tag=%d\n", op->batch_index, - op->last_tag); - TZ_ASSERT(EXC_REJECT, op->batch_index == 1); + PRINTF("[DEBUG] batch_index = %u, nb_reveal=%d, tag=%d\n", + op->batch_index, op->nb_reveal, op->last_tag); + TZ_ASSERT(EXC_REJECT, op->nb_reveal <= 1); + TZ_ASSERT(EXC_REJECT, op->batch_index - op->nb_reveal == 1); TZ_ASSERT(EXC_REJECT, op->last_tag == TZ_OPERATION_TAG_TRANSACTION); TZ_ASSERT(EXC_REJECT, op->last_amount == G_swap_params.amount); TZ_ASSERT(EXC_REJECT, op->last_fee == G_swap_params.fee); diff --git a/app/src/keys.c b/app/src/keys.c index 7dca80111..92bb8392b 100644 --- a/app/src/keys.c +++ b/app/src/keys.c @@ -163,6 +163,23 @@ public_key_hash(uint8_t *hash_out, size_t hash_out_size, TZ_POSTAMBLE; } +/** + * @brief Sign a hash with eddsa using the device seed derived from the + * specified bip32 path and seed key. + * + * @param[in] derivation_type Derivation type, ex. ED25519 + * + * @param[in] path Bip32 path to use for derivation. + * + * @param[in] hash Digest of the message to be signed. + * + * @param[in] hash_len Length of the digest in octets. + * + * @param[out] sig Buffer where to store the signature. + * + * @param[in] sig_len Length of the signature buffer, updated with + * signature length. + */ void sign(derivation_type_t derivation_type, const bip32_path_t *path, const uint8_t *hash, size_t hashlen, uint8_t *sig, size_t *siglen) diff --git a/app/src/parser/operation_parser.c b/app/src/parser/operation_parser.c index 6654be925..91c7d72f8 100644 --- a/app/src/parser/operation_parser.c +++ b/app/src/parser/operation_parser.c @@ -27,13 +27,15 @@ static tz_parser_result push_frame(tz_parser_state *, static tz_parser_result pop_frame(tz_parser_state *); #ifdef TEZOS_DEBUG -const char *const tz_operation_parser_step_name[] = {"MAGIC", +const char *const tz_operation_parser_step_name[] = {"OPTION", + "TUPLE", + "MAGIC", "READ_BINARY", "BRANCH", "BATCH", "TAG", "SIZE", - "OPERATION", + "FIELD", "PRINT", "PARTIAL_PRINT", "READ_NUM", @@ -47,179 +49,151 @@ const char *const tz_operation_parser_step_name[] = {"MAGIC", "READ_SORU_KIND", "READ_BALLOT", "READ_PROTOS"}; + +#define STRING_STEP(step) \ + (const char *)PIC(tz_operation_parser_step_name[step]) + #endif // clang-format off -const tz_operation_field_descriptor proposals_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_PKH, true, false, false, false}, - {"Period", TZ_OPERATION_FIELD_INT32, true, false, false, false}, - {"Proposal", TZ_OPERATION_FIELD_PROTOS, true, false, false, false}, - {NULL, 0, 0, 0, 0, 0 } -}; -const tz_operation_field_descriptor ballot_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_PKH, true, false, false, false}, - {"Period", TZ_OPERATION_FIELD_INT32, true, false, false, false}, - {"Proposal", TZ_OPERATION_FIELD_PROTO, true, false, false, false}, - {"Ballot", TZ_OPERATION_FIELD_BALLOT, true, false, false, false}, - {NULL, 0, 0, 0, 0, 0 } -}; +// Default .skip=false, .complex=false +#define TZ_OPERATION_FIELD(name_v, kind_v, ...) \ + {.name=name_v, .kind=kind_v, __VA_ARGS__} -const tz_operation_field_descriptor failing_noop_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Message", TZ_OPERATION_FIELD_BINARY, true, false, false, false}, - {NULL, 0, 0, 0, 0, 0 } -}; +#define TZ_OPERATION_LAST_FIELD {0} -const tz_operation_field_descriptor transaction_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Amount", TZ_OPERATION_FIELD_AMOUNT, true, false, false, false}, - {"Destination", TZ_OPERATION_FIELD_DESTINATION, true, false, false, false}, - {"Parameter", TZ_OPERATION_FIELD_PARAMETER, false, false, false, true }, - {NULL, 0, 0, 0, 0, 0 } -}; +// Default .skip=false, .complex=false +#define TZ_OPERATION_OPTION_FIELD(name_v, field_v, display_none, ...) \ + {.name=name_v, .kind=TZ_OPERATION_FIELD_OPTION, \ + .field_option={ \ + .field=&(const tz_operation_field_descriptor)field_v, \ + display_none \ + }, \ + __VA_ARGS__} -const tz_operation_field_descriptor reveal_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Public key", TZ_OPERATION_FIELD_PK, true, false, false, false}, - {NULL, 0, 0, 0, 0, 0 } -}; +#define TZ_OPERATION_TUPLE_FIELD(name_v, ...) \ + {.name=name_v, .kind=TZ_OPERATION_FIELD_TUPLE, \ + .field_tuple={ \ + .fields=(const tz_operation_field_descriptor[]){ \ + __VA_ARGS__, \ + TZ_OPERATION_LAST_FIELD \ + } \ + } \ + } -const tz_operation_field_descriptor delegation_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Delegate", TZ_OPERATION_FIELD_PKH, false, false, true, false}, - {NULL, 0, 0, 0, 0, 0 } -}; +#define TZ_OPERATION_FIELDS(name, ...) \ + const tz_operation_field_descriptor name[] = { __VA_ARGS__, TZ_OPERATION_LAST_FIELD} -const tz_operation_field_descriptor reg_glb_cst_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Value", TZ_OPERATION_FIELD_EXPR, true, false, false, true }, - {NULL, 0, 0, 0, 0, 0 } -}; +TZ_OPERATION_FIELDS(proposals_fields, + TZ_OPERATION_FIELD("Source", TZ_OPERATION_FIELD_PKH), + TZ_OPERATION_FIELD("Period", TZ_OPERATION_FIELD_INT32), + TZ_OPERATION_FIELD("Proposal", TZ_OPERATION_FIELD_PROTOS) +); -const tz_operation_field_descriptor set_deposit_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Staking limit", TZ_OPERATION_FIELD_AMOUNT, false, false, true, false}, - {NULL, 0, 0, 0, 0, 0 } -}; +TZ_OPERATION_FIELDS(ballot_fields, + TZ_OPERATION_FIELD("Source", TZ_OPERATION_FIELD_PKH), + TZ_OPERATION_FIELD("Period", TZ_OPERATION_FIELD_INT32), + TZ_OPERATION_FIELD("Proposal", TZ_OPERATION_FIELD_PROTO), + TZ_OPERATION_FIELD("Ballot", TZ_OPERATION_FIELD_BALLOT) +); -const tz_operation_field_descriptor inc_paid_stg_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Amount", TZ_OPERATION_FIELD_INT, true, false, false, false}, - {"Destination", TZ_OPERATION_FIELD_DESTINATION, true, false, false, false}, - {NULL, 0, 0, 0, 0, 0 } -}; +TZ_OPERATION_FIELDS(failing_noop_fields, + TZ_OPERATION_FIELD("Message", TZ_OPERATION_FIELD_BINARY) +); -const tz_operation_field_descriptor update_ck_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Public key", TZ_OPERATION_FIELD_PK, true, false, false, false}, - {NULL, 0, 0, 0, 0, 0 } -}; +#define TZ_OPERATION_MANAGER_OPERATION_FIELDS \ + TZ_OPERATION_FIELD("Source", TZ_OPERATION_FIELD_SOURCE), \ + TZ_OPERATION_FIELD("Fee", TZ_OPERATION_FIELD_FEE), \ + TZ_OPERATION_FIELD("_Counter", TZ_OPERATION_FIELD_NAT, .skip=true), \ + TZ_OPERATION_FIELD("_Gas", TZ_OPERATION_FIELD_NAT, .skip=true), \ + TZ_OPERATION_FIELD("Storage limit", TZ_OPERATION_FIELD_NAT) -const tz_operation_field_descriptor origination_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Balance", TZ_OPERATION_FIELD_AMOUNT, true, false, false, false}, - {"Delegate", TZ_OPERATION_FIELD_PKH, false, false, true, false}, - {"Code", TZ_OPERATION_FIELD_EXPR, true, false, false, true }, - {"Storage", TZ_OPERATION_FIELD_EXPR, true, false, false, true }, - {NULL, 0, 0, 0, 0, 0 } -}; +TZ_OPERATION_FIELDS(transaction_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_FIELD("Amount", TZ_OPERATION_FIELD_AMOUNT), + TZ_OPERATION_FIELD("Destination", TZ_OPERATION_FIELD_DESTINATION), + TZ_OPERATION_OPTION_FIELD("_Parameters", + TZ_OPERATION_TUPLE_FIELD("_Parameters", + TZ_OPERATION_FIELD("Entrypoint", TZ_OPERATION_FIELD_SMART_ENTRYPOINT), + TZ_OPERATION_FIELD("Parameter", TZ_OPERATION_FIELD_EXPR, .complex=true)), + .display_none=false) +); -const tz_operation_field_descriptor transfer_tck_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Contents", TZ_OPERATION_FIELD_EXPR, true, false, false, true }, - {"Type", TZ_OPERATION_FIELD_EXPR, true, false, false, true }, - {"Ticketer", TZ_OPERATION_FIELD_DESTINATION, true, false, false, false}, - {"Amount", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Destination", TZ_OPERATION_FIELD_DESTINATION, true, false, false, false}, - {"Entrypoint", TZ_OPERATION_FIELD_STRING, true, false, false, false}, - {NULL, 0, 0, 0, 0, 0 } -}; +TZ_OPERATION_FIELDS(reveal_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_FIELD("Public key", TZ_OPERATION_FIELD_PK) +); -const tz_operation_field_descriptor soru_add_msg_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Message", TZ_OPERATION_FIELD_SORU_MESSAGES, true, false, false, false}, - {NULL, 0, 0, 0, 0, 0 } -}; +TZ_OPERATION_FIELDS(delegation_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_OPTION_FIELD("Delegate", + TZ_OPERATION_FIELD("Delegate", TZ_OPERATION_FIELD_PKH), + .display_none=true) +); -const tz_operation_field_descriptor soru_exe_msg_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Rollup", TZ_OPERATION_FIELD_SR, true, false, false, false}, - {"Commitment", TZ_OPERATION_FIELD_SRC, true, false, false, false}, - {"Output proof", TZ_OPERATION_FIELD_BINARY, true, false, false, true }, - {NULL, 0, 0, 0, 0, 0 } -}; +TZ_OPERATION_FIELDS(reg_glb_cst_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_FIELD("Value", TZ_OPERATION_FIELD_EXPR, .complex=true) +); -const tz_operation_field_descriptor soru_origin_fields[] = { - // Name, Kind, Req, Skip, None, Complex - {"Source", TZ_OPERATION_FIELD_SOURCE, true, false, false, false}, - {"Fee", TZ_OPERATION_FIELD_FEE, true, false, false, false}, - {"Counter", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Gas", TZ_OPERATION_FIELD_NAT, true, true, false, false}, - {"Storage limit", TZ_OPERATION_FIELD_NAT, true, false, false, false}, - {"Kind", TZ_OPERATION_FIELD_SORU_KIND, true, false, false, false}, - {"Kernel", TZ_OPERATION_FIELD_BINARY, true, false, false, true }, - {"Proof", TZ_OPERATION_FIELD_BINARY, true, false, false, true }, - {"Parameters", TZ_OPERATION_FIELD_EXPR, true, false, false, true }, - {NULL, 0, 0, 0, 0, 0 } -}; +TZ_OPERATION_FIELDS(set_deposit_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_OPTION_FIELD("Staking limit", + TZ_OPERATION_FIELD("Staking limit", TZ_OPERATION_FIELD_AMOUNT), + .display_none=true) +); + +TZ_OPERATION_FIELDS(inc_paid_stg_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_FIELD("Amount", TZ_OPERATION_FIELD_INT), + TZ_OPERATION_FIELD("Destination", TZ_OPERATION_FIELD_DESTINATION) +); + +TZ_OPERATION_FIELDS(update_ck_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_FIELD("Public key", TZ_OPERATION_FIELD_PK) +); + +TZ_OPERATION_FIELDS(origination_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_FIELD("Balance", TZ_OPERATION_FIELD_AMOUNT), + TZ_OPERATION_OPTION_FIELD("Delegate", + TZ_OPERATION_FIELD("Delegate", TZ_OPERATION_FIELD_PKH), + .display_none=true), + TZ_OPERATION_FIELD("Code", TZ_OPERATION_FIELD_EXPR, .complex=true), + TZ_OPERATION_FIELD("Storage", TZ_OPERATION_FIELD_EXPR, .complex=true) +); + +TZ_OPERATION_FIELDS(transfer_tck_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_FIELD("Contents", TZ_OPERATION_FIELD_EXPR, .complex=true), + TZ_OPERATION_FIELD("Type", TZ_OPERATION_FIELD_EXPR, .complex=true), + TZ_OPERATION_FIELD("Ticketer", TZ_OPERATION_FIELD_DESTINATION), + TZ_OPERATION_FIELD("Amount", TZ_OPERATION_FIELD_NAT), + TZ_OPERATION_FIELD("Destination", TZ_OPERATION_FIELD_DESTINATION), + TZ_OPERATION_FIELD("Entrypoint", TZ_OPERATION_FIELD_STRING) +); + +TZ_OPERATION_FIELDS(soru_add_msg_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_FIELD("Message", TZ_OPERATION_FIELD_SORU_MESSAGES) +); + +TZ_OPERATION_FIELDS(soru_exe_msg_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_FIELD("Rollup", TZ_OPERATION_FIELD_SR), + TZ_OPERATION_FIELD("Commitment", TZ_OPERATION_FIELD_SRC), + TZ_OPERATION_FIELD("Output proof", TZ_OPERATION_FIELD_BINARY, .complex=true) +); + +TZ_OPERATION_FIELDS(soru_origin_fields, + TZ_OPERATION_MANAGER_OPERATION_FIELDS, + TZ_OPERATION_FIELD("Kind", TZ_OPERATION_FIELD_SORU_KIND), + TZ_OPERATION_FIELD("Kernel", TZ_OPERATION_FIELD_BINARY, .complex=true), + TZ_OPERATION_FIELD("Proof", TZ_OPERATION_FIELD_BINARY, .complex=true), + TZ_OPERATION_FIELD("Parameters", TZ_OPERATION_FIELD_EXPR, .complex=true) +); const tz_operation_descriptor tz_operation_descriptors[] = { {TZ_OPERATION_TAG_PROPOSALS, "Proposals", proposals_fields }, @@ -288,6 +262,7 @@ tz_operation_parser_init(tz_parser_state *state, uint16_t size, op->batch_index = 0; #ifdef HAVE_SWAP op->last_tag = TZ_OPERATION_TAG_END; + op->nb_reveal = 0; op->last_fee = 0; op->last_amount = 0; #endif // HAVE_SWAP @@ -333,679 +308,899 @@ tz_print_string(tz_parser_state *state) tz_continue; } -tz_parser_result -tz_operation_parser_step(tz_parser_state *state) +#define ASSERT_STEP(state, expected_step) \ + do { \ + tz_operation_parser_step_kind step = (state)->operation.frame->step; \ + if (step != TZ_OPERATION_STEP_##expected_step) { \ + PRINTF("[DEBUG] expected step %s but got step %s)\n", \ + STRING_STEP(TZ_OPERATION_STEP_##expected_step), \ + STRING_STEP(step)); \ + tz_raise(INVALID_STATE); \ + } \ + } while (0) + +/* Update the state in order to read the field if it is present */ +static tz_parser_result +tz_step_option(tz_parser_state *state) { - tz_operation_state *op = &state->operation; - tz_parser_regs *regs = &state->regs; + ASSERT_STEP(state, OPTION); + tz_operation_state *op = &state->operation; + uint8_t present; + tz_must(tz_parser_read(state, &present)); + if (!present) { + if (op->frame->step_option.display_none) { + if (op->frame->step_option.field->skip) + tz_raise(INVALID_STATE); + op->frame->step = TZ_OPERATION_STEP_PRINT; + op->frame->step_print.str = (char *)unset_message; + } else { + tz_must(pop_frame(state)); + } + } else { + op->frame->step = TZ_OPERATION_STEP_FIELD; + op->frame->step_field.field = op->frame->step_option.field; + } + tz_continue; +} - // cannot restart after error - if (TZ_IS_ERR(state->errno)) - tz_reraise; +/* Update the state in order to read the fields in a field tuple */ +static tz_parser_result +tz_step_tuple(tz_parser_state *state) +{ + ASSERT_STEP(state, TUPLE); + tz_operation_state *op = &state->operation; + tz_parser_regs *regs = &state->regs; + const tz_operation_field_descriptor *field = PIC( + &op->frame->step_tuple.fields[op->frame->step_tuple.field_index]); - // nothing else to do - if (op->frame == NULL) - tz_stop(DONE); + // Remaining content from previous section - display this first. + if (regs->oofs > 0) + tz_stop(IM_FULL); - PRINTF( - "[DEBUG] operation(frame: %d, offset:%d/%d, ilen: %d, olen: %d, " - "step: %s, errno: %s)\n", - (int)(op->frame - op->stack), (int)state->ofs, (int)op->stack[0].stop, - (int)regs->ilen, (int)regs->oofs, - (const char *)PIC(tz_operation_parser_step_name[op->frame->step]), - tz_parser_result_name(state->errno)); + if (field->kind == TZ_OPERATION_FIELD_END) { + // is_field_complex is reset after reaching the last field + state->field_info.is_field_complex = false; + tz_must(pop_frame(state)); + } else { + op->frame->step_tuple.field_index++; + tz_must(push_frame(state, TZ_OPERATION_STEP_FIELD)); + op->frame->step_field.field = field; + } + tz_continue; +} - switch (op->frame->step) { - case TZ_OPERATION_STEP_MAGIC: { - uint8_t b; - tz_must(tz_parser_read(state, &b)); - switch (b) { - case 3: // manager/anonymous operation - STRLCPY(state->field_info.field_name, "Branch"); - op->stack[0].step = TZ_OPERATION_STEP_BRANCH; - push_frame(state, - TZ_OPERATION_STEP_READ_BYTES); // ignore result, - // assume success - op->frame->step_read_bytes.kind = TZ_OPERATION_FIELD_BH; - op->frame->step_read_bytes.skip = true; - op->frame->step_read_bytes.ofs = 0; - op->frame->step_read_bytes.len = 32; - break; - case 5: // micheline expression - op->frame->step = TZ_OPERATION_STEP_READ_MICHELINE; - op->frame->step_read_micheline.inited = 0; - op->frame->step_read_micheline.skip = false; - op->frame->step_read_micheline.name - = (char *)PIC(expression_name); - op->frame->stop = 0; - break; - default: - tz_raise(INVALID_TAG); - } +/* Update the state in order to read an operation or a micheline expression + * based on a magic byte */ +static tz_parser_result +tz_step_magic(tz_parser_state *state) +{ + ASSERT_STEP(state, MAGIC); + tz_operation_state *op = &state->operation; + uint8_t b; + tz_must(tz_parser_read(state, &b)); + switch (b) { + case 3: // manager/anonymous operation + STRLCPY(state->field_info.field_name, "Branch"); + op->stack[0].step = TZ_OPERATION_STEP_BRANCH; + push_frame(state, + TZ_OPERATION_STEP_READ_BYTES); // ignore result, + // assume success + op->frame->step_read_bytes.kind = TZ_OPERATION_FIELD_BH; + op->frame->step_read_bytes.skip = true; + op->frame->step_read_bytes.ofs = 0; + op->frame->step_read_bytes.len = 32; break; - } - case TZ_OPERATION_STEP_SIZE: { - uint8_t b; - tz_must(tz_parser_read(state, &b)); - if (op->frame->step_size.size > 255) - tz_raise(TOO_LARGE); // enforce 16-bit restriction - op->frame->step_size.size = op->frame->step_size.size << 8 | b; - op->frame->step_size.size_len--; - if (op->frame->step_size.size_len <= 0) { - op->frame[-1].stop = state->ofs + op->frame->step_size.size; - tz_must(pop_frame(state)); - } + case 5: // micheline expression + op->frame->step = TZ_OPERATION_STEP_READ_MICHELINE; + op->frame->step_read_micheline.inited = 0; + op->frame->step_read_micheline.skip = false; + op->frame->step_read_micheline.name = (char *)PIC(expression_name); + op->frame->stop = 0; break; + default: + tz_raise(INVALID_TAG); + } + tz_continue; +} + +/* Read a 4-byte size */ +static tz_parser_result +tz_step_size(tz_parser_state *state) +{ + ASSERT_STEP(state, SIZE); + tz_operation_state *op = &state->operation; + uint8_t b; + tz_must(tz_parser_read(state, &b)); + if (op->frame->step_size.size > 255) + tz_raise(TOO_LARGE); // enforce 16-bit restriction + op->frame->step_size.size = op->frame->step_size.size << 8 | b; + op->frame->step_size.size_len--; + if (op->frame->step_size.size_len <= 0) { + op->frame[-1].stop = state->ofs + op->frame->step_size.size; + tz_must(pop_frame(state)); } - case TZ_OPERATION_STEP_TAG: { - const tz_operation_descriptor *d; - uint8_t t; - tz_must(tz_parser_read(state, &t)); + tz_continue; +} + +/* Update the state in order to read an operation based on a tag byte */ +static tz_parser_result +tz_step_tag(tz_parser_state *state) +{ + ASSERT_STEP(state, TAG); + tz_operation_state *op = &state->operation; + const tz_operation_descriptor *d; + uint8_t t; + tz_must(tz_parser_read(state, &t)); #ifdef HAVE_SWAP - op->last_tag = t; + op->last_tag = t; + if (t == TZ_OPERATION_TAG_REVEAL) + op->nb_reveal++; #endif // HAVE_SWAP - for (d = tz_operation_descriptors; d->tag != TZ_OPERATION_TAG_END; - d++) { - if (d->tag == t) { - op->frame->step = TZ_OPERATION_STEP_OPERATION; - op->frame->step_operation.descriptor = d; - op->frame->step_operation.field = 0; - tz_must(push_frame(state, TZ_OPERATION_STEP_PRINT)); - snprintf(state->field_info.field_name, 30, "Operation (%d)", - op->batch_index); - op->frame->step_print.str = d->name; - tz_continue; - } + for (d = tz_operation_descriptors; d->tag != TZ_OPERATION_TAG_END; d++) { + if (d->tag == t) { + op->frame->step = TZ_OPERATION_STEP_TUPLE; + op->frame->step_tuple.fields = d->fields; + op->frame->step_tuple.field_index = 0; + tz_must(push_frame(state, TZ_OPERATION_STEP_PRINT)); + snprintf(state->field_info.field_name, 30, "Operation (%d)", + op->batch_index); + op->frame->step_print.str = d->name; + tz_continue; } - tz_raise(INVALID_TAG); } - case TZ_OPERATION_STEP_READ_MICHELINE: { - if (!op->frame->step_read_micheline.inited) { - op->frame->step_read_micheline.inited = 1; - STRLCPY(state->field_info.field_name, - op->frame->step_read_micheline.name); - tz_micheline_parser_init(state); - } - tz_micheline_parser_step(state); - if (state->errno == TZ_BLO_DONE) { - if (op->frame->stop != 0 && state->ofs != op->frame->stop) - tz_raise(TOO_LARGE); - tz_must(pop_frame(state)); - if (regs->oofs > 0) - tz_stop(IM_FULL); - else - tz_continue; - } - tz_reraise; + tz_raise(INVALID_TAG); +} + +/* Read a micheline expression */ +static tz_parser_result +tz_step_read_micheline(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_MICHELINE); + tz_operation_state *op = &state->operation; + tz_parser_regs *regs = &state->regs; + if (!op->frame->step_read_micheline.inited) { + op->frame->step_read_micheline.inited = 1; + STRLCPY(state->field_info.field_name, + op->frame->step_read_micheline.name); + tz_micheline_parser_init(state); } - case TZ_OPERATION_STEP_READ_NUM: { - uint8_t b; - tz_must(tz_parser_read(state, &b)); - tz_must(tz_parse_num_step(&state->buffers.num, - &op->frame->step_read_num.state, b, - op->frame->step_read_num.natural)); - if (op->frame->step_read_num.state.stop) { + tz_micheline_parser_step(state); + if (state->errno == TZ_BLO_DONE) { + if (op->frame->stop != 0 && state->ofs != op->frame->stop) + tz_raise(TOO_LARGE); + tz_must(pop_frame(state)); + if (regs->oofs > 0) + tz_stop(IM_FULL); + else + tz_continue; + } + tz_reraise; +} + +/* Read a number */ +static tz_parser_result +tz_step_read_num(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_NUM); + tz_operation_state *op = &state->operation; + uint8_t b; + tz_must(tz_parser_read(state, &b)); + tz_must(tz_parse_num_step(&state->buffers.num, + &op->frame->step_read_num.state, b, + op->frame->step_read_num.natural)); + if (op->frame->step_read_num.state.stop) { #ifdef HAVE_SWAP - uint64_t value; - if (!tz_string_to_mutez(state->buffers.num.decimal, &value)) - tz_raise(INVALID_DATA); - switch (op->frame->step_read_num.kind) { - case TZ_OPERATION_FIELD_AMOUNT: - op->last_amount = value; - break; - case TZ_OPERATION_FIELD_FEE: - op->last_fee = value; - break; - default: - break; - } + uint64_t value; + if (!tz_string_to_mutez(state->buffers.num.decimal, &value)) + tz_raise(INVALID_DATA); + switch (op->frame->step_read_num.kind) { + case TZ_OPERATION_FIELD_AMOUNT: + op->last_amount = value; + break; + case TZ_OPERATION_FIELD_FEE: + op->last_fee = value; + break; + default: + break; + } #endif // HAVE_SWAP - if (op->frame->step_read_num.skip) { - tz_must(pop_frame(state)); - tz_continue; + if (op->frame->step_read_num.skip) { + tz_must(pop_frame(state)); + tz_continue; + } + char *str = state->buffers.num.decimal; + op->frame->step = TZ_OPERATION_STEP_PRINT; + switch (op->frame->step_read_num.kind) { + case TZ_OPERATION_FIELD_INT: + case TZ_OPERATION_FIELD_NAT: + break; + case TZ_OPERATION_FIELD_FEE: + case TZ_OPERATION_FIELD_AMOUNT: { + int len = 0; + while (str[len]) + len++; + if (len == 1 && str[0] == 0) + // just 0 + goto add_currency; + if (len < 7) { + // less than one tez, pad left up to the '0.' + int j; + int pad = 7 - len; + for (j = len; j >= 0; j--) + str[j + pad] = str[j]; + for (j = 0; j < pad; j++) + str[j] = '0'; + len = 7; } - char *str = state->buffers.num.decimal; - op->frame->step = TZ_OPERATION_STEP_PRINT; - switch (op->frame->step_read_num.kind) { - case TZ_OPERATION_FIELD_INT: - case TZ_OPERATION_FIELD_NAT: - break; - case TZ_OPERATION_FIELD_FEE: - case TZ_OPERATION_FIELD_AMOUNT: { - int len = 0; - while (str[len]) - len++; - if (len == 1 && str[0] == 0) - // just 0 - goto add_currency; - if (len < 7) { - // less than one tez, pad left up to the '0.' - int j; - int pad = 7 - len; - for (j = len; j >= 0; j--) - str[j + pad] = str[j]; - for (j = 0; j < pad; j++) - str[j] = '0'; - len = 7; - } - int no_decimals = 1; + int no_decimals = 1; + for (int i = 0; i < 6; i++) + no_decimals &= (str[len - 1 - i] == '0'); + if (no_decimals) { + // integral value, don't include the decimal part (no '.'_ + str[len - 6] = 0; + len -= 6; + } else { + // more than one tez, add the '.' for (int i = 0; i < 6; i++) - no_decimals &= (str[len - 1 - i] == '0'); - if (no_decimals) { - // integral value, don't include the decimal part (no '.'_ - str[len - 6] = 0; - len -= 6; - } else { - // more than one tez, add the '.' - for (int i = 0; i < 6; i++) - str[len - i] = str[len - i - 1]; - str[len - 6] = '.'; - len++; + str[len - i] = str[len - i - 1]; + str[len - 6] = '.'; + len++; + str[len] = 0; + // drop trailing non significant zeroes + while (str[len - 1] == '0') { + len--; str[len] = 0; - // drop trailing non significant zeroes - while (str[len - 1] == '0') { - len--; - str[len] = 0; - } } - add_currency: - str[len] = ' '; - str[len + 1] = 'X'; - str[len + 2] = 'T'; - str[len + 3] = 'Z'; - len += 4; - str[len] = 0; - break; - } - default: - tz_raise(INVALID_STATE); } - op->frame->step_print.str = str; - } - break; - } - case TZ_OPERATION_STEP_READ_INT32: { - uint8_t b; - uint32_t *value = &op->frame->step_read_int32.value; - if (op->frame->step_read_int32.ofs < 4) { - tz_must(tz_parser_read(state, &b)); - *value = *value << 8 | b; - op->frame->step_read_int32.ofs++; - } else { - snprintf((char *)CAPTURE, sizeof(CAPTURE), "%d", *value); - op->frame->step_read_string.skip - = op->frame->step_read_int32.skip; - tz_must(tz_print_string(state)); + add_currency: + str[len] = ' '; + str[len + 1] = 'X'; + str[len + 2] = 'T'; + str[len + 3] = 'Z'; + len += 4; + str[len] = 0; + break; } - break; - } - case TZ_OPERATION_STEP_READ_BYTES: { - if (op->frame->step_read_bytes.ofs < op->frame->step_read_bytes.len) { - uint8_t *c; - c = &CAPTURE[op->frame->step_read_bytes.ofs]; - tz_must(tz_parser_read(state, c)); - op->frame->step_read_bytes.ofs++; - } else { - if (op->frame->step_read_num.skip) { - tz_must(pop_frame(state)); - tz_continue; - } - switch (op->frame->step_read_bytes.kind) { - case TZ_OPERATION_FIELD_SOURCE: - memcpy(op->source, CAPTURE, 22); - __attribute__((fallthrough)); - case TZ_OPERATION_FIELD_PKH: - if (tz_format_pkh(CAPTURE, 21, (char *)CAPTURE, - sizeof(CAPTURE))) - tz_raise(INVALID_TAG); - break; - case TZ_OPERATION_FIELD_PK: - if (tz_format_pk(CAPTURE, op->frame->step_read_bytes.len, - (char *)CAPTURE, sizeof(CAPTURE))) - tz_raise(INVALID_TAG); - break; - case TZ_OPERATION_FIELD_SR: - if (tz_format_base58check("sr1", CAPTURE, 20, (char *)CAPTURE, - sizeof(CAPTURE))) - tz_raise(INVALID_TAG); - break; - case TZ_OPERATION_FIELD_SRC: - if (tz_format_base58check("src1", CAPTURE, 32, - (char *)CAPTURE, sizeof(CAPTURE))) - tz_raise(INVALID_TAG); - break; - case TZ_OPERATION_FIELD_PROTO: - if (tz_format_base58check("proto", CAPTURE, 32, - (char *)CAPTURE, sizeof(CAPTURE))) - tz_raise(INVALID_TAG); - break; - case TZ_OPERATION_FIELD_DESTINATION: - memcpy(op->destination, CAPTURE, 22); - if (tz_format_address(CAPTURE, 22, (char *)CAPTURE, - sizeof(CAPTURE))) - tz_raise(INVALID_TAG); - break; - case TZ_OPERATION_FIELD_OPH: - if (tz_format_oph(CAPTURE, 32, (char *)CAPTURE, - sizeof(CAPTURE))) - tz_raise(INVALID_TAG); - break; - case TZ_OPERATION_FIELD_BH: - if (tz_format_bh(CAPTURE, 32, (char *)CAPTURE, - sizeof(CAPTURE))) - tz_raise(INVALID_TAG); - break; - default: - tz_raise(INVALID_STATE); - } - op->frame->step = TZ_OPERATION_STEP_PRINT; - op->frame->step_print.str = (char *)CAPTURE; + default: + tz_raise(INVALID_STATE); } - break; + op->frame->step_print.str = str; } - case TZ_OPERATION_STEP_BRANCH: { - op->frame->step = TZ_OPERATION_STEP_BATCH; - tz_must(push_frame(state, TZ_OPERATION_STEP_TAG)); - break; + tz_continue; +} + +/* Read an int32 */ +static tz_parser_result +tz_step_read_int32(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_INT32); + tz_operation_state *op = &state->operation; + uint8_t b; + uint32_t *value = &op->frame->step_read_int32.value; + if (op->frame->step_read_int32.ofs < 4) { + tz_must(tz_parser_read(state, &b)); + *value = *value << 8 | b; + op->frame->step_read_int32.ofs++; + } else { + snprintf((char *)CAPTURE, sizeof(CAPTURE), "%d", *value); + op->frame->step_read_string.skip = op->frame->step_read_int32.skip; + tz_must(tz_print_string(state)); } - case TZ_OPERATION_STEP_BATCH: { - op->batch_index++; - if (state->ofs == op->frame->stop) { + tz_continue; +} + +/* Read bytes */ +static tz_parser_result +tz_step_read_bytes(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_BYTES); + tz_operation_state *op = &state->operation; + if (op->frame->step_read_bytes.ofs < op->frame->step_read_bytes.len) { + uint8_t *c; + c = &CAPTURE[op->frame->step_read_bytes.ofs]; + tz_must(tz_parser_read(state, c)); + op->frame->step_read_bytes.ofs++; + } else { + if (op->frame->step_read_num.skip) { tz_must(pop_frame(state)); - } else if (state->ofs > op->frame->stop) { - tz_raise(TOO_LARGE); - } else { - tz_must(push_frame(state, TZ_OPERATION_STEP_TAG)); - } - break; - } - case TZ_OPERATION_STEP_READ_STRING: { - if (state->ofs == op->frame->stop) { - CAPTURE[op->frame->step_read_string.ofs] = 0; - tz_must(tz_print_string(state)); - } else { - uint8_t b; - tz_must(tz_parser_read(state, &b)); - CAPTURE[op->frame->step_read_string.ofs] = b; - op->frame->step_read_string.ofs++; - } - break; - } - case TZ_OPERATION_STEP_READ_BINARY: { - if (state->ofs == op->frame->stop) { - CAPTURE[op->frame->step_read_string.ofs] = 0; - tz_must(tz_print_string(state)); - } else if (op->frame->step_read_string.ofs + 2 - >= TZ_CAPTURE_BUFFER_SIZE) { - CAPTURE[op->frame->step_read_string.ofs] = 0; - op->frame->step_read_string.ofs = 0; - if (!op->frame->step_read_string.skip) { - tz_must(push_frame(state, TZ_OPERATION_STEP_PARTIAL_PRINT)); - op->frame->step_print.str = (char *)CAPTURE; - } - } else { - uint8_t b; - tz_must(tz_parser_read(state, &b)); - char *buf = (char *)CAPTURE + op->frame->step_read_string.ofs; - snprintf(buf, 4, "%02x", b); - op->frame->step_read_string.ofs += 2; + tz_continue; } - break; - } - case TZ_OPERATION_STEP_READ_SMART_ENTRYPOINT: { - uint8_t b; - tz_must(tz_parser_read(state, &b)); - switch (b) { - case 0: - strlcpy((char *)CAPTURE, "default", sizeof(CAPTURE)); - tz_must(tz_print_string(state)); + switch (op->frame->step_read_bytes.kind) { + case TZ_OPERATION_FIELD_SOURCE: + memcpy(op->source, CAPTURE, 22); + __attribute__((fallthrough)); + case TZ_OPERATION_FIELD_PKH: + if (tz_format_pkh(CAPTURE, 21, (char *)CAPTURE, sizeof(CAPTURE))) + tz_raise(INVALID_TAG); break; - case 1: - strlcpy((char *)CAPTURE, "root", sizeof(CAPTURE)); - tz_must(tz_print_string(state)); + case TZ_OPERATION_FIELD_PK: + if (tz_format_pk(CAPTURE, op->frame->step_read_bytes.len, + (char *)CAPTURE, sizeof(CAPTURE))) + tz_raise(INVALID_TAG); break; - case 2: - strlcpy((char *)CAPTURE, "do", sizeof(CAPTURE)); - tz_must(tz_print_string(state)); + case TZ_OPERATION_FIELD_SR: + if (tz_format_base58check("sr1", CAPTURE, 20, (char *)CAPTURE, + sizeof(CAPTURE))) + tz_raise(INVALID_TAG); break; - case 3: - strlcpy((char *)CAPTURE, "set_delegate", sizeof(CAPTURE)); - tz_must(tz_print_string(state)); + case TZ_OPERATION_FIELD_SRC: + if (tz_format_base58check("src1", CAPTURE, 32, (char *)CAPTURE, + sizeof(CAPTURE))) + tz_raise(INVALID_TAG); break; - case 4: - strlcpy((char *)CAPTURE, "remove_delegate", sizeof(CAPTURE)); - tz_must(tz_print_string(state)); + case TZ_OPERATION_FIELD_PROTO: + if (tz_format_base58check("proto", CAPTURE, 32, (char *)CAPTURE, + sizeof(CAPTURE))) + tz_raise(INVALID_TAG); break; - case 5: - strlcpy((char *)CAPTURE, "deposit", sizeof(CAPTURE)); - tz_must(tz_print_string(state)); + case TZ_OPERATION_FIELD_DESTINATION: + memcpy(op->destination, CAPTURE, 22); + if (tz_format_address(CAPTURE, 22, (char *)CAPTURE, + sizeof(CAPTURE))) + tz_raise(INVALID_TAG); break; - case 0xFF: - op->frame->step = TZ_OPERATION_STEP_READ_STRING; - op->frame->step_read_string.ofs = 0; - tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); - op->frame->step_size.size = 0; - op->frame->step_size.size_len = 1; + case TZ_OPERATION_FIELD_OPH: + if (tz_format_oph(CAPTURE, 32, (char *)CAPTURE, sizeof(CAPTURE))) + tz_raise(INVALID_TAG); + break; + case TZ_OPERATION_FIELD_BH: + if (tz_format_bh(CAPTURE, 32, (char *)CAPTURE, sizeof(CAPTURE))) + tz_raise(INVALID_TAG); break; default: - tz_raise(INVALID_TAG); + tz_raise(INVALID_STATE); } - break; + op->frame->step = TZ_OPERATION_STEP_PRINT; + op->frame->step_print.str = (char *)CAPTURE; } - case TZ_OPERATION_STEP_OPERATION: { - const tz_operation_descriptor *d - = op->frame->step_operation.descriptor; - const tz_operation_field_descriptor *field - = PIC(&d->fields[op->frame->step_operation.field]); - const char *name = PIC(field->name); + tz_continue; +} - // Remaining content from previous section - display this first. - if (regs->oofs > 0) - tz_stop(IM_FULL); +/* Update the state in order to read a batch of operations */ +static tz_parser_result +tz_step_branch(tz_parser_state *state) +{ + ASSERT_STEP(state, BRANCH); + tz_operation_state *op = &state->operation; + op->frame->step = TZ_OPERATION_STEP_BATCH; + tz_must(push_frame(state, TZ_OPERATION_STEP_TAG)); + tz_continue; +} - if (name == NULL) { - state->field_info.is_field_complex = false; - tz_must(pop_frame(state)); - } else { - uint8_t present = 1; - if (!field->required) - tz_must(tz_parser_read(state, &present)); - if (!field->skip) { - STRLCPY(state->field_info.field_name, name); - state->field_info.is_field_complex = field->complex; - state->field_info.field_index++; - } - op->frame->step_operation.field++; - if (!present) { - if (field->display_none) { - if (field->skip) - tz_raise(INVALID_STATE); - tz_must(push_frame(state, TZ_OPERATION_STEP_PRINT)); - op->frame->step_print.str = (char *)unset_message; - } - tz_continue; - } - switch (field->kind) { - case TZ_OPERATION_FIELD_BINARY: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_BINARY)); - op->frame->step_read_string.ofs = 0; - op->frame->step_read_string.skip = field->skip; - tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); - op->frame->step_size.size = 0; - op->frame->step_size.size_len = 4; - break; - } - case TZ_OPERATION_FIELD_SOURCE: - case TZ_OPERATION_FIELD_PKH: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_BYTES)); - op->frame->step_read_bytes.kind = field->kind; - op->frame->step_read_bytes.skip = field->skip; - op->frame->step_read_bytes.ofs = 0; - op->frame->step_read_bytes.len = 21; - break; - } - case TZ_OPERATION_FIELD_PK: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_PK)); - op->frame->step_read_bytes.skip = field->skip; - break; - } - case TZ_OPERATION_FIELD_SR: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_BYTES)); - op->frame->step_read_bytes.kind = field->kind; - op->frame->step_read_bytes.skip = field->skip; - op->frame->step_read_bytes.ofs = 0; - op->frame->step_read_bytes.len = 20; - break; - } - case TZ_OPERATION_FIELD_SRC: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_BYTES)); - op->frame->step_read_bytes.kind = field->kind; - op->frame->step_read_bytes.skip = field->skip; - op->frame->step_read_bytes.ofs = 0; - op->frame->step_read_bytes.len = 32; - break; - } - case TZ_OPERATION_FIELD_PROTO: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_BYTES)); - op->frame->step_read_bytes.kind = field->kind; - op->frame->step_read_bytes.skip = field->skip; - op->frame->step_read_bytes.ofs = 0; - op->frame->step_read_bytes.len = 32; - break; - } - case TZ_OPERATION_FIELD_PROTOS: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_PROTOS)); - op->frame->step_read_list.name = name; - op->frame->step_read_list.index = 0; - op->frame->step_read_list.skip = field->skip; - tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); - op->frame->step_size.size = 0; - op->frame->step_size.size_len = 4; - break; - } - case TZ_OPERATION_FIELD_DESTINATION: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_BYTES)); - op->frame->step_read_bytes.kind = field->kind; - op->frame->step_read_bytes.skip = field->skip; - op->frame->step_read_bytes.ofs = 0; - op->frame->step_read_bytes.len = 22; - break; - } - case TZ_OPERATION_FIELD_NAT: - case TZ_OPERATION_FIELD_FEE: - case TZ_OPERATION_FIELD_AMOUNT: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_NUM)); - tz_parse_num_state_init(&state->buffers.num, - &op->frame->step_read_num.state); - op->frame->step_read_num.kind = field->kind; - op->frame->step_read_num.skip = field->skip; - op->frame->step_read_num.natural = 1; - break; - } - case TZ_OPERATION_FIELD_INT: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_NUM)); - tz_parse_num_state_init(&state->buffers.num, - &op->frame->step_read_num.state); - op->frame->step_read_num.kind = field->kind; - op->frame->step_read_num.skip = field->skip; - op->frame->step_read_num.natural = 0; - break; - } - case TZ_OPERATION_FIELD_INT32: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_INT32)); - op->frame->step_read_int32.value = 0; - op->frame->step_read_int32.ofs = 0; - op->frame->step_read_int32.skip = field->skip; - break; - } - case TZ_OPERATION_FIELD_PARAMETER: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_MICHELINE)); - op->frame->step_read_micheline.inited = 0; - op->frame->step_read_micheline.skip = field->skip; - op->frame->step_read_micheline.name = name; - tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); - op->frame->step_size.size = 0; - op->frame->step_size.size_len = 4; - tz_must(push_frame(state, - TZ_OPERATION_STEP_READ_SMART_ENTRYPOINT)); - STRLCPY(state->field_info.field_name, "Entrypoint"); - op->frame->step_read_string.ofs = 0; - op->frame->step_read_string.skip = field->skip; - break; - } - case TZ_OPERATION_FIELD_EXPR: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_MICHELINE)); - op->frame->step_read_micheline.inited = 0; - op->frame->step_read_micheline.skip = field->skip; - op->frame->step_read_micheline.name = name; - tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); - op->frame->step_size.size = 0; - op->frame->step_size.size_len = 4; - break; - } - case TZ_OPERATION_FIELD_STRING: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_STRING)); - op->frame->step_read_string.ofs = 0; - op->frame->step_read_string.skip = field->skip; - tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); - op->frame->step_size.size = 0; - op->frame->step_size.size_len = 4; - break; - } - case TZ_OPERATION_FIELD_SORU_MESSAGES: { - tz_must( - push_frame(state, TZ_OPERATION_STEP_READ_SORU_MESSAGES)); - op->frame->step_read_list.name = name; - op->frame->step_read_list.index = 0; - op->frame->step_read_list.skip = field->skip; - tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); - op->frame->step_size.size = 0; - op->frame->step_size.size_len = 4; - break; - } - case TZ_OPERATION_FIELD_SORU_KIND: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_SORU_KIND)); - op->frame->step_read_string.skip = field->skip; - break; - } - case TZ_OPERATION_FIELD_BALLOT: { - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_BALLOT)); - op->frame->step_read_string.skip = field->skip; - break; - } - default: - tz_raise(INVALID_STATE); - } - } - break; +/* Update the state in order to read the next operation in a batch of + * operations + */ +static tz_parser_result +tz_step_batch(tz_parser_state *state) +{ + ASSERT_STEP(state, BATCH); + tz_operation_state *op = &state->operation; + op->batch_index++; + if (state->ofs == op->frame->stop) { + tz_must(pop_frame(state)); + } else if (state->ofs > op->frame->stop) { + tz_raise(TOO_LARGE); + } else { + tz_must(push_frame(state, TZ_OPERATION_STEP_TAG)); } - case TZ_OPERATION_STEP_READ_PK: { + tz_continue; +} + +/* Read a string */ +static tz_parser_result +tz_step_read_string(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_STRING); + tz_operation_state *op = &state->operation; + if (state->ofs == op->frame->stop) { + CAPTURE[op->frame->step_read_string.ofs] = 0; + tz_must(tz_print_string(state)); + } else { uint8_t b; - tz_must(tz_parser_peek(state, &b)); - op->frame->step_read_bytes.kind = TZ_OPERATION_FIELD_PK; - op->frame->step_read_bytes.ofs = 0; - switch (b) { - case 0: // edpk - op->frame->step_read_bytes.len = 33; - break; - case 1: // sppk - op->frame->step_read_bytes.len = 34; - break; - case 2: // p2pk - op->frame->step_read_bytes.len = 34; - break; - case 3: // BLpk - op->frame->step_read_bytes.len = 49; - break; - default: - tz_raise(INVALID_TAG); - } - op->frame->step = TZ_OPERATION_STEP_READ_BYTES; - break; + tz_must(tz_parser_read(state, &b)); + CAPTURE[op->frame->step_read_string.ofs] = b; + op->frame->step_read_string.ofs++; } - case TZ_OPERATION_STEP_READ_SORU_MESSAGES: { - uint8_t skip = op->frame->step_read_list.skip; - const char *name = op->frame->step_read_list.name; - uint16_t index = op->frame->step_read_list.index; - - // Remaining content from previous message - display this first. - if (regs->oofs > 0) - tz_stop(IM_FULL); + tz_continue; +} - if (op->frame->stop == state->ofs) { - tz_must(pop_frame(state)); - } else { - op->frame->step_read_list.index++; - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_BINARY)); - snprintf(state->field_info.field_name, TZ_FIELD_NAME_SIZE, - "%s (%d)", name, index); - op->frame->step_read_string.ofs = 0; - op->frame->step_read_string.skip = skip; - tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); - op->frame->step_size.size = 0; - op->frame->step_size.size_len = 4; +/* Read a binary */ +static tz_parser_result +tz_step_read_binary(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_BINARY); + tz_operation_state *op = &state->operation; + if (state->ofs == op->frame->stop) { + CAPTURE[op->frame->step_read_string.ofs] = 0; + tz_must(tz_print_string(state)); + } else if (op->frame->step_read_string.ofs + 2 + >= TZ_CAPTURE_BUFFER_SIZE) { + CAPTURE[op->frame->step_read_string.ofs] = 0; + op->frame->step_read_string.ofs = 0; + if (!op->frame->step_read_string.skip) { + tz_must(push_frame(state, TZ_OPERATION_STEP_PARTIAL_PRINT)); + op->frame->step_print.str = (char *)CAPTURE; } - break; - } - case TZ_OPERATION_STEP_READ_SORU_KIND: { + } else { uint8_t b; tz_must(tz_parser_read(state, &b)); - switch (b) { - case 0: - strlcpy((char *)CAPTURE, "arith", sizeof(CAPTURE)); - break; - case 1: - strlcpy((char *)CAPTURE, "wasm_2_0_0", sizeof(CAPTURE)); - break; - default: - tz_raise(INVALID_TAG); - } + char *buf = (char *)CAPTURE + op->frame->step_read_string.ofs; + snprintf(buf, 4, "%02x", b); + op->frame->step_read_string.ofs += 2; + } + tz_continue; +} + +/* Read an entrypoint */ +static tz_parser_result +tz_step_read_smart_entrypoint(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_SMART_ENTRYPOINT); + tz_operation_state *op = &state->operation; + uint8_t b; + tz_must(tz_parser_read(state, &b)); + switch (b) { + case 0: + strlcpy((char *)CAPTURE, "default", sizeof(CAPTURE)); tz_must(tz_print_string(state)); break; - } - case TZ_OPERATION_STEP_READ_BALLOT: { - uint8_t b; - tz_must(tz_parser_read(state, &b)); - switch (b) { - case 0: - strlcpy((char *)CAPTURE, "yay", sizeof(CAPTURE)); - break; - case 1: - strlcpy((char *)CAPTURE, "nay", sizeof(CAPTURE)); - break; - case 2: - strlcpy((char *)CAPTURE, "pass", sizeof(CAPTURE)); - break; - default: - tz_raise(INVALID_TAG); - } + case 1: + strlcpy((char *)CAPTURE, "root", sizeof(CAPTURE)); + tz_must(tz_print_string(state)); + break; + case 2: + strlcpy((char *)CAPTURE, "do", sizeof(CAPTURE)); tz_must(tz_print_string(state)); break; + case 3: + strlcpy((char *)CAPTURE, "set_delegate", sizeof(CAPTURE)); + tz_must(tz_print_string(state)); + break; + case 4: + strlcpy((char *)CAPTURE, "remove_delegate", sizeof(CAPTURE)); + tz_must(tz_print_string(state)); + break; + case 5: + strlcpy((char *)CAPTURE, "deposit", sizeof(CAPTURE)); + tz_must(tz_print_string(state)); + break; + case 0xFF: + op->frame->step = TZ_OPERATION_STEP_READ_STRING; + op->frame->step_read_string.ofs = 0; + tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); + op->frame->step_size.size = 0; + op->frame->step_size.size_len = 1; + break; + default: + tz_raise(INVALID_TAG); } - case TZ_OPERATION_STEP_READ_PROTOS: { - uint8_t skip = op->frame->step_read_list.skip; - const char *name = op->frame->step_read_list.name; - uint16_t index = op->frame->step_read_list.index; + tz_continue; +} - // Remaining content from previous proto - display this first. - if (regs->oofs > 0) - tz_stop(IM_FULL); +/* Update the state in order to read a field of an operation based on its kind + * If the field is not ignored, update the field_info with the field + * information + */ +static tz_parser_result +tz_step_field(tz_parser_state *state) +{ + ASSERT_STEP(state, FIELD); + tz_operation_state *op = &state->operation; + const tz_operation_field_descriptor *field = op->frame->step_field.field; + const char *name = PIC(field->name); - if (op->frame->stop == state->ofs) { - tz_must(pop_frame(state)); - } else { - op->frame->step_read_list.index++; - tz_must(push_frame(state, TZ_OPERATION_STEP_READ_BYTES)); - snprintf(state->field_info.field_name, 30, "%s (%d)", name, - index); - op->frame->step_read_bytes.kind = TZ_OPERATION_FIELD_PROTO; - op->frame->step_read_bytes.skip = skip; - op->frame->step_read_bytes.ofs = 0; - op->frame->step_read_bytes.len = 32; - } + // is_field_complex is reset after reaching TZ_OPERATION_FIELD_END + if (!field->skip) { + STRLCPY(state->field_info.field_name, name); + state->field_info.is_field_complex = field->complex; + state->field_info.field_index++; + } + + switch (field->kind) { + case TZ_OPERATION_FIELD_OPTION: { + op->frame->step = TZ_OPERATION_STEP_OPTION; + op->frame->step_option.field = PIC(field->field_option.field); + op->frame->step_option.display_none + = field->field_option.display_none; break; } - case TZ_OPERATION_STEP_PRINT: { - const char *str = PIC(op->frame->step_print.str); - if (*str) { - tz_must(tz_parser_put(state, *str)); - op->frame->step_print.str++; - } else { - tz_must(pop_frame(state)); - tz_stop(IM_FULL); - } + case TZ_OPERATION_FIELD_TUPLE: { + op->frame->step = TZ_OPERATION_STEP_TUPLE; + op->frame->step_tuple.fields = field->field_tuple.fields; + op->frame->step_tuple.field_index = 0; break; } - case TZ_OPERATION_STEP_PARTIAL_PRINT: { - const char *str = PIC(op->frame->step_print.str); - if (*str) { - tz_must(tz_parser_put(state, *str)); - op->frame->step_print.str++; - } else { - tz_must(pop_frame(state)); - } + case TZ_OPERATION_FIELD_BINARY: { + op->frame->step = TZ_OPERATION_STEP_READ_BINARY; + op->frame->step_read_string.ofs = 0; + op->frame->step_read_string.skip = field->skip; + tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); + op->frame->step_size.size = 0; + op->frame->step_size.size_len = 4; + break; + } + case TZ_OPERATION_FIELD_SOURCE: + case TZ_OPERATION_FIELD_PKH: { + op->frame->step = TZ_OPERATION_STEP_READ_BYTES; + op->frame->step_read_bytes.kind = field->kind; + op->frame->step_read_bytes.skip = field->skip; + op->frame->step_read_bytes.ofs = 0; + op->frame->step_read_bytes.len = 21; + break; + } + case TZ_OPERATION_FIELD_PK: { + op->frame->step = TZ_OPERATION_STEP_READ_PK; + op->frame->step_read_bytes.skip = field->skip; + break; + } + case TZ_OPERATION_FIELD_SR: { + op->frame->step = TZ_OPERATION_STEP_READ_BYTES; + op->frame->step_read_bytes.kind = field->kind; + op->frame->step_read_bytes.skip = field->skip; + op->frame->step_read_bytes.ofs = 0; + op->frame->step_read_bytes.len = 20; + break; + } + case TZ_OPERATION_FIELD_SRC: { + op->frame->step = TZ_OPERATION_STEP_READ_BYTES; + op->frame->step_read_bytes.kind = field->kind; + op->frame->step_read_bytes.skip = field->skip; + op->frame->step_read_bytes.ofs = 0; + op->frame->step_read_bytes.len = 32; + break; + } + case TZ_OPERATION_FIELD_PROTO: { + op->frame->step = TZ_OPERATION_STEP_READ_BYTES; + op->frame->step_read_bytes.kind = field->kind; + op->frame->step_read_bytes.skip = field->skip; + op->frame->step_read_bytes.ofs = 0; + op->frame->step_read_bytes.len = 32; + break; + } + case TZ_OPERATION_FIELD_PROTOS: { + op->frame->step = TZ_OPERATION_STEP_READ_PROTOS; + op->frame->step_read_list.name = name; + op->frame->step_read_list.index = 0; + op->frame->step_read_list.skip = field->skip; + tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); + op->frame->step_size.size = 0; + op->frame->step_size.size_len = 4; + break; + } + case TZ_OPERATION_FIELD_DESTINATION: { + op->frame->step = TZ_OPERATION_STEP_READ_BYTES; + op->frame->step_read_bytes.kind = field->kind; + op->frame->step_read_bytes.skip = field->skip; + op->frame->step_read_bytes.ofs = 0; + op->frame->step_read_bytes.len = 22; + break; + } + case TZ_OPERATION_FIELD_NAT: + case TZ_OPERATION_FIELD_FEE: + case TZ_OPERATION_FIELD_AMOUNT: { + op->frame->step = TZ_OPERATION_STEP_READ_NUM; + tz_parse_num_state_init(&state->buffers.num, + &op->frame->step_read_num.state); + op->frame->step_read_num.kind = field->kind; + op->frame->step_read_num.skip = field->skip; + op->frame->step_read_num.natural = 1; + break; + } + case TZ_OPERATION_FIELD_INT: { + op->frame->step = TZ_OPERATION_STEP_READ_NUM; + tz_parse_num_state_init(&state->buffers.num, + &op->frame->step_read_num.state); + op->frame->step_read_num.kind = field->kind; + op->frame->step_read_num.skip = field->skip; + op->frame->step_read_num.natural = 0; + break; + } + case TZ_OPERATION_FIELD_INT32: { + op->frame->step = TZ_OPERATION_STEP_READ_INT32; + op->frame->step_read_int32.value = 0; + op->frame->step_read_int32.ofs = 0; + op->frame->step_read_int32.skip = field->skip; + break; + } + case TZ_OPERATION_FIELD_SMART_ENTRYPOINT: { + op->frame->step = TZ_OPERATION_STEP_READ_SMART_ENTRYPOINT; + op->frame->step_read_string.ofs = 0; + op->frame->step_read_string.skip = field->skip; + break; + } + case TZ_OPERATION_FIELD_EXPR: { + op->frame->step = TZ_OPERATION_STEP_READ_MICHELINE; + op->frame->step_read_micheline.inited = 0; + op->frame->step_read_micheline.skip = field->skip; + op->frame->step_read_micheline.name = name; + tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); + op->frame->step_size.size = 0; + op->frame->step_size.size_len = 4; + break; + } + case TZ_OPERATION_FIELD_STRING: { + op->frame->step = TZ_OPERATION_STEP_READ_STRING; + op->frame->step_read_string.ofs = 0; + op->frame->step_read_string.skip = field->skip; + tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); + op->frame->step_size.size = 0; + op->frame->step_size.size_len = 4; + break; + } + case TZ_OPERATION_FIELD_SORU_MESSAGES: { + op->frame->step = TZ_OPERATION_STEP_READ_SORU_MESSAGES; + op->frame->step_read_list.name = name; + op->frame->step_read_list.index = 0; + op->frame->step_read_list.skip = field->skip; + tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); + op->frame->step_size.size = 0; + op->frame->step_size.size_len = 4; + break; + } + case TZ_OPERATION_FIELD_SORU_KIND: { + op->frame->step = TZ_OPERATION_STEP_READ_SORU_KIND; + op->frame->step_read_string.skip = field->skip; break; } + case TZ_OPERATION_FIELD_BALLOT: { + op->frame->step = TZ_OPERATION_STEP_READ_BALLOT; + op->frame->step_read_string.skip = field->skip; + break; + } + default: + tz_raise(INVALID_STATE); + } + tz_continue; +} + +/* Read a public key */ +static tz_parser_result +tz_step_read_pk(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_PK); + tz_operation_state *op = &state->operation; + uint8_t b; + tz_must(tz_parser_peek(state, &b)); + op->frame->step_read_bytes.kind = TZ_OPERATION_FIELD_PK; + op->frame->step_read_bytes.ofs = 0; + switch (b) { + case 0: // edpk + op->frame->step_read_bytes.len = 33; + break; + case 1: // sppk + op->frame->step_read_bytes.len = 34; + break; + case 2: // p2pk + op->frame->step_read_bytes.len = 34; + break; + case 3: // BLpk + op->frame->step_read_bytes.len = 49; + break; + default: + tz_raise(INVALID_TAG); + } + op->frame->step = TZ_OPERATION_STEP_READ_BYTES; + tz_continue; +} + +/* Read soru messages */ +static tz_parser_result +tz_step_read_soru_messages(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_SORU_MESSAGES); + tz_operation_state *op = &state->operation; + tz_parser_regs *regs = &state->regs; + uint8_t skip = op->frame->step_read_list.skip; + const char *name = op->frame->step_read_list.name; + uint16_t index = op->frame->step_read_list.index; + + // Remaining content from previous message - display this first. + if (regs->oofs > 0) + tz_stop(IM_FULL); + + if (op->frame->stop == state->ofs) { + tz_must(pop_frame(state)); + } else { + op->frame->step_read_list.index++; + tz_must(push_frame(state, TZ_OPERATION_STEP_READ_BINARY)); + snprintf(state->field_info.field_name, TZ_FIELD_NAME_SIZE, "%s (%d)", + name, index); + op->frame->step_read_string.ofs = 0; + op->frame->step_read_string.skip = skip; + tz_must(push_frame(state, TZ_OPERATION_STEP_SIZE)); + op->frame->step_size.size = 0; + op->frame->step_size.size_len = 4; + } + tz_continue; +} + +/* Read a soru kind */ +static tz_parser_result +tz_step_read_soru_kind(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_SORU_KIND); + uint8_t b; + tz_must(tz_parser_read(state, &b)); + switch (b) { + case 0: + strlcpy((char *)CAPTURE, "arith", sizeof(CAPTURE)); + break; + case 1: + strlcpy((char *)CAPTURE, "wasm_2_0_0", sizeof(CAPTURE)); + break; + default: + tz_raise(INVALID_TAG); + } + tz_must(tz_print_string(state)); + tz_continue; +} + +/* Read a ballot */ +static tz_parser_result +tz_step_read_ballot(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_BALLOT); + uint8_t b; + tz_must(tz_parser_read(state, &b)); + switch (b) { + case 0: + strlcpy((char *)CAPTURE, "yay", sizeof(CAPTURE)); + break; + case 1: + strlcpy((char *)CAPTURE, "nay", sizeof(CAPTURE)); + break; + case 2: + strlcpy((char *)CAPTURE, "pass", sizeof(CAPTURE)); + break; + default: + tz_raise(INVALID_TAG); + } + tz_must(tz_print_string(state)); + tz_continue; +} + +/* Read protocols */ +static tz_parser_result +tz_step_read_protos(tz_parser_state *state) +{ + ASSERT_STEP(state, READ_PROTOS); + tz_operation_state *op = &state->operation; + tz_parser_regs *regs = &state->regs; + uint8_t skip = op->frame->step_read_list.skip; + const char *name = op->frame->step_read_list.name; + uint16_t index = op->frame->step_read_list.index; + + // Remaining content from previous proto - display this first. + if (regs->oofs > 0) + tz_stop(IM_FULL); + + if (op->frame->stop == state->ofs) { + tz_must(pop_frame(state)); + } else { + op->frame->step_read_list.index++; + tz_must(push_frame(state, TZ_OPERATION_STEP_READ_BYTES)); + snprintf(state->field_info.field_name, 30, "%s (%d)", name, index); + op->frame->step_read_bytes.kind = TZ_OPERATION_FIELD_PROTO; + op->frame->step_read_bytes.skip = skip; + op->frame->step_read_bytes.ofs = 0; + op->frame->step_read_bytes.len = 32; + } + tz_continue; +} + +/* Print a string + * if partial is true, then the string is not yet complete + */ +static tz_parser_result +tz_step_print(tz_parser_state *state, bool partial) +{ + if (state->operation.frame->step != TZ_OPERATION_STEP_PRINT + && state->operation.frame->step != TZ_OPERATION_STEP_PARTIAL_PRINT) { + PRINTF("[DEBUG] expected step %s or step %s but got step %s)\n", + STRING_STEP(TZ_OPERATION_STEP_PRINT), + STRING_STEP(TZ_OPERATION_STEP_PARTIAL_PRINT), + STRING_STEP(state->operation.frame->step)); + tz_raise(INVALID_STATE); + } + tz_operation_state *op = &state->operation; + const char *str = PIC(op->frame->step_print.str); + if (*str) { + tz_must(tz_parser_put(state, *str)); + op->frame->step_print.str++; + } else { + tz_must(pop_frame(state)); + if (!partial) + tz_stop(IM_FULL); + } + tz_continue; +} + +tz_parser_result +tz_operation_parser_step(tz_parser_state *state) +{ + tz_operation_state *op = &state->operation; + + // cannot restart after error + if (TZ_IS_ERR(state->errno)) + tz_reraise; + + // nothing else to do + if (op->frame == NULL) + tz_stop(DONE); + + PRINTF( + "[DEBUG] operation(frame: %d, offset:%d/%d, ilen: %d, olen: %d, " + "step: %s, errno: %s)\n", + (int)(op->frame - op->stack), (int)state->ofs, (int)op->stack[0].stop, + (int)state->regs.ilen, (int)state->regs.oofs, + STRING_STEP(op->frame->step), tz_parser_result_name(state->errno)); + + switch (op->frame->step) { + case TZ_OPERATION_STEP_OPTION: + tz_must(tz_step_option(state)); + break; + case TZ_OPERATION_STEP_TUPLE: + tz_must(tz_step_tuple(state)); + break; + case TZ_OPERATION_STEP_MAGIC: + tz_must(tz_step_magic(state)); + break; + case TZ_OPERATION_STEP_SIZE: + tz_must(tz_step_size(state)); + break; + case TZ_OPERATION_STEP_TAG: + tz_must(tz_step_tag(state)); + break; + case TZ_OPERATION_STEP_READ_MICHELINE: + tz_must(tz_step_read_micheline(state)); + break; + case TZ_OPERATION_STEP_READ_NUM: + tz_must(tz_step_read_num(state)); + break; + case TZ_OPERATION_STEP_READ_INT32: + tz_must(tz_step_read_int32(state)); + break; + case TZ_OPERATION_STEP_READ_BYTES: + tz_must(tz_step_read_bytes(state)); + break; + case TZ_OPERATION_STEP_BRANCH: + tz_must(tz_step_branch(state)); + break; + case TZ_OPERATION_STEP_BATCH: + tz_must(tz_step_batch(state)); + break; + case TZ_OPERATION_STEP_READ_STRING: + tz_must(tz_step_read_string(state)); + break; + case TZ_OPERATION_STEP_READ_BINARY: + tz_must(tz_step_read_binary(state)); + break; + case TZ_OPERATION_STEP_READ_SMART_ENTRYPOINT: + tz_must(tz_step_read_smart_entrypoint(state)); + break; + case TZ_OPERATION_STEP_FIELD: + tz_must(tz_step_field(state)); + break; + case TZ_OPERATION_STEP_READ_PK: + tz_must(tz_step_read_pk(state)); + break; + case TZ_OPERATION_STEP_READ_SORU_MESSAGES: + tz_must(tz_step_read_soru_messages(state)); + break; + case TZ_OPERATION_STEP_READ_SORU_KIND: + tz_must(tz_step_read_soru_kind(state)); + break; + case TZ_OPERATION_STEP_READ_BALLOT: + tz_must(tz_step_read_ballot(state)); + break; + case TZ_OPERATION_STEP_READ_PROTOS: + tz_must(tz_step_read_protos(state)); + break; + case TZ_OPERATION_STEP_PRINT: + case TZ_OPERATION_STEP_PARTIAL_PRINT: + tz_must(tz_step_print( + state, op->frame->step == TZ_OPERATION_STEP_PARTIAL_PRINT)); + break; default: tz_raise(INVALID_STATE); } diff --git a/app/src/parser/operation_state.h b/app/src/parser/operation_state.h index 3848236af..a9ec5efa8 100644 --- a/app/src/parser/operation_state.h +++ b/app/src/parser/operation_state.h @@ -39,13 +39,15 @@ typedef enum { } tz_operation_tag; typedef enum { + TZ_OPERATION_STEP_OPTION, + TZ_OPERATION_STEP_TUPLE, TZ_OPERATION_STEP_MAGIC, TZ_OPERATION_STEP_READ_BINARY, TZ_OPERATION_STEP_BRANCH, TZ_OPERATION_STEP_BATCH, TZ_OPERATION_STEP_TAG, TZ_OPERATION_STEP_SIZE, - TZ_OPERATION_STEP_OPERATION, + TZ_OPERATION_STEP_FIELD, TZ_OPERATION_STEP_PRINT, TZ_OPERATION_STEP_PARTIAL_PRINT, TZ_OPERATION_STEP_READ_NUM, @@ -62,7 +64,9 @@ typedef enum { } tz_operation_parser_step_kind; typedef enum { - TZ_OPERATION_FIELD_SKIP, // not for use in field descriptors + TZ_OPERATION_FIELD_END = 0, // not for use in field descriptors + TZ_OPERATION_FIELD_OPTION, + TZ_OPERATION_FIELD_TUPLE, TZ_OPERATION_FIELD_BINARY, TZ_OPERATION_FIELD_INT, TZ_OPERATION_FIELD_NAT, @@ -78,7 +82,7 @@ typedef enum { TZ_OPERATION_FIELD_PROTO, TZ_OPERATION_FIELD_PROTOS, TZ_OPERATION_FIELD_DESTINATION, - TZ_OPERATION_FIELD_PARAMETER, + TZ_OPERATION_FIELD_SMART_ENTRYPOINT, TZ_OPERATION_FIELD_EXPR, TZ_OPERATION_FIELD_OPH, TZ_OPERATION_FIELD_BH, @@ -87,10 +91,23 @@ typedef enum { TZ_OPERATION_FIELD_BALLOT } tz_operation_field_kind; +struct tz_operation_field_descriptor; + typedef struct { + const struct tz_operation_field_descriptor *field; + uint8_t display_none : 1; +} tz_operation_option_field_descriptor; + +typedef struct tz_operation_field_descriptor { const char *name; tz_operation_field_kind kind : 5; - uint8_t required : 1, skip : 1, display_none : 1, complex : 1; + union { + tz_operation_option_field_descriptor field_option; + struct { + const struct tz_operation_field_descriptor *fields; + } field_tuple; + }; + uint8_t skip : 1, complex : 1; } tz_operation_field_descriptor; typedef struct { @@ -103,14 +120,18 @@ typedef struct { tz_operation_parser_step_kind step : 5; uint16_t stop; union { + tz_operation_option_field_descriptor step_option; struct { uint8_t size_len; uint16_t size; } step_size; struct { - const tz_operation_descriptor *descriptor; - uint8_t field; - } step_operation; + const tz_operation_field_descriptor *field; + } step_field; + struct { + const tz_operation_field_descriptor *fields; + uint8_t field_index; + } step_tuple; struct { const char *str; } step_print; @@ -157,6 +178,7 @@ typedef struct { uint16_t batch_index; // to print a sequence number #ifdef HAVE_SWAP tz_operation_tag last_tag; + uint16_t nb_reveal; uint64_t last_fee; uint64_t last_amount; #endif // HAVE_SWAP diff --git a/app/src/ui_stream.h b/app/src/ui_stream.h index 7101dfcf4..a599e5d40 100644 --- a/app/src/ui_stream.h +++ b/app/src/ui_stream.h @@ -177,3 +177,6 @@ void tz_ui_stream_close(void); void tz_ui_stream(void); void tz_ui_stream_start(void); tz_ui_cb_type_t tz_ui_stream_get_cb_type(void); +#ifdef HAVE_NBGL +void tz_reject_ui(void); +#endif diff --git a/app/src/ui_stream_nbgl.c b/app/src/ui_stream_nbgl.c index ff3784439..57b49dd1f 100644 --- a/app/src/ui_stream_nbgl.c +++ b/app/src/ui_stream_nbgl.c @@ -30,6 +30,7 @@ void tz_ui_stream_start(void); void drop_last_screen(void); void push_str(const char *, size_t, char **); +void switch_to_blindsigning(const char *, const char *); void tz_cancel_ui(void) @@ -54,7 +55,11 @@ tz_reject(void) global.keys.apdu.sign.step = SIGN_ST_WAIT_USER_INPUT; global.keys.apdu.sign.received_last_msg = true; - s->cb(TZ_UI_STREAM_CB_REJECT); + if (global.step == ST_BLIND_SIGN) { + s->cb(TZ_UI_STREAM_CB_BLINDSIGN_REJECT); + } else { + s->cb(TZ_UI_STREAM_CB_REJECT); + } global.step = ST_IDLE; nbgl_useCaseStatus("Transaction rejected", false, ui_home_init); @@ -73,6 +78,70 @@ tz_reject_ui(void) FUNC_LEAVE(); } +static void +start_blindsign(void) +{ + FUNC_ENTER(("void")); + + tz_ui_stream_t *s = &global.stream; + s->cb(TZ_UI_STREAM_CB_BLINDSIGN); + + FUNC_LEAVE(); +} + +static void +blindsign_splash(void) +{ + TZ_PREAMBLE(("void")); + nbgl_useCaseReviewStart( + &C_round_warning_64px, "Blind signing", + "This transaction can not be securely interpreted by Ledger Stax. It " + "might put your assets at risk.", + "Reject transaction", start_blindsign, tz_reject_ui); + + TZ_POSTAMBLE; +} + +static void +handle_blindsigning(bool confirm) +{ + TZ_PREAMBLE(("void")); + if (confirm) { + if (!N_settings.blindsigning) + toggle_blindsigning(); + nbgl_useCaseReviewStart(&C_round_check_64px, "Blind signing enabled", + NULL, "Reject transaction", blindsign_splash, + tz_reject_ui); + + } else { + tz_reject_ui(); + } + TZ_POSTAMBLE; +} + +void +switch_to_blindsigning(__attribute__((unused)) const char *err_type, + const char *err_code) +{ + TZ_PREAMBLE(("void")); + PRINTF("[DEBUG] refill_error: global.step = %d\n", global.step); + 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; + if (N_settings.blindsigning) { + nbgl_useCaseReviewStart( + &C_round_warning_64px, "Blind signing required:\nParsing Error", + err_code, "Reject transaction", blindsign_splash, tz_reject_ui); + } else { + nbgl_useCaseChoice(&C_round_warning_64px, + "Enable blind signing to authorize this " + "transaction:\nParsing Error", + err_code, "Enable blind signing", + "Reject transaction", handle_blindsigning); + } + + TZ_POSTAMBLE; +} void expert_mode_splash(void) { @@ -217,7 +286,6 @@ tz_ui_stream_init(void (*cb)(uint8_t)) nbgl_useCaseReviewStart(&C_tezos, "Review request to sign operation", NULL, "Reject request", tz_ui_review_start, tz_reject_ui); - FUNC_LEAVE(); } diff --git a/scripts/test_swap.sh b/scripts/test_swap.sh index 18face654..284f9094f 100755 --- a/scripts/test_swap.sh +++ b/scripts/test_swap.sh @@ -105,7 +105,7 @@ _build_app() { cd $repo docker run --rm -ti -v "$(realpath .):/app" --privileged \ - ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:3.11.0 \ + ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:3.12.0 \ bash -c "make clean && make -j $params BOLOS_SDK=\$$sdk" ) } @@ -139,7 +139,7 @@ build_app_ethereum() { build_app_tezos() { _assert_tezos_repo - _build_side_app $1 "tezos_new" $APP_TEZOS_REPO/app + _build_side_app $1 "tezos" $APP_TEZOS_REPO/app } run_tests() { @@ -153,7 +153,7 @@ run_tests() { ledger-app-tezos-integration-tests -c \ "cd /app && \ pip install -r test/python/requirements.txt && \ - pytest test/python $*" + pip install protobuf==3.20.3 && pytest test/python $*" ) } @@ -163,7 +163,7 @@ run_tests_all() { device=$1 shift - run_tests --device $device -k "tezos_new" $* + run_tests --device $device -k "tezos" $* } update() { diff --git a/tests/generate/gen_integration.ml b/tests/generate/gen_integration.ml index 129ac7cd1..cf0113820 100644 --- a/tests/generate/gen_integration.ml +++ b/tests/generate/gen_integration.ml @@ -279,8 +279,8 @@ let operation_to_screens then [] else [ - need_expert_mode_screen "Parameter"; make_screen ~title:"Entrypoint" "%a" Entrypoint.pp entrypoint; + need_expert_mode_screen "Parameter"; make_screen ~title:"Parameter" "%a" pp_lazy_expr parameters; ] in diff --git a/tests/integration/nano/snapshots/nanos/regression_batched_ops/00009.png b/tests/integration/nano/snapshots/nanos/regression_batched_ops/00009.png index 92b4bce4e..29807b584 100644 Binary files a/tests/integration/nano/snapshots/nanos/regression_batched_ops/00009.png and b/tests/integration/nano/snapshots/nanos/regression_batched_ops/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/regression_batched_ops/00010.png b/tests/integration/nano/snapshots/nanos/regression_batched_ops/00010.png index 29807b584..92b4bce4e 100644 Binary files a/tests/integration/nano/snapshots/nanos/regression_batched_ops/00010.png and b/tests/integration/nano/snapshots/nanos/regression_batched_ops/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_ensure_always_clearsign/00009.png b/tests/integration/nano/snapshots/nanos/test_ensure_always_clearsign/00009.png index 92b4bce4e..d58a3edc0 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_ensure_always_clearsign/00009.png and b/tests/integration/nano/snapshots/nanos/test_ensure_always_clearsign/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_ensure_always_clearsign/00010.png b/tests/integration/nano/snapshots/nanos/test_ensure_always_clearsign/00010.png index d58a3edc0..92b4bce4e 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_ensure_always_clearsign/00010.png and b/tests/integration/nano/snapshots/nanos/test_ensure_always_clearsign/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_added_at_the_end/00009.png b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_added_at_the_end/00009.png index 92b4bce4e..c40c89919 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_added_at_the_end/00009.png and b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_added_at_the_end/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_added_at_the_end/00010.png b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_added_at_the_end/00010.png index c40c89919..92b4bce4e 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_added_at_the_end/00010.png and b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_added_at_the_end/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00009.png b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00009.png index 92b4bce4e..218dc0511 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00009.png and b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00010.png b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00010.png index 218dc0511..9fefcab8d 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00010.png and b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00011.png b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00011.png index 9fefcab8d..180bf33b7 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00011.png and b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00011.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00012.png b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00012.png index 180bf33b7..fda55f501 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00012.png and b/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00012.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_regression_continue_after_reject/reject_signing/00009.png b/tests/integration/nano/snapshots/nanos/test_regression_continue_after_reject/reject_signing/00009.png index 92b4bce4e..d58a3edc0 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_regression_continue_after_reject/reject_signing/00009.png and b/tests/integration/nano/snapshots/nanos/test_regression_continue_after_reject/reject_signing/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_regression_continue_after_reject/reject_signing/00010.png b/tests/integration/nano/snapshots/nanos/test_regression_continue_after_reject/reject_signing/00010.png index d58a3edc0..92b4bce4e 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_regression_continue_after_reject/reject_signing/00010.png and b/tests/integration/nano/snapshots/nanos/test_regression_continue_after_reject/reject_signing/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_reject_transaction/00009.png b/tests/integration/nano/snapshots/nanos/test_reject_transaction/00009.png index 92b4bce4e..d58a3edc0 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_reject_transaction/00009.png and b/tests/integration/nano/snapshots/nanos/test_reject_transaction/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_reject_transaction/00010.png b/tests/integration/nano/snapshots/nanos/test_reject_transaction/00010.png index d58a3edc0..92b4bce4e 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_reject_transaction/00010.png and b/tests/integration/nano/snapshots/nanos/test_reject_transaction/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign_transaction/00009.png b/tests/integration/nano/snapshots/nanos/test_sign_transaction/00009.png index 92b4bce4e..c40c89919 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_sign_transaction/00009.png and b/tests/integration/nano/snapshots/nanos/test_sign_transaction/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign_transaction/00010.png b/tests/integration/nano/snapshots/nanos/test_sign_transaction/00010.png index c40c89919..92b4bce4e 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_sign_transaction/00010.png and b/tests/integration/nano/snapshots/nanos/test_sign_transaction/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign_with_another_seed/00009.png b/tests/integration/nano/snapshots/nanos/test_sign_with_another_seed/00009.png index 92b4bce4e..c40c89919 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_sign_with_another_seed/00009.png and b/tests/integration/nano/snapshots/nanos/test_sign_with_another_seed/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign_with_another_seed/00010.png b/tests/integration/nano/snapshots/nanos/test_sign_with_another_seed/00010.png index c40c89919..92b4bce4e 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_sign_with_another_seed/00010.png and b/tests/integration/nano/snapshots/nanos/test_sign_with_another_seed/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign_with_long_hash/00010.png b/tests/integration/nano/snapshots/nanos/test_sign_with_long_hash/00010.png index 92b4bce4e..d58a3edc0 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_sign_with_long_hash/00010.png and b/tests/integration/nano/snapshots/nanos/test_sign_with_long_hash/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign_with_long_hash/00011.png b/tests/integration/nano/snapshots/nanos/test_sign_with_long_hash/00011.png index d58a3edc0..92b4bce4e 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_sign_with_long_hash/00011.png and b/tests/integration/nano/snapshots/nanos/test_sign_with_long_hash/00011.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign_with_small_packet/00009.png b/tests/integration/nano/snapshots/nanos/test_sign_with_small_packet/00009.png index 92b4bce4e..c40c89919 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_sign_with_small_packet/00009.png and b/tests/integration/nano/snapshots/nanos/test_sign_with_small_packet/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_sign_with_small_packet/00010.png b/tests/integration/nano/snapshots/nanos/test_sign_with_small_packet/00010.png index c40c89919..92b4bce4e 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_sign_with_small_packet/00010.png and b/tests/integration/nano/snapshots/nanos/test_sign_with_small_packet/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_too_complex_transaction/00009.png b/tests/integration/nano/snapshots/nanos/test_too_complex_transaction/00009.png index 732db8bec..c40c89919 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_too_complex_transaction/00009.png and b/tests/integration/nano/snapshots/nanos/test_too_complex_transaction/00009.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_too_complex_transaction/00010.png b/tests/integration/nano/snapshots/nanos/test_too_complex_transaction/00010.png index fda55f501..f76bfbc52 100644 Binary files a/tests/integration/nano/snapshots/nanos/test_too_complex_transaction/00010.png and b/tests/integration/nano/snapshots/nanos/test_too_complex_transaction/00010.png differ diff --git a/tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00013.png b/tests/integration/nano/snapshots/nanos/test_too_complex_transaction/00011.png similarity index 100% rename from tests/integration/nano/snapshots/nanos/test_parsing_errors/one_byte_removed_inside/00013.png rename to tests/integration/nano/snapshots/nanos/test_too_complex_transaction/00011.png diff --git a/tests/integration/nano/snapshots/nanosp/home.png b/tests/integration/nano/snapshots/nanosp/home.png index 74ca77cf2..39ed6ff59 100644 Binary files a/tests/integration/nano/snapshots/nanosp/home.png and b/tests/integration/nano/snapshots/nanosp/home.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00002.png b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00002.png and b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00003.png b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00003.png and b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00004.png b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00004.png and b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00005.png b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00005.png index 1fcdee14d..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00005.png and b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00007.png b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00007.png index 1fcdee14d..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00007.png and b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00009.png b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00009.png index e2e0638c6..f25662e2c 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00009.png and b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00009.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00011.png b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00011.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00011.png and b/tests/integration/nano/snapshots/nanosp/regression_potential_empty_screen/00011.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00001.png b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00001.png index ab0263ea8..0b15945b1 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00001.png and b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00002.png b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00002.png index c851fe73c..903a71c22 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00002.png and b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00003.png b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00003.png index df5a094dd..80bbe91ce 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00003.png and b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00004.png b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00004.png index 599dedb96..83b3b6cb6 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00004.png and b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00005.png b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00005.png index 76caf0154..84d06ce5f 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00005.png and b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00006.png b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00006.png index 044d35313..8751b5981 100644 Binary files a/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00006.png and b/tests/integration/nano/snapshots/nanosp/regression_press_right_works_across_apdu_recieves/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/settings.png b/tests/integration/nano/snapshots/nanosp/settings.png index 0cc74d99e..99d3e4228 100644 Binary files a/tests/integration/nano/snapshots/nanosp/settings.png and b/tests/integration/nano/snapshots/nanosp/settings.png differ diff --git a/tests/integration/nano/snapshots/nanosp/settings_blind_signing_disabled.png b/tests/integration/nano/snapshots/nanosp/settings_blind_signing_disabled.png index 5048db38f..fa91d0fef 100644 Binary files a/tests/integration/nano/snapshots/nanosp/settings_blind_signing_disabled.png and b/tests/integration/nano/snapshots/nanosp/settings_blind_signing_disabled.png differ diff --git a/tests/integration/nano/snapshots/nanosp/settings_blind_signing_enabled.png b/tests/integration/nano/snapshots/nanosp/settings_blind_signing_enabled.png index caef799ff..7d86be34a 100644 Binary files a/tests/integration/nano/snapshots/nanosp/settings_blind_signing_enabled.png and b/tests/integration/nano/snapshots/nanosp/settings_blind_signing_enabled.png differ diff --git a/tests/integration/nano/snapshots/nanosp/settings_expert_mode_disabled.png b/tests/integration/nano/snapshots/nanosp/settings_expert_mode_disabled.png index 08c4cafb3..f19ea84c9 100644 Binary files a/tests/integration/nano/snapshots/nanosp/settings_expert_mode_disabled.png and b/tests/integration/nano/snapshots/nanosp/settings_expert_mode_disabled.png differ diff --git a/tests/integration/nano/snapshots/nanosp/settings_expert_mode_enabled.png b/tests/integration/nano/snapshots/nanosp/settings_expert_mode_enabled.png index 56ac955ad..90dc4e8dc 100644 Binary files a/tests/integration/nano/snapshots/nanosp/settings_expert_mode_enabled.png and b/tests/integration/nano/snapshots/nanosp/settings_expert_mode_enabled.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00000.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00000.png index 19a17f45f..f2f7e61ba 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00000.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00000.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00001.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00001.png index 833cbdc54..d75768e73 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00001.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00003.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00003.png index 604176763..137ca9e49 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00003.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/blind/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/clear/00001.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/clear/00001.png index 35abc6eef..184e20ac9 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/clear/00001.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/clear/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/clear/00002.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/clear/00002.png index 250fb0413..8fbaf47a7 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/clear/00002.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_blind/clear/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00001.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00001.png index 35abc6eef..184e20ac9 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00001.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00002.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00002.png index 250fb0413..8fbaf47a7 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00002.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00003.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00003.png index 604176763..137ca9e49 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00003.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_reject/reject_from_clear/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/blind/00000.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/blind/00000.png index 19a17f45f..f2f7e61ba 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/blind/00000.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/blind/00000.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/blind/00001.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/blind/00001.png index 53ff3ba83..03f8a150d 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/blind/00001.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/blind/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/clear/00001.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/clear/00001.png index 4a29c4511..c7d4300fc 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/clear/00001.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/clear/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/clear/00002.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/clear/00002.png index 250fb0413..8fbaf47a7 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/clear/00002.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_deep/clear/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/blind/00000.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/blind/00000.png index 19a17f45f..f2f7e61ba 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/blind/00000.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/blind/00000.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/blind/00001.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/blind/00001.png index 833cbdc54..d75768e73 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/blind/00001.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/blind/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/clear/00001.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/clear/00001.png index 35abc6eef..184e20ac9 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/clear/00001.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/clear/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/clear/00002.png b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/clear/00002.png index 250fb0413..8fbaf47a7 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/clear/00002.png and b/tests/integration/nano/snapshots/nanosp/test_blindsign_too_large/clear/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00002.png b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00002.png and b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00003.png b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00003.png and b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00004.png b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00004.png and b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00005.png b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00005.png index c4768d4fa..ca0128108 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00005.png and b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00006.png b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00006.png and b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00007.png b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00007.png index 1fcdee14d..85234247e 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00007.png and b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00008.png b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00008.png index 85234247e..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00008.png and b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00011.png b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00011.png index eb0513902..d5afcef1b 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00011.png and b/tests/integration/nano/snapshots/nanosp/test_ensure_always_clearsign/00011.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00002.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00002.png index 32580b8ff..d6deabe98 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00002.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00003.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00003.png index 603203fdd..e7bfe032f 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00003.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00004.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00004.png index daadf3b24..04889b556 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00004.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00005.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00005.png index 5b226371a..c5894b08c 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00005.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00006.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00006.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00007.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00007.png index 1fcdee14d..dd996e273 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00007.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00008.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00008.png index dd996e273..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00008.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00010.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00010.png index b0e8287da..393a15fb7 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00010.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00010.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00011.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00011.png index 0ae3f8bd3..551255b14 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00011.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_at_the_end/00011.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00002.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00002.png index 32580b8ff..d6deabe98 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00002.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00003.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00003.png index 603203fdd..e7bfe032f 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00003.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00004.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00004.png index daadf3b24..04889b556 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00004.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00005.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00005.png index 5b226371a..c5894b08c 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00005.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00006.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00006.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00007.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00007.png index b0e8287da..393a15fb7 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00007.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00008.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00008.png index 0ae3f8bd3..551255b14 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00008.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_added_inside/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00002.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00002.png index 32580b8ff..d6deabe98 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00002.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00003.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00003.png index 603203fdd..e7bfe032f 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00003.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00004.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00004.png index daadf3b24..04889b556 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00004.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00005.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00005.png index 5b226371a..c5894b08c 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00005.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00006.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00006.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00007.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00007.png index 1fcdee14d..ff518831a 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00007.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00008.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00008.png index ff518831a..393a15fb7 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00008.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00009.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00009.png index b0e8287da..551255b14 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00009.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00009.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00010.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00010.png index 0ae3f8bd3..363848ba0 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00010.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00010.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_magic_bytes/00001.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_magic_bytes/00001.png index b0e8287da..393a15fb7 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_magic_bytes/00001.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_magic_bytes/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_magic_bytes/00002.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_magic_bytes/00002.png index 0ae3f8bd3..551255b14 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_magic_bytes/00002.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_magic_bytes/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_operation/00001.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_operation/00001.png index b0e8287da..393a15fb7 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_operation/00001.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_operation/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_operation/00002.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_operation/00002.png index 0ae3f8bd3..551255b14 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_operation/00002.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/unknown_operation/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00002.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00002.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00003.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00003.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00004.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00004.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00006.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00006.png index 6266aa247..b0b2a6940 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00006.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00007.png b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00007.png index 74ca77cf2..39ed6ff59 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00007.png and b/tests/integration/nano/snapshots/nanosp/test_parsing_errors/wrong_last_packet/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_provide_pk/bip32_ed25519/00001.png b/tests/integration/nano/snapshots/nanosp/test_provide_pk/bip32_ed25519/00001.png index d3158a96e..29021e7c8 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_provide_pk/bip32_ed25519/00001.png and b/tests/integration/nano/snapshots/nanosp/test_provide_pk/bip32_ed25519/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_provide_pk/ed25519/00001.png b/tests/integration/nano/snapshots/nanosp/test_provide_pk/ed25519/00001.png index 836223b4f..13cef4a95 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_provide_pk/ed25519/00001.png and b/tests/integration/nano/snapshots/nanosp/test_provide_pk/ed25519/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_provide_pk/secp256k1/00001.png b/tests/integration/nano/snapshots/nanosp/test_provide_pk/secp256k1/00001.png index 5dfdfd9a0..821420b1b 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_provide_pk/secp256k1/00001.png and b/tests/integration/nano/snapshots/nanosp/test_provide_pk/secp256k1/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_provide_pk/secp256r1/00001.png b/tests/integration/nano/snapshots/nanosp/test_provide_pk/secp256r1/00001.png index 56e1a8129..9d77cd607 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_provide_pk/secp256r1/00001.png and b/tests/integration/nano/snapshots/nanosp/test_provide_pk/secp256r1/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_public_key/00001.png b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_public_key/00001.png index 836223b4f..13cef4a95 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_public_key/00001.png and b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_public_key/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_public_key/00003.png b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_public_key/00003.png index 604176763..137ca9e49 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_public_key/00003.png and b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_public_key/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00002.png b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00002.png and b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00003.png b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00003.png and b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00004.png b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00004.png and b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00005.png b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00005.png index c4768d4fa..ca0128108 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00005.png and b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00006.png b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00006.png and b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00007.png b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00007.png index 1fcdee14d..85234247e 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00007.png and b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00008.png b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00008.png index 85234247e..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00008.png and b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00011.png b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00011.png index eb0513902..d5afcef1b 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00011.png and b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00011.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00015.png b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00015.png index 604176763..137ca9e49 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00015.png and b/tests/integration/nano/snapshots/nanosp/test_regression_continue_after_reject/reject_signing/00015.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_reject_pk/00001.png b/tests/integration/nano/snapshots/nanosp/test_reject_pk/00001.png index 836223b4f..13cef4a95 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_reject_pk/00001.png and b/tests/integration/nano/snapshots/nanosp/test_reject_pk/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_reject_pk/00003.png b/tests/integration/nano/snapshots/nanosp/test_reject_pk/00003.png index 604176763..137ca9e49 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_reject_pk/00003.png and b/tests/integration/nano/snapshots/nanosp/test_reject_pk/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00002.png b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00002.png and b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00003.png b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00003.png and b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00004.png b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00004.png and b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00005.png b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00005.png index c4768d4fa..ca0128108 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00005.png and b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00006.png b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00006.png and b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00007.png b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00007.png index 1fcdee14d..85234247e 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00007.png and b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00008.png b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00008.png index 85234247e..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00008.png and b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00011.png b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00011.png index eb0513902..d5afcef1b 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00011.png and b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00011.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00015.png b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00015.png index 604176763..137ca9e49 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00015.png and b/tests/integration/nano/snapshots/nanosp/test_reject_transaction/00015.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_ballot/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_ballot/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_ballot/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_ballot/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00002.png index dc2ca7519..dda85c105 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00003.png index ae090c525..6c9e8ba67 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00004.png index bf7bf3f8c..3f82f8bfd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00005.png index 14ee8a131..5b96740c0 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_delegation/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_failing_noop/00001.png b/tests/integration/nano/snapshots/nanosp/test_sign_failing_noop/00001.png index 8876756cd..0ca80cc7c 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_failing_noop/00001.png and b/tests/integration/nano/snapshots/nanosp/test_sign_failing_noop/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00006.png b/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00006.png and b/tests/integration/nano/snapshots/nanosp/test_sign_increase_paid_storage/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00005.png index b2d9de9c8..3d919b22e 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00007.png b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00007.png index 1fcdee14d..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00007.png and b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00009.png b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00009.png index 1fcdee14d..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00009.png and b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00009.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00010.png b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00010.png index f656c824b..b236f41f2 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_origination/00010.png and b/tests/integration/nano/snapshots/nanosp/test_sign_origination/00010.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_proposals/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_proposals/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_proposals/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_proposals/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00005.png index 1fcdee14d..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_register_global_constant/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00005.png index 9e9418c7d..cc6c26e2f 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_reveal/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_add_messages/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00006.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00006.png index 6266aa247..b0b2a6940 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00006.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00007.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00007.png index 1fcdee14d..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00007.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00008.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00008.png index b15703dad..163ad8052 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00008.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00009.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00009.png index 2afcc2413..445ef21fe 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00009.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00009.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00010.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00010.png index 287b21ce1..23b79c97a 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00010.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00010.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00011.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00011.png index 8b2f30ef6..0f3bf5a6f 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00011.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00011.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00012.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00012.png index f3dd2a2e8..c95cb22ab 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00012.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00012.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00013.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00013.png index 867644e99..25daa7d4a 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00013.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_execute_outbox_message/00013.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00006.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00006.png index 1fcdee14d..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00006.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00013.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00013.png index 1fcdee14d..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00013.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00013.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00017.png b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00017.png index 1fcdee14d..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00017.png and b/tests/integration/nano/snapshots/nanosp/test_sign_sc_rollup_originate/00017.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00001.png b/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00001.png index 1a75d852f..fd4b64afd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00001.png and b/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00002.png index 4809c4c94..692229361 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00005.png index 9e9418c7d..cc6c26e2f 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_set_consensus_key/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00001.png b/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00001.png index e4a29f54d..8f49e9830 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00001.png and b/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00002.png index 023ebeda5..54c4dbfab 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00003.png index ffea3b01d..9bf3a483e 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00005.png index fac0093f4..6bf73fb05 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_set_deposit_limit/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00003.png index ceeb012d4..3fa2978d7 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00005.png index f5639cf65..10f978ef0 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00006.png b/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00006.png and b/tests/integration/nano/snapshots/nanosp/test_sign_simple_transaction/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00002.png index 32580b8ff..d6deabe98 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00003.png index 603203fdd..e7bfe032f 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00004.png index daadf3b24..04889b556 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00005.png index 5b226371a..c5894b08c 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00006.png b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00006.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00007.png b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00007.png index 1fcdee14d..dd996e273 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00007.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00008.png b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00008.png index dd996e273..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00008.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transaction/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00005.png index 1fcdee14d..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00007.png b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00007.png index 1fcdee14d..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00007.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00009.png b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00009.png index e2e0638c6..f25662e2c 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00009.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00009.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00011.png b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00011.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00011.png and b/tests/integration/nano/snapshots/nanosp/test_sign_transfer_ticket/00011.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00002.png index 32580b8ff..d6deabe98 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00003.png index 603203fdd..e7bfe032f 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00004.png index daadf3b24..04889b556 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00005.png index 5b226371a..c5894b08c 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00006.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00006.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00007.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00007.png index 1fcdee14d..dd996e273 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00007.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00008.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00008.png index dd996e273..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00008.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_another_seed/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00002.png index 8ace1d8be..fc2f4b729 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00003.png index f620b54b7..af9beddbf 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00004.png index a250608bf..908600200 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00005.png index c4768d4fa..ca0128108 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00007.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00007.png index 1fcdee14d..85234247e 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00007.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00008.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00008.png index 85234247e..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00008.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_long_hash/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00002.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00002.png index 32580b8ff..d6deabe98 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00002.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00003.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00003.png index 603203fdd..e7bfe032f 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00003.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00004.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00004.png index daadf3b24..04889b556 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00004.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00005.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00005.png index 5b226371a..c5894b08c 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00005.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00006.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00006.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00007.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00007.png index 1fcdee14d..dd996e273 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00007.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00008.png b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00008.png index dd996e273..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00008.png and b/tests/integration/nano/snapshots/nanosp/test_sign_with_small_packet/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00002.png b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00002.png index 32580b8ff..d6deabe98 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00002.png and b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00003.png b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00003.png index 603203fdd..e7bfe032f 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00003.png and b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00003.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00004.png b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00004.png index daadf3b24..04889b556 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00004.png and b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00004.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00005.png b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00005.png index 5b226371a..c5894b08c 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00005.png and b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00005.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00006.png b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00006.png index ac0607630..7ef47f863 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00006.png and b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00006.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00007.png b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00007.png index eb3e0de1a..dd996e273 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00007.png and b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00007.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00008.png b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00008.png index 363848ba0..e147cd486 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00008.png and b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00008.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00011.png b/tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00009.png similarity index 100% rename from tests/integration/nano/snapshots/nanosp/test_parsing_errors/one_byte_removed_inside/00011.png rename to tests/integration/nano/snapshots/nanosp/test_too_complex_transaction/00009.png diff --git a/tests/integration/nano/snapshots/nanosp/test_too_deep/00001.png b/tests/integration/nano/snapshots/nanosp/test_too_deep/00001.png index 4a29c4511..c7d4300fc 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_too_deep/00001.png and b/tests/integration/nano/snapshots/nanosp/test_too_deep/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_too_deep/00002.png b/tests/integration/nano/snapshots/nanosp/test_too_deep/00002.png index 0ae3f8bd3..551255b14 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_too_deep/00002.png and b/tests/integration/nano/snapshots/nanosp/test_too_deep/00002.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_too_large/00001.png b/tests/integration/nano/snapshots/nanosp/test_too_large/00001.png index 35abc6eef..184e20ac9 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_too_large/00001.png and b/tests/integration/nano/snapshots/nanosp/test_too_large/00001.png differ diff --git a/tests/integration/nano/snapshots/nanosp/test_too_large/00002.png b/tests/integration/nano/snapshots/nanosp/test_too_large/00002.png index 0ae3f8bd3..551255b14 100644 Binary files a/tests/integration/nano/snapshots/nanosp/test_too_large/00002.png and b/tests/integration/nano/snapshots/nanosp/test_too_large/00002.png differ diff --git a/tests/integration/nano/snapshots/nanox/regression_batched_ops/00007.png b/tests/integration/nano/snapshots/nanox/regression_batched_ops/00007.png index 59fce75cd..9ad31eb1c 100644 Binary files a/tests/integration/nano/snapshots/nanox/regression_batched_ops/00007.png and b/tests/integration/nano/snapshots/nanox/regression_batched_ops/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/regression_batched_ops/00008.png b/tests/integration/nano/snapshots/nanox/regression_batched_ops/00008.png index 9ad31eb1c..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanox/regression_batched_ops/00008.png and b/tests/integration/nano/snapshots/nanox/regression_batched_ops/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_ensure_always_clearsign/00007.png b/tests/integration/nano/snapshots/nanox/test_ensure_always_clearsign/00007.png index 59fce75cd..85234247e 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_ensure_always_clearsign/00007.png and b/tests/integration/nano/snapshots/nanox/test_ensure_always_clearsign/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_ensure_always_clearsign/00008.png b/tests/integration/nano/snapshots/nanox/test_ensure_always_clearsign/00008.png index 85234247e..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_ensure_always_clearsign/00008.png and b/tests/integration/nano/snapshots/nanox/test_ensure_always_clearsign/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00007.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00007.png index 59fce75cd..dd996e273 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00007.png and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00008.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00008.png index dd996e273..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00008.png and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00007.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00007.png index 59fce75cd..ff518831a 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00007.png and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00008.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00008.png index ff518831a..393a15fb7 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00008.png and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00009.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00009.png index 393a15fb7..551255b14 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00009.png and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00009.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00010.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00010.png index 551255b14..363848ba0 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00010.png and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00010.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_regression_continue_after_reject/reject_signing/00007.png b/tests/integration/nano/snapshots/nanox/test_regression_continue_after_reject/reject_signing/00007.png index 59fce75cd..85234247e 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_regression_continue_after_reject/reject_signing/00007.png and b/tests/integration/nano/snapshots/nanox/test_regression_continue_after_reject/reject_signing/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_regression_continue_after_reject/reject_signing/00008.png b/tests/integration/nano/snapshots/nanox/test_regression_continue_after_reject/reject_signing/00008.png index 85234247e..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_regression_continue_after_reject/reject_signing/00008.png and b/tests/integration/nano/snapshots/nanox/test_regression_continue_after_reject/reject_signing/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_reject_transaction/00007.png b/tests/integration/nano/snapshots/nanox/test_reject_transaction/00007.png index 59fce75cd..85234247e 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_reject_transaction/00007.png and b/tests/integration/nano/snapshots/nanox/test_reject_transaction/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_reject_transaction/00008.png b/tests/integration/nano/snapshots/nanox/test_reject_transaction/00008.png index 85234247e..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_reject_transaction/00008.png and b/tests/integration/nano/snapshots/nanox/test_reject_transaction/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign_transaction/00007.png b/tests/integration/nano/snapshots/nanox/test_sign_transaction/00007.png index 59fce75cd..dd996e273 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_sign_transaction/00007.png and b/tests/integration/nano/snapshots/nanox/test_sign_transaction/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign_transaction/00008.png b/tests/integration/nano/snapshots/nanox/test_sign_transaction/00008.png index dd996e273..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_sign_transaction/00008.png and b/tests/integration/nano/snapshots/nanox/test_sign_transaction/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign_with_another_seed/00007.png b/tests/integration/nano/snapshots/nanox/test_sign_with_another_seed/00007.png index 59fce75cd..dd996e273 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_sign_with_another_seed/00007.png and b/tests/integration/nano/snapshots/nanox/test_sign_with_another_seed/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign_with_another_seed/00008.png b/tests/integration/nano/snapshots/nanox/test_sign_with_another_seed/00008.png index dd996e273..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_sign_with_another_seed/00008.png and b/tests/integration/nano/snapshots/nanox/test_sign_with_another_seed/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign_with_long_hash/00007.png b/tests/integration/nano/snapshots/nanox/test_sign_with_long_hash/00007.png index 59fce75cd..85234247e 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_sign_with_long_hash/00007.png and b/tests/integration/nano/snapshots/nanox/test_sign_with_long_hash/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign_with_long_hash/00008.png b/tests/integration/nano/snapshots/nanox/test_sign_with_long_hash/00008.png index 85234247e..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_sign_with_long_hash/00008.png and b/tests/integration/nano/snapshots/nanox/test_sign_with_long_hash/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign_with_small_packet/00007.png b/tests/integration/nano/snapshots/nanox/test_sign_with_small_packet/00007.png index 59fce75cd..dd996e273 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_sign_with_small_packet/00007.png and b/tests/integration/nano/snapshots/nanox/test_sign_with_small_packet/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_sign_with_small_packet/00008.png b/tests/integration/nano/snapshots/nanox/test_sign_with_small_packet/00008.png index dd996e273..59fce75cd 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_sign_with_small_packet/00008.png and b/tests/integration/nano/snapshots/nanox/test_sign_with_small_packet/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_too_complex_transaction/00007.png b/tests/integration/nano/snapshots/nanox/test_too_complex_transaction/00007.png index 624503e64..dd996e273 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_too_complex_transaction/00007.png and b/tests/integration/nano/snapshots/nanox/test_too_complex_transaction/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_too_complex_transaction/00008.png b/tests/integration/nano/snapshots/nanox/test_too_complex_transaction/00008.png index 363848ba0..e147cd486 100644 Binary files a/tests/integration/nano/snapshots/nanox/test_too_complex_transaction/00008.png and b/tests/integration/nano/snapshots/nanox/test_too_complex_transaction/00008.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00011.png b/tests/integration/nano/snapshots/nanox/test_too_complex_transaction/00009.png similarity index 100% rename from tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00011.png rename to tests/integration/nano/snapshots/nanox/test_too_complex_transaction/00009.png diff --git a/tests/integration/stax/snapshots/test_blindsign_too_deep_rejections/reject_review.png b/tests/integration/stax/snapshots/test_blindsign_too_deep_rejections/reject_review.png index cebc8bede..babad9890 100644 Binary files a/tests/integration/stax/snapshots/test_blindsign_too_deep_rejections/reject_review.png and b/tests/integration/stax/snapshots/test_blindsign_too_deep_rejections/reject_review.png differ diff --git a/tests/integration/stax/snapshots/test_blindsign_too_deep_rejections/rejected.png b/tests/integration/stax/snapshots/test_blindsign_too_deep_rejections/rejected.png new file mode 100644 index 000000000..cebc8bede Binary files /dev/null and b/tests/integration/stax/snapshots/test_blindsign_too_deep_rejections/rejected.png differ diff --git a/tests/integration/stax/snapshots/test_blindsign_too_large/tbtl_review_1.png b/tests/integration/stax/snapshots/test_blindsign_too_large/tbtl_review_1.png index 18a89739c..7fc8c6a9e 100644 Binary files a/tests/integration/stax/snapshots/test_blindsign_too_large/tbtl_review_1.png and b/tests/integration/stax/snapshots/test_blindsign_too_large/tbtl_review_1.png differ diff --git a/tests/integration/stax/snapshots/test_blindsign_valid/tst_review_003.png b/tests/integration/stax/snapshots/test_blindsign_valid/tst_review_003.png index 2c6fd401c..93af184c9 100644 Binary files a/tests/integration/stax/snapshots/test_blindsign_valid/tst_review_003.png and b/tests/integration/stax/snapshots/test_blindsign_valid/tst_review_003.png differ diff --git a/tests/integration/stax/snapshots/test_blindsign_valid/tst_review_004.png b/tests/integration/stax/snapshots/test_blindsign_valid/tst_review_004.png new file mode 100644 index 000000000..afb0c5601 Binary files /dev/null and b/tests/integration/stax/snapshots/test_blindsign_valid/tst_review_004.png differ diff --git a/tests/integration/stax/snapshots/test_expert_mode_rejections/tst_review_003.png b/tests/integration/stax/snapshots/test_expert_mode_rejections/tst_review_003.png new file mode 100644 index 000000000..93af184c9 Binary files /dev/null and b/tests/integration/stax/snapshots/test_expert_mode_rejections/tst_review_003.png differ diff --git a/tests/integration/stax/snapshots/test_parsing_errors/reject_review.png b/tests/integration/stax/snapshots/test_parsing_errors/reject_review.png index cebc8bede..babad9890 100644 Binary files a/tests/integration/stax/snapshots/test_parsing_errors/reject_review.png and b/tests/integration/stax/snapshots/test_parsing_errors/reject_review.png differ diff --git a/tests/integration/stax/snapshots/test_parsing_errors/rejected.png b/tests/integration/stax/snapshots/test_parsing_errors/rejected.png new file mode 100644 index 000000000..cebc8bede Binary files /dev/null and b/tests/integration/stax/snapshots/test_parsing_errors/rejected.png differ diff --git a/tests/integration/stax/snapshots/test_parsing_errors/tpe_review_0_03_full.png b/tests/integration/stax/snapshots/test_parsing_errors/tpe_review_0_03_full.png index 2c6fd401c..93af184c9 100644 Binary files a/tests/integration/stax/snapshots/test_parsing_errors/tpe_review_0_03_full.png and b/tests/integration/stax/snapshots/test_parsing_errors/tpe_review_0_03_full.png differ diff --git a/tests/integration/stax/snapshots/test_parsing_errors/tpe_review_0_04_full.png b/tests/integration/stax/snapshots/test_parsing_errors/tpe_review_0_04_full.png new file mode 100644 index 000000000..afb0c5601 Binary files /dev/null and b/tests/integration/stax/snapshots/test_parsing_errors/tpe_review_0_04_full.png differ diff --git a/tests/integration/stax/snapshots/test_sign_transfer/tst_review_003.png b/tests/integration/stax/snapshots/test_sign_transfer/tst_review_003.png index 2c6fd401c..93af184c9 100644 Binary files a/tests/integration/stax/snapshots/test_sign_transfer/tst_review_003.png and b/tests/integration/stax/snapshots/test_sign_transfer/tst_review_003.png differ diff --git a/tests/integration/stax/snapshots/test_sign_transfer/tst_review_004.png b/tests/integration/stax/snapshots/test_sign_transfer/tst_review_004.png new file mode 100644 index 000000000..afb0c5601 Binary files /dev/null and b/tests/integration/stax/snapshots/test_sign_transfer/tst_review_004.png differ diff --git a/tests/integration/stax/snapshots/test_sign_transfer_without_hash/review_2.png b/tests/integration/stax/snapshots/test_sign_transfer_without_hash/review_2.png index 2c6fd401c..93af184c9 100644 Binary files a/tests/integration/stax/snapshots/test_sign_transfer_without_hash/review_2.png and b/tests/integration/stax/snapshots/test_sign_transfer_without_hash/review_2.png differ diff --git a/tests/integration/stax/snapshots/test_sign_transfer_without_hash/review_3.png b/tests/integration/stax/snapshots/test_sign_transfer_without_hash/review_3.png new file mode 100644 index 000000000..afb0c5601 Binary files /dev/null and b/tests/integration/stax/snapshots/test_sign_transfer_without_hash/review_3.png differ diff --git a/tests/integration/stax/test_blindsign_valid.py b/tests/integration/stax/test_blindsign_valid.py index 874026d97..585ff9f8c 100755 --- a/tests/integration/stax/test_blindsign_valid.py +++ b/tests/integration/stax/test_blindsign_valid.py @@ -49,11 +49,15 @@ app.review.tap() app.assert_screen("tst_review_002") + app.review.tap() + app.assert_screen("tst_review_003") + app.review.tap() app.expert_mode_splash() app.review.tap() - app.assert_screen("tst_review_003") + app.assert_screen("tst_review_004") + app.review.tap() app.assert_screen("operation_sign") diff --git a/tests/integration/stax/test_expert_mode_rejections.py b/tests/integration/stax/test_expert_mode_rejections.py index 09c4693aa..ee58efac2 100644 --- a/tests/integration/stax/test_expert_mode_rejections.py +++ b/tests/integration/stax/test_expert_mode_rejections.py @@ -31,6 +31,8 @@ def sign_transfer_initialize(app): app.assert_screen(f"tst_review_001") app.review.tap() app.assert_screen("tst_review_002") + app.review.tap() + app.assert_screen("tst_review_003") diff --git a/tests/integration/stax/test_parsing_errors.py b/tests/integration/stax/test_parsing_errors.py index a758024d1..d528192ee 100755 --- a/tests/integration/stax/test_parsing_errors.py +++ b/tests/integration/stax/test_parsing_errors.py @@ -43,8 +43,6 @@ app.review.tap() app.assert_screen("tpe_review_0_02_partial") app.review.tap() - app.expert_mode_splash() - app.review.tap() app.assert_screen("tpe_review_0_03") app.review.tap() verify_err_reject_response(app, "invalid_tag") @@ -57,10 +55,12 @@ app.review.tap() app.assert_screen("tpe_review_0_02_full") app.review.tap() - app.assert_screen("expert_mode_splash") - app.review.tap() app.assert_screen("tpe_review_0_03_full") app.review.tap() + app.expert_mode_splash() + app.review.tap() + app.assert_screen("tpe_review_0_04_full") + app.review.tap() verify_err_reject_response(app, "invalid_tag") diff --git a/tests/integration/stax/test_sign_transfer.py b/tests/integration/stax/test_sign_transfer.py index 89bce1dfd..11c666555 100755 --- a/tests/integration/stax/test_sign_transfer.py +++ b/tests/integration/stax/test_sign_transfer.py @@ -38,6 +38,9 @@ app.review.tap() app.assert_screen("tst_review_002") + app.review.tap() + app.assert_screen("tst_review_003") + app.review.tap() app.enable_expert_mode() @@ -45,7 +48,7 @@ app.assert_screen("tst_expert_splash") app.review.tap() - app.assert_screen("tst_review_003") + app.assert_screen("tst_review_004") app.review.tap() app.assert_screen("operation_sign") @@ -69,11 +72,14 @@ app.review.tap() app.assert_screen("tst_review_002") + app.review.tap() + app.assert_screen("tst_review_003") + app.review.tap() app.assert_screen("tst_expert_splash") app.review.tap() - app.assert_screen("tst_review_003") + app.assert_screen("tst_review_004") app.review.tap() app.assert_screen("operation_sign") diff --git a/tests/integration/stax/test_sign_transfer_without_hash.py b/tests/integration/stax/test_sign_transfer_without_hash.py index 0804261c4..277011488 100755 --- a/tests/integration/stax/test_sign_transfer_without_hash.py +++ b/tests/integration/stax/test_sign_transfer_without_hash.py @@ -38,11 +38,14 @@ app.review.tap() app.assert_screen("review_1") + app.review.tap() + app.assert_screen("review_2") + app.review.tap() app.expert_mode_splash() app.review.tap() - app.assert_screen("review_2") + app.assert_screen("review_3") app.review.tap() app.assert_screen("operation_sign") diff --git a/tests/integration/stax/utils.py b/tests/integration/stax/utils.py index 9449accfd..c5d9355d3 100644 --- a/tests/integration/stax/utils.py +++ b/tests/integration/stax/utils.py @@ -191,15 +191,12 @@ def send_payload(app, apdu): app.assert_screen("review_request_sign_operation"); def verify_err_reject_response(app, tag): - app.assert_screen(tag) - app.welcome.client.pause_ticker() - app.review.reject() - app.assert_screen("reject_review") - app.welcome.client.resume_ticker() - app.review.tap() - assert_home_with_code(app, "9405") + verify_reject_response_common(app,tag,"9405") def verify_reject_response(app, tag): + verify_reject_response_common(app, tag,"6985") + +def verify_reject_response_common(app, tag, err_code): app.assert_screen(tag) app.review.reject() app.assert_screen("reject_review") @@ -208,4 +205,4 @@ def verify_reject_response(app, tag): app.assert_screen("rejected") app.review.tap() app.welcome.client.resume_ticker() - assert_home_with_code(app, "6985") + assert_home_with_code(app, err_code) diff --git a/tests/unit/ctest/tests_parser.c b/tests/unit/ctest/tests_parser.c index 4e8e5c95b..282ccc024 100644 --- a/tests/unit/ctest/tests_parser.c +++ b/tests/unit/ctest/tests_parser.c @@ -234,6 +234,7 @@ CTEST2(operation_parser, check_simple_transaction_complexity) {"Storage limit", false, 3}, {"Amount", false, 4}, {"Destination", false, 5}, + // {"Option", _, 6}, }; check_field_complexity(data, str, fields_check, sizeof(fields_check)); } @@ -250,8 +251,10 @@ CTEST2(operation_parser, check_transaction_complexity) {"Storage limit", false, 3}, {"Amount", false, 4}, {"Destination", false, 5}, - {"Entrypoint", true, 6}, - {"Parameter", true, 6}, + // {"Option", _, 6}, + // {"Tuple", _, 7}, + {"Entrypoint", false, 8}, + {"Parameter", true, 9}, }; check_field_complexity(data, str, fields_check, sizeof(fields_check)); } @@ -270,14 +273,16 @@ CTEST2(operation_parser, check_double_transaction_complexity) {"Storage limit", false, 3 }, {"Amount", false, 4 }, {"Destination", false, 5 }, - // {"None" , false, 6 }, + // {"Option", _, 6 }, {"Source", false, 7 }, {"Fee", false, 8 }, {"Storage limit", false, 9 }, {"Amount", false, 10}, {"Destination", false, 11}, - {"Entrypoint", true, 12}, - {"Parameter", true, 12}, + // {"Option", _, 12}, + // {"Tuple", _, 13}, + {"Entrypoint", false, 14}, + {"Parameter", true, 15}, }; check_field_complexity(data, str, fields_check, sizeof(fields_check)); } @@ -293,7 +298,7 @@ CTEST2(operation_parser, check_origination_complexity) {"Fee", false, 2}, {"Storage limit", false, 3}, {"Balance", false, 4}, - {"Delegate", false, 5}, + {"Delegate", false, 5}, // None {"Code", true, 6}, {"Storage", true, 7}, }; @@ -310,7 +315,8 @@ CTEST2(operation_parser, check_delegation_complexity) {"Source", false, 1}, {"Fee", false, 2}, {"Storage limit", false, 3}, - {"Delegate", false, 4}, + // {"Option", _, 4}, + {"Delegate", false, 5}, }; check_field_complexity(data, str, fields_check, sizeof(fields_check)); } @@ -330,7 +336,7 @@ CTEST2(operation_parser, check_register_global_constant_complexity) check_field_complexity(data, str, fields_check, sizeof(fields_check)); } -CTEST2(operation_parser, check_set_deposit_limite_complexity) +CTEST2(operation_parser, check_set_deposit_limit_complexity) { char str[] = "030000000000000000000000000000000000000000000000000000000000000000" @@ -340,7 +346,8 @@ CTEST2(operation_parser, check_set_deposit_limite_complexity) {"Source", false, 1}, {"Fee", false, 2}, {"Storage limit", false, 3}, - {"Staking limit", false, 4}, + // {"Option", _, 4}, + {"Staking limit", false, 5}, }; check_field_complexity(data, str, fields_check, sizeof(fields_check)); }