diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..f2fb620f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +# Checklist + +- [ ] App update process has been followed +- [ ] Target branch is `develop` +- [ ] Application version has been bumped + + diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index e592b6e7..29e17faf 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -14,7 +14,6 @@ jobs: uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 with: upload_app_binaries_artifact: compiled_app_binaries - run_for_devices: '["nanos", "nanox", "nanosp"]' ragger_tests: name: Run ragger tests using the reusable workflow @@ -22,8 +21,6 @@ jobs: uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1 with: download_app_binaries_artifact: compiled_app_binaries - test_dir: tests/python - run_for_devices: '["nanos", "nanox", "nanosp"]' job_C_test: name: C tests diff --git a/.github/workflows/guidelines_enforcer.yml b/.github/workflows/guidelines_enforcer.yml new file mode 100644 index 00000000..fdaf9f27 --- /dev/null +++ b/.github/workflows/guidelines_enforcer.yml @@ -0,0 +1,23 @@ +name: Ensure compliance with Ledger guidelines + +# This workflow is mandatory in all applications +# It calls a reusable workflow guidelines_enforcer developed by Ledger's internal developer team. +# The successful completion of the reusable workflow is a mandatory step for an app to be available on the Ledger +# application store. +# +# More information on the guidelines can be found in the repository: +# LedgerHQ/ledger-app-workflows/ + +on: + workflow_dispatch: + push: + branches: + - master + - main + - develop + pull_request: + +jobs: + guidelines_enforcer: + name: Call Ledger guidelines_enforcer + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1 diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index bc8fe835..690a61dc 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -8,54 +8,37 @@ on: pull_request: jobs: - build: - name: SonarQube analyze + sonarcloud: runs-on: ubuntu-latest container: image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest + env: - SONAR_SCANNER_VERSION: 4.7.0.2747 - SONAR_SERVER_URL: "https://sonarcloud.io" BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Download and set up sonar-scanner - env: - SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip - run: | - apt-get update -y - apt-get upgrade -y - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata - curl -sL https://deb.nodesource.com/setup_16.x | bash - - apt-get install -y gcovr nodejs unzip lcov - mkdir -p $HOME/.sonar - curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }} - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH - - name: Download and set up build-wrapper - env: - BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip - run: | - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }} - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ - echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH - - name: Generate code coverage - working-directory: libsol - run: | - make COVERAGE=1 - gcovr --root .. --sonarqube ../coverage.xml - - name: Run build-wrapper - run: | - build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make clean all - - name: Run sonar-scanner - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: | - sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" + - uses: actions/checkout@v3 + with: + # Disabling shallow clone is recommended for improving relevancy of reporting + fetch-depth: 0 + - name: Install dependencies + run: | + apt-get update -y + apt-get upgrade -y + DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + apt-get install -y libcmocka-dev gcovr unzip + - name: Install sonar-scanner and build-wrapper + uses: sonarsource/sonarcloud-github-c-cpp@v2 + + - name: Generate code coverage + working-directory: libsol + run: | + make COVERAGE=1 + gcovr --root .. --sonarqube ../coverage.xml + - name: Run build-wrapper + run: | + build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make clean all + - name: Run sonar-scanner + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" #Consult https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/ for more information and options diff --git a/Makefile b/Makefile index ef5edd10..57080871 100644 --- a/Makefile +++ b/Makefile @@ -29,10 +29,10 @@ endif include $(BOLOS_SDK)/Makefile.defines APP_LOAD_PARAMS = --curve ed25519 -ifeq ($(TARGET_NAME), TARGET_NANOS) -APP_LOAD_PARAMS += --appFlags 0x800 # APPLICATION_FLAG_LIBRARY -else +ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX)) APP_LOAD_PARAMS += --appFlags 0xa00 # APPLICATION_FLAG_LIBRARY + APPLICATION_FLAG_BOLOS_SETTINGS +else +APP_LOAD_PARAMS += --appFlags 0x800 # APPLICATION_FLAG_LIBRARY endif APP_LOAD_PARAMS += --path "44'/501'" APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS) @@ -40,11 +40,13 @@ APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS) APPNAME = "Solana" APPVERSION_M = 1 APPVERSION_N = 4 -APPVERSION_P = 1 +APPVERSION_P = 3 APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" ifeq ($(TARGET_NAME),TARGET_NANOS) ICONNAME=icons/nanos_app_solana.gif +else ifeq ($(TARGET_NAME),TARGET_STAX) + ICONNAME=icons/stax_app_solana.gif else ICONNAME=icons/nanox_app_solana.gif endif @@ -59,14 +61,14 @@ DEFINES += APPNAME=\"$(APPNAME)\" DEFINES += APPVERSION=\"$(APPVERSION)\" DEFINES += MAJOR_VERSION=$(APPVERSION_M) MINOR_VERSION=$(APPVERSION_N) PATCH_VERSION=$(APPVERSION_P) DEFINES += OS_IO_SEPROXYHAL -DEFINES += HAVE_BAGL HAVE_UX_FLOW HAVE_SPRINTF +DEFINES += HAVE_SPRINTF DEFINES += HAVE_IO_USB HAVE_L4_USBLIB IO_USB_MAX_ENDPOINTS=6 IO_HID_EP_LENGTH=64 HAVE_USB_APDU DEFINES += USB_SEGMENT_SIZE=64 DEFINES += BLE_SEGMENT_SIZE=32 DEFINES += HAVE_WEBUSB WEBUSB_URL_SIZE_B=0 WEBUSB_URL="" DEFINES += UNUSED\(x\)=\(void\)x -ifeq ($(TARGET_NAME),TARGET_NANOX) +ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX)) DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000 HAVE_BLE_APDU endif @@ -74,12 +76,21 @@ ifeq ($(TARGET_NAME),TARGET_NANOS) DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=128 else DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300 - DEFINES += HAVE_GLO096 - DEFINES += BAGL_WIDTH=128 BAGL_HEIGHT=64 - DEFINES += HAVE_BAGL_ELLIPSIS - DEFINES += HAVE_BAGL_FONT_OPEN_SANS_REGULAR_11PX - DEFINES += HAVE_BAGL_FONT_OPEN_SANS_EXTRABOLD_11PX - DEFINES += HAVE_BAGL_FONT_OPEN_SANS_LIGHT_16PX +endif + +ifeq ($(TARGET_NAME),TARGET_STAX) + DEFINES += NBGL_QRCODE + SDK_SOURCE_PATH += qrcode +else + DEFINES += HAVE_BAGL HAVE_UX_FLOW + ifneq ($(TARGET_NAME),TARGET_NANOS) + DEFINES += HAVE_GLO096 + DEFINES += BAGL_WIDTH=128 BAGL_HEIGHT=64 + DEFINES += HAVE_BAGL_ELLIPSIS + DEFINES += HAVE_BAGL_FONT_OPEN_SANS_REGULAR_11PX + DEFINES += HAVE_BAGL_FONT_OPEN_SANS_EXTRABOLD_11PX + DEFINES += HAVE_BAGL_FONT_OPEN_SANS_LIGHT_16PX + endif endif DEBUG = 0 @@ -118,9 +129,16 @@ LDLIBS += -lm -lgcc -lc include $(BOLOS_SDK)/Makefile.glyphs APP_SOURCE_PATH += src -SDK_SOURCE_PATH += lib_stusb lib_stusb_impl lib_ux +SDK_SOURCE_PATH += lib_stusb lib_stusb_impl + +# Allow usage of function from lib_standard_app/crypto_helpers.c +APP_SOURCE_FILES += ${BOLOS_SDK}/lib_standard_app/crypto_helpers.c + +ifneq ($(TARGET_NAME),TARGET_STAX) +SDK_SOURCE_PATH += lib_ux +endif -ifeq ($(TARGET_NAME),TARGET_NANOX) +ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX)) SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl endif diff --git a/glyphs/solana_logo.gif b/glyphs/icon_solana_16x16.gif similarity index 100% rename from glyphs/solana_logo.gif rename to glyphs/icon_solana_16x16.gif diff --git a/glyphs/icon_solana_64x64.gif b/glyphs/icon_solana_64x64.gif new file mode 100644 index 00000000..4c75d4c3 Binary files /dev/null and b/glyphs/icon_solana_64x64.gif differ diff --git a/icons/stax_app_solana.gif b/icons/stax_app_solana.gif new file mode 100644 index 00000000..57a85320 Binary files /dev/null and b/icons/stax_app_solana.gif differ diff --git a/ledger_app.toml b/ledger_app.toml new file mode 100644 index 00000000..d19344d0 --- /dev/null +++ b/ledger_app.toml @@ -0,0 +1,7 @@ +[app] +build_directory = "./" +sdk = "C" +devices = ["nanos", "nanox", "nanos+", "stax"] + +[tests] +pytest_directory = "./tests/python" diff --git a/src/apdu.h b/src/apdu.h index 2499e753..59e14ab3 100644 --- a/src/apdu.h +++ b/src/apdu.h @@ -38,6 +38,7 @@ typedef enum ApduReply { ApduReplySdkNotEnoughSpace = 0x6819, ApduReplyNoApduReceived = 0x6982, + ApduReplyUserRefusal = 0x6985, ApduReplySolanaInvalidMessage = 0x6a80, ApduReplySolanaInvalidMessageHeader = 0x6a81, @@ -79,4 +80,4 @@ extern ApduCommand G_command; int apdu_handle_message(const uint8_t* apdu_message, size_t apdu_message_len, - ApduCommand* apdu_command); \ No newline at end of file + ApduCommand* apdu_command); diff --git a/src/getPubkey.c b/src/handle_get_pubkey.c similarity index 51% rename from src/getPubkey.c rename to src/handle_get_pubkey.c index e7de168b..f61395e7 100644 --- a/src/getPubkey.c +++ b/src/handle_get_pubkey.c @@ -1,51 +1,24 @@ -#include "apdu.h" -#include "getPubkey.h" -#include "os.h" -#include "ux.h" #include "utils.h" +#include "globals.h" +#include "handle_get_pubkey.h" #include "sol/printer.h" +#include "ui_api.h" static uint8_t G_publicKey[PUBKEY_LENGTH]; -static char G_publicKeyStr[BASE58_PUBKEY_LENGTH]; +char G_publicKeyStr[BASE58_PUBKEY_LENGTH]; void reset_getpubkey_globals(void) { MEMCLEAR(G_publicKey); MEMCLEAR(G_publicKeyStr); } -static uint8_t set_result_get_pubkey() { +uint8_t set_result_get_pubkey(void) { memcpy(G_io_apdu_buffer, G_publicKey, PUBKEY_LENGTH); return PUBKEY_LENGTH; } ////////////////////////////////////////////////////////////////////// -UX_STEP_NOCB(ux_display_public_flow_5_step, - bnnn_paging, - { - .title = "Pubkey", - .text = G_publicKeyStr, - }); -UX_STEP_CB(ux_display_public_flow_6_step, - pb, - sendResponse(set_result_get_pubkey(), true, true), - { - &C_icon_validate_14, - "Approve", - }); -UX_STEP_CB(ux_display_public_flow_7_step, - pb, - sendResponse(0, false, true), - { - &C_icon_crossmark, - "Reject", - }); - -UX_FLOW(ux_display_public_flow, - &ux_display_public_flow_5_step, - &ux_display_public_flow_6_step, - &ux_display_public_flow_7_step); - void handle_get_pubkey(volatile unsigned int *flags, volatile unsigned int *tx) { if (!flags || !tx || (G_command.instruction != InsDeprecatedGetPubkey && @@ -61,7 +34,7 @@ void handle_get_pubkey(volatile unsigned int *flags, volatile unsigned int *tx) *tx = set_result_get_pubkey(); THROW(ApduReplySuccess); } else { - ux_flow_init(0, ux_display_public_flow, NULL); + ui_get_public_key(); *flags |= IO_ASYNCH_REPLY; } } diff --git a/src/getPubkey.h b/src/handle_get_pubkey.h similarity index 58% rename from src/getPubkey.h rename to src/handle_get_pubkey.h index 59e0e1fa..99ade210 100644 --- a/src/getPubkey.h +++ b/src/handle_get_pubkey.h @@ -1,12 +1,14 @@ +#pragma once + #include "os.h" #include "cx.h" #include "globals.h" +#include "sol/printer.h" -#ifndef _GET_PUBKEY_H_ -#define _GET_PUBKEY_H_ +extern char G_publicKeyStr[BASE58_PUBKEY_LENGTH]; void reset_getpubkey_globals(void); void handle_get_pubkey(volatile unsigned int *flags, volatile unsigned int *tx); -#endif +uint8_t set_result_get_pubkey(void); diff --git a/src/signMessage.c b/src/handle_sign_message.c similarity index 64% rename from src/signMessage.c rename to src/handle_sign_message.c index 07318f9f..37bce491 100644 --- a/src/signMessage.c +++ b/src/handle_sign_message.c @@ -1,90 +1,15 @@ -#include "getPubkey.h" -#include "os.h" -#include "ux.h" -#include "cx.h" -#include "menu.h" +#include "io.h" #include "utils.h" +#include "handle_swap_sign_transaction.h" + #include "sol/parser.h" #include "sol/printer.h" #include "sol/print_config.h" #include "sol/message.h" #include "sol/transaction_summary.h" -#include "globals.h" -#include "apdu.h" - -#include "handle_swap_sign_transaction.h" - -static uint8_t set_result_sign_message() { - uint8_t signature[SIGNATURE_LENGTH]; - cx_ecfp_private_key_t privateKey; - BEGIN_TRY { - TRY { - get_private_key_with_seed(&privateKey, - G_command.derivation_path, - G_command.derivation_path_length); - cx_eddsa_sign(&privateKey, - CX_LAST, - CX_SHA512, - G_command.message, - G_command.message_length, - NULL, - 0, - signature, - SIGNATURE_LENGTH, - NULL); - memcpy(G_io_apdu_buffer, signature, SIGNATURE_LENGTH); - } - CATCH_OTHER(e) { - MEMCLEAR(privateKey); - THROW(e); - } - FINALLY { - MEMCLEAR(privateKey); - } - } - END_TRY; - return SIGNATURE_LENGTH; -} - -////////////////////////////////////////////////////////////////////// - -UX_STEP_CB(ux_approve_step, - pb, - sendResponse(set_result_sign_message(), true, true), - { - &C_icon_validate_14, - "Approve", - }); -UX_STEP_CB(ux_reject_step, - pb, - sendResponse(0, false, true), - { - &C_icon_crossmark, - "Reject", - }); -UX_STEP_NOCB_INIT(ux_summary_step, - bnnn_paging, - { - size_t step_index = G_ux.flow_stack[stack_slot].index; - enum DisplayFlags flags = DisplayFlagNone; - if (N_storage.settings.pubkey_display == PubkeyDisplayLong) { - flags |= DisplayFlagLongPubkeys; - } - if (transaction_summary_display_item(step_index, flags)) { - THROW(ApduReplySolanaSummaryUpdateFailed); - } - }, - { - .title = G_transaction_summary_title, - .text = G_transaction_summary_text, - }); -#define MAX_FLOW_STEPS \ - (MAX_TRANSACTION_SUMMARY_ITEMS + 1 /* approve */ \ - + 1 /* reject */ \ - + 1 /* FLOW_END_STEP */ \ - ) -ux_flow_step_t const *flow_steps[MAX_FLOW_STEPS]; +#include "handle_sign_message.h" +#include "ui_api.h" static int scan_header_for_signer(const uint32_t *derivation_path, uint32_t derivation_path_length, @@ -214,25 +139,13 @@ void handle_sign_message_ui(volatile unsigned int *flags) { } if (check_swap_validity(summary_step_kinds, num_summary_steps)) { PRINTF("Valid swap transaction signed\n"); - sendResponse(set_result_sign_message(), true, false); - os_sched_exit(0); + sendResponse(set_result_sign_message(), ApduReplySuccess, false); } else { PRINTF("Refused signing incorrect Swap transaction\n"); - THROW(ApduReplySolanaSummaryFinalizeFailed); + sendResponse(0, ApduReplySolanaSummaryFinalizeFailed, false); } } else { - MEMCLEAR(flow_steps); - size_t num_flow_steps = 0; - - for (size_t i = 0; i < num_summary_steps; i++) { - flow_steps[num_flow_steps++] = &ux_summary_step; - } - - flow_steps[num_flow_steps++] = &ux_approve_step; - flow_steps[num_flow_steps++] = &ux_reject_step; - flow_steps[num_flow_steps++] = FLOW_END_STEP; - - ux_flow_init(0, flow_steps, NULL); + start_sign_tx_ui(num_summary_steps); } } else { THROW(ApduReplySolanaSummaryFinalizeFailed); diff --git a/src/signMessage.h b/src/handle_sign_message.h similarity index 53% rename from src/signMessage.h rename to src/handle_sign_message.h index 40eed74d..57618bb3 100644 --- a/src/signMessage.h +++ b/src/handle_sign_message.h @@ -1,12 +1,5 @@ -#include "os.h" -#include "cx.h" -#include "globals.h" - -#ifndef _SIGN_MESSAGE_H_ -#define _SIGN_MESSAGE_H_ +#pragma once void handle_sign_message_parse_message(volatile unsigned int *tx); void handle_sign_message_ui(volatile unsigned int *flags); - -#endif diff --git a/src/signOffchainMessage.c b/src/handle_sign_offchain_message.c similarity index 64% rename from src/signOffchainMessage.c rename to src/handle_sign_offchain_message.c index ecc3f1bb..1b5a725d 100644 --- a/src/signOffchainMessage.c +++ b/src/handle_sign_offchain_message.c @@ -1,8 +1,7 @@ -#include "getPubkey.h" +#include "io.h" #include "os.h" #include "ux.h" #include "cx.h" -#include "menu.h" #include "utils.h" #include "sol/parser.h" #include "sol/printer.h" @@ -11,6 +10,8 @@ #include "sol/transaction_summary.h" #include "globals.h" #include "apdu.h" +#include "handle_sign_offchain_message.h" +#include "ui_api.h" // Store locally the derived public key content static Pubkey G_publicKey; @@ -19,7 +20,7 @@ static Pubkey G_publicKey; * Checks if data is in UTF-8 format. * Adapted from: https://www.cl.cam.ac.uk/~mgk25/ucs/utf8_check.c */ -bool is_data_utf8(const uint8_t *data, size_t length) { +static bool is_data_utf8(const uint8_t *data, size_t length) { if (!data) { return false; } @@ -79,95 +80,8 @@ static bool is_data_ascii(const uint8_t *data, size_t length) { return true; } -static uint8_t set_result_sign_message() { - uint8_t signature[SIGNATURE_LENGTH]; - cx_ecfp_private_key_t privateKey; - BEGIN_TRY { - TRY { - get_private_key_with_seed(&privateKey, - G_command.derivation_path, - G_command.derivation_path_length); - cx_eddsa_sign(&privateKey, - CX_LAST, - CX_SHA512, - G_command.message, - G_command.message_length, - NULL, - 0, - signature, - SIGNATURE_LENGTH, - NULL); - memcpy(G_io_apdu_buffer, signature, SIGNATURE_LENGTH); - } - CATCH_OTHER(e) { - MEMCLEAR(privateKey); - THROW(e); - } - FINALLY { - MEMCLEAR(privateKey); - } - } - END_TRY; - return SIGNATURE_LENGTH; -} - ////////////////////////////////////////////////////////////////////// -UX_STEP_NOCB(ux_sign_msg_text_step, - bnnn_paging, - { - .title = "Message", - .text = (const char *) G_command.message + OFFCHAIN_MESSAGE_HEADER_LENGTH, - }); -UX_STEP_CB(ux_sign_msg_approve_step, - pb, - sendResponse(set_result_sign_message(), true, true), - { - &C_icon_validate_14, - "Approve", - }); -UX_STEP_CB(ux_sign_msg_reject_step, - pb, - sendResponse(0, false, true), - { - &C_icon_crossmark, - "Reject", - }); -UX_STEP_NOCB_INIT(ux_sign_msg_summary_step, - bnnn_paging, - { - size_t step_index = G_ux.flow_stack[stack_slot].index; - enum DisplayFlags flags = DisplayFlagNone; - if (N_storage.settings.pubkey_display == PubkeyDisplayLong) { - flags |= DisplayFlagLongPubkeys; - } - if (transaction_summary_display_item(step_index, flags)) { - THROW(ApduReplySolanaSummaryUpdateFailed); - } - }, - { - .title = G_transaction_summary_title, - .text = G_transaction_summary_text, - }); - -/* -UX Steps: -- Sign Message - -if expert mode: -- Version -- Format -- Size -- Hash -- Signer -else if utf8: -- Hash - -if ascii: -- message text -*/ -static ux_flow_step_t const *flow_steps[8]; - void handle_sign_offchain_message(volatile unsigned int *flags, volatile unsigned int *tx) { if (!tx || G_command.instruction != InsSignOffchainMessage || G_command.state != ApduStatePayloadComplete) { @@ -233,23 +147,12 @@ void handle_sign_offchain_message(volatile unsigned int *flags, volatile unsigne } enum SummaryItemKind summary_step_kinds[MAX_TRANSACTION_SUMMARY_ITEMS]; - size_t num_flow_steps = 0; size_t num_summary_steps = 0; if (transaction_summary_finalize(summary_step_kinds, &num_summary_steps)) { THROW(ApduReplySolanaSummaryFinalizeFailed); } - for (size_t i = 0; i < num_summary_steps; i++) { - flow_steps[num_flow_steps++] = &ux_sign_msg_summary_step; - } - - if (is_ascii) { - flow_steps[num_flow_steps++] = &ux_sign_msg_text_step; - } - flow_steps[num_flow_steps++] = &ux_sign_msg_approve_step; - flow_steps[num_flow_steps++] = &ux_sign_msg_reject_step; - flow_steps[num_flow_steps++] = FLOW_END_STEP; - ux_flow_init(0, flow_steps, NULL); + start_sign_offchain_message_ui(is_ascii, num_summary_steps); *flags |= IO_ASYNCH_REPLY; } diff --git a/src/signOffchainMessage.h b/src/handle_sign_offchain_message.h similarity index 65% rename from src/signOffchainMessage.h rename to src/handle_sign_offchain_message.h index dbfd23f4..11843430 100644 --- a/src/signOffchainMessage.h +++ b/src/handle_sign_offchain_message.h @@ -1,10 +1,7 @@ +#pragma once + #include "os.h" #include "cx.h" #include "globals.h" -#ifndef _SIGN_OFFCHAIN_MESSAGE_H_ -#define _SIGN_OFFCHAIN_MESSAGE_H_ - void handle_sign_offchain_message(volatile unsigned int *flags, volatile unsigned int *tx); - -#endif diff --git a/src/io.c b/src/io.c new file mode 100644 index 00000000..d320de33 --- /dev/null +++ b/src/io.c @@ -0,0 +1,137 @@ +/***************************************************************************** + * Ledger App Solana. + * (c) 2023 Ledger SAS. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *****************************************************************************/ + +#include +#include + +#include "os.h" +#include "ux.h" + +#ifdef HAVE_NBGL +#include "nbgl_touch.h" +#include "nbgl_page.h" +#endif // HAVE_NBGL + +#include "apdu.h" +#include "ui_api.h" +#include "handle_swap_sign_transaction.h" +#include "io.h" + +#ifdef HAVE_BAGL +// override point, but nothing more to do +void io_seproxyhal_display(const bagl_element_t *element) { + io_seproxyhal_display_default(element); +} +#endif // HAVE_BAGL + +uint8_t io_event(uint8_t channel) { + (void) channel; + + switch (G_io_seproxyhal_spi_buffer[0]) { + case SEPROXYHAL_TAG_BUTTON_PUSH_EVENT: +#ifdef HAVE_BAGL + UX_BUTTON_PUSH_EVENT(G_io_seproxyhal_spi_buffer); +#endif // HAVE_BAGL + break; + case SEPROXYHAL_TAG_STATUS_EVENT: + if (G_io_apdu_media == IO_APDU_MEDIA_USB_HID && // + !(U4BE(G_io_seproxyhal_spi_buffer, 3) & // + SEPROXYHAL_TAG_STATUS_EVENT_FLAG_USB_POWERED)) { + THROW(ApduReplySdkExceptionIoReset); + } + /* fallthrough */ + __attribute__((fallthrough)); + case SEPROXYHAL_TAG_DISPLAY_PROCESSED_EVENT: +#ifdef HAVE_BAGL + UX_DISPLAYED_EVENT({}); +#endif // HAVE_BAGL +#ifdef HAVE_NBGL + UX_DEFAULT_EVENT(); +#endif // HAVE_NBGL + break; +#ifdef HAVE_NBGL + case SEPROXYHAL_TAG_FINGER_EVENT: + UX_FINGER_EVENT(G_io_seproxyhal_spi_buffer); + break; +#endif // HAVE_NBGL + case SEPROXYHAL_TAG_TICKER_EVENT: + UX_TICKER_EVENT(G_io_seproxyhal_spi_buffer, {}); + break; + default: + UX_DEFAULT_EVENT(); + break; + } + + if (!io_seproxyhal_spi_is_status_sent()) { + io_seproxyhal_general_status(); + } + + return 1; +} + +uint16_t io_exchange_al(uint8_t channel, uint16_t tx_len) { + switch (channel & ~(IO_FLAGS)) { + case CHANNEL_KEYBOARD: + break; + + // multiplexed io exchange over a SPI channel and + // TLV encapsulated protocol + case CHANNEL_SPI: + if (tx_len) { + io_seproxyhal_spi_send(G_io_apdu_buffer, tx_len); + + if (channel & IO_RESET_AFTER_REPLIED) { + reset(); + } + return 0; // nothing received from the master so far + // (it's a tx transaction) + } else { + return io_seproxyhal_spi_recv(G_io_apdu_buffer, sizeof(G_io_apdu_buffer), 0); + } + + default: + THROW(ApduReplySdkInvalidParameter); + } + return 0; +} + +static void write_u16_be(uint8_t *ptr, size_t offset, uint16_t value) { + ptr[offset + 0] = (uint8_t) (value >> 8); + ptr[offset + 1] = (uint8_t) (value >> 0); +} + +void sendResponse(uint8_t tx, uint16_t sw, bool display_menu) { + // Write status word + write_u16_be(G_io_apdu_buffer, tx, sw); + tx += 2; + + // Send back the response, do not restart the event loop + io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, tx); + + // If started in swap mode and one TX request has been processed (success or fail), + // we quit the app after sending the status reply + if (G_called_from_swap && G_swap_response_ready) { + PRINTF("Quitting app started in swap mode\n"); + // Quit app, we are in limited mode and our work is done + finalize_exchange_sign_transaction(sw == ApduReplySuccess); + } + + if (display_menu) { + // Display back the original UX + ui_idle(); + } +} diff --git a/src/io.h b/src/io.h new file mode 100644 index 00000000..ced82334 --- /dev/null +++ b/src/io.h @@ -0,0 +1,23 @@ +#pragma once + +#include + +#include "ux.h" +#include "os_io_seproxyhal.h" + +#ifdef HAVE_BAGL +void io_seproxyhal_display(const bagl_element_t *element); +#endif // HAVE_BAGL + +/** + * IO callback called when an interrupt based channel has received + * data to be processed. + * + * @return 1 if success, 0 otherwise. + * + */ +uint8_t io_event(uint8_t channel); + +uint16_t io_exchange_al(uint8_t channel, uint16_t tx_len); + +void sendResponse(uint8_t tx, uint16_t sw, bool display_menu); diff --git a/src/main.c b/src/main.c index 82341491..ba88e23f 100644 --- a/src/main.c +++ b/src/main.c @@ -16,11 +16,11 @@ ********************************************************************************/ #include "utils.h" -#include "getPubkey.h" -#include "signMessage.h" -#include "signOffchainMessage.h" +#include "handle_get_pubkey.h" +#include "handle_sign_message.h" +#include "handle_sign_offchain_message.h" #include "apdu.h" -#include "menu.h" +#include "ui_api.h" // Swap feature #include "swap_lib_calls.h" @@ -28,6 +28,10 @@ #include "handle_get_printable_amount.h" #include "handle_check_address.h" +#ifdef HAVE_NBGL +#include "nbgl_use_case.h" +#endif + ApduCommand G_command; unsigned char G_io_seproxyhal_spi_buffer[IO_SEPROXYHAL_BUFFER_SIZE_B]; volatile bool G_called_from_swap; @@ -114,12 +118,6 @@ void app_main(void) { rx = io_exchange(CHANNEL_APDU | flags, rx); flags = 0; - if (G_called_from_swap && G_swap_response_ready) { - PRINTF("Quitting app started in swap mode\n"); - // Quit app, we are in limited mode and our work is done - os_sched_exit(0); - } - // no apdu received, well, reset the session, and reset the // bootloader configuration if (rx == 0) { @@ -162,93 +160,6 @@ void app_main(void) { } } -// override point, but nothing more to do -void io_seproxyhal_display(const bagl_element_t *element) { - io_seproxyhal_display_default((bagl_element_t *) element); -} - -unsigned char io_event(unsigned char channel) { - UNUSED(channel); - - // nothing done with the event, throw an error on the transport layer if - // needed - - // can't have more than one tag in the reply, not supported yet. - switch (G_io_seproxyhal_spi_buffer[0]) { - case SEPROXYHAL_TAG_FINGER_EVENT: - UX_FINGER_EVENT(G_io_seproxyhal_spi_buffer); - break; - - case SEPROXYHAL_TAG_BUTTON_PUSH_EVENT: - UX_BUTTON_PUSH_EVENT(G_io_seproxyhal_spi_buffer); - break; - - case SEPROXYHAL_TAG_STATUS_EVENT: - if (G_io_apdu_media == IO_APDU_MEDIA_USB_HID && - !(U4BE(G_io_seproxyhal_spi_buffer, 3) & - SEPROXYHAL_TAG_STATUS_EVENT_FLAG_USB_POWERED)) { - THROW(ApduReplySdkExceptionIoReset); - } - // no break is intentional - default: - UX_DEFAULT_EVENT(); - break; - - case SEPROXYHAL_TAG_DISPLAY_PROCESSED_EVENT: - UX_DISPLAYED_EVENT({}); - break; - - case SEPROXYHAL_TAG_TICKER_EVENT: - UX_TICKER_EVENT(G_io_seproxyhal_spi_buffer, { -#if !defined(TARGET_NANOX) && !defined(TARGET_NANOS2) - if (UX_ALLOWED) { - if (ux_step_count) { - // prepare next screen - ux_step = (ux_step + 1) % ux_step_count; - // redisplay screen - UX_REDISPLAY(); - } - } -#endif // TARGET_NANOX - }); - break; - } - - // close the event if not done previously (by a display or whatever) - if (!io_seproxyhal_spi_is_status_sent()) { - io_seproxyhal_general_status(); - } - - // command has been processed, DO NOT reset the current APDU transport - return 1; -} - -unsigned short io_exchange_al(unsigned char channel, unsigned short tx_len) { - switch (channel & ~(IO_FLAGS)) { - case CHANNEL_KEYBOARD: - break; - - // multiplexed io exchange over a SPI channel and - // TLV encapsulated protocol - case CHANNEL_SPI: - if (tx_len) { - io_seproxyhal_spi_send(G_io_apdu_buffer, tx_len); - - if (channel & IO_RESET_AFTER_REPLIED) { - reset(); - } - return 0; // nothing received from the master so far - // (it's a tx transaction) - } else { - return io_seproxyhal_spi_recv(G_io_apdu_buffer, sizeof(G_io_apdu_buffer), 0); - } - - default: - THROW(ApduReplySdkInvalidParameter); - } - return 0; -} - void app_exit(void) { BEGIN_TRY_L(exit) { TRY_L(exit) { @@ -264,7 +175,7 @@ void nv_app_state_init() { if (N_storage.initialized != 0x01) { internalStorage_t storage; storage.settings.allow_blind_sign = BlindSignDisabled; -#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) +#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) storage.settings.pubkey_display = PubkeyDisplayLong; #else storage.settings.pubkey_display = PubkeyDisplayShort; @@ -299,7 +210,7 @@ void coin_main(void) { #ifdef HAVE_BLE BLE_power(0, NULL); - BLE_power(1, "Nano X"); + BLE_power(1, NULL); #endif // HAVE_BLE app_main(); @@ -323,6 +234,9 @@ static void start_app_from_lib(void) { G_called_from_swap = true; G_swap_response_ready = false; UX_INIT(); +#ifdef HAVE_NBGL + nbgl_useCaseSpinner("Signing"); +#endif // HAVE_BAGL io_seproxyhal_init(); nv_app_state_init(); USB_power(0); @@ -333,13 +247,12 @@ static void start_app_from_lib(void) { // grab the current plane mode setting G_io_app.plane_mode = os_setting_get(OS_SETTING_PLANEMODE, NULL, 0); BLE_power(0, NULL); - BLE_power(1, "Nano X"); + BLE_power(1, NULL); #endif // HAVE_BLE app_main(); } static void library_main_helper(libargs_t *args) { - check_api_level(CX_COMPAT_APILEVEL); switch (args->command) { case CHECK_ADDRESS: // ensure result is zero if an exception is thrown diff --git a/src/menu.h b/src/menu.h deleted file mode 100644 index f313846f..00000000 --- a/src/menu.h +++ /dev/null @@ -1,9 +0,0 @@ -#include "globals.h" -#include "glyphs.h" - -#ifndef _MENU_H_ -#define _MENU_H_ - -void ui_idle(void); - -#endif diff --git a/src/swap/handle_get_printable_amount.c b/src/swap/handle_get_printable_amount.c index 7cf1a9ff..c721081b 100644 --- a/src/swap/handle_get_printable_amount.c +++ b/src/swap/handle_get_printable_amount.c @@ -1,5 +1,6 @@ #include "handle_get_printable_amount.h" #include "swap_lib_calls.h" +#include "swap_utils.h" #include "utils.h" #include "sol/printer.h" diff --git a/src/swap/handle_swap_sign_transaction.c b/src/swap/handle_swap_sign_transaction.c index c90db59c..7575ee13 100644 --- a/src/swap/handle_swap_sign_transaction.c +++ b/src/swap/handle_swap_sign_transaction.c @@ -2,6 +2,7 @@ #include "utils.h" #include "os.h" #include "swap_lib_calls.h" +#include "swap_utils.h" #include "sol/printer.h" typedef struct swap_validated_s { @@ -12,8 +13,11 @@ typedef struct swap_validated_s { static swap_validated_t G_swap_validated; +// Save the BSS address where we will write the return value when finished +static uint8_t *G_swap_sign_return_value_address; + // Save the data validated during the Exchange app flow -bool copy_transaction_parameters(const create_transaction_parameters_t *params) { +bool copy_transaction_parameters(create_transaction_parameters_t *params) { // Ensure no subcoin configuration if (params->coin_configuration != NULL || params->coin_configuration_length != 0) { PRINTF("No coin_configuration expected\n"); @@ -51,8 +55,13 @@ bool copy_transaction_parameters(const create_transaction_parameters_t *params) swap_validated.initialized = true; + // Full reset the global variables os_explicit_zero_BSS_segment(); - // Commit from stack to global data, params becomes tainted but we won't access it anymore + + // Keep the address at which we'll reply the signing status + G_swap_sign_return_value_address = ¶ms->result; + + // Commit the values read from exchange to the clean global space memcpy(&G_swap_validated, &swap_validated, sizeof(swap_validated)); return true; } @@ -102,3 +111,8 @@ bool check_swap_recipient(const char *title, const char *text) { return false; } } + +void __attribute__((noreturn)) finalize_exchange_sign_transaction(bool is_success) { + *G_swap_sign_return_value_address = is_success; + os_lib_end(); +} diff --git a/src/swap/handle_swap_sign_transaction.h b/src/swap/handle_swap_sign_transaction.h index 60358c0f..06fbbfe4 100644 --- a/src/swap/handle_swap_sign_transaction.h +++ b/src/swap/handle_swap_sign_transaction.h @@ -2,7 +2,10 @@ #include "swap_lib_calls.h" -bool copy_transaction_parameters(const create_transaction_parameters_t *sign_transaction_params); +bool copy_transaction_parameters(create_transaction_parameters_t *sign_transaction_params); bool check_swap_amount(const char *title, const char *text); + bool check_swap_recipient(const char *title, const char *text); + +void __attribute__((noreturn)) finalize_exchange_sign_transaction(bool is_success); diff --git a/src/swap/swap_lib_calls.h b/src/swap/swap_lib_calls.h index 27a4436a..213d8b21 100644 --- a/src/swap/swap_lib_calls.h +++ b/src/swap/swap_lib_calls.h @@ -1,8 +1,13 @@ #pragma once -#include -#include -#include +/* This file is the shared API between Exchange and the apps started in Library mode for Exchange + * + * DO NOT MODIFY THIS FILE IN APPLICATIONS OTHER THAN EXCHANGE + * On modification in Exchange, forward the changes to all applications supporting Exchange + */ + +#include "stdbool.h" +#include "stdint.h" #define RUN_APPLICATION 1 @@ -25,12 +30,12 @@ // structure that should be send to specific coin application to get address typedef struct check_address_parameters_s { // IN - unsigned char *coin_configuration; - unsigned char coin_configuration_length; + uint8_t *coin_configuration; + uint8_t coin_configuration_length; // serialized path, segwit, version prefix, hash used, dictionary etc. // fields and serialization format depends on specific coin app - unsigned char *address_parameters; - unsigned char address_parameters_length; + uint8_t *address_parameters; + uint8_t address_parameters_length; char *address_to_check; char *extra_id_to_check; // OUT @@ -40,28 +45,29 @@ typedef struct check_address_parameters_s { // structure that should be send to specific coin application to get printable amount typedef struct get_printable_amount_parameters_s { // IN - unsigned char *coin_configuration; - unsigned char coin_configuration_length; - unsigned char *amount; - unsigned char amount_length; + uint8_t *coin_configuration; + uint8_t coin_configuration_length; + uint8_t *amount; + uint8_t amount_length; bool is_fee; // OUT char printable_amount[MAX_PRINTABLE_AMOUNT_SIZE]; } get_printable_amount_parameters_t; typedef struct create_transaction_parameters_s { - unsigned char *coin_configuration; - unsigned char coin_configuration_length; - unsigned char *amount; - unsigned char amount_length; - unsigned char *fee_amount; - unsigned char fee_amount_length; + // IN + uint8_t *coin_configuration; + uint8_t coin_configuration_length; + uint8_t *amount; + uint8_t amount_length; + uint8_t *fee_amount; + uint8_t fee_amount_length; char *destination_address; char *destination_address_extra_id; + // OUT + uint8_t result; } create_transaction_parameters_t; -bool swap_str_to_u64(const uint8_t *src, size_t length, uint64_t *result); - typedef struct libargs_s { unsigned int id; unsigned int command; diff --git a/src/swap/swap_lib_calls.c b/src/swap/swap_utils.c similarity index 91% rename from src/swap/swap_lib_calls.c rename to src/swap/swap_utils.c index 009a9bc5..ac2f6cd0 100644 --- a/src/swap/swap_lib_calls.c +++ b/src/swap/swap_utils.c @@ -1,6 +1,6 @@ #include -#include "swap_lib_calls.h" +#include "swap_utils.h" bool swap_str_to_u64(const uint8_t* src, size_t length, uint64_t* result) { if (length > sizeof(uint64_t)) { diff --git a/src/swap/swap_utils.h b/src/swap/swap_utils.h new file mode 100644 index 00000000..5f25201e --- /dev/null +++ b/src/swap/swap_utils.h @@ -0,0 +1,7 @@ +#pragma once + +#include "stdint.h" +#include "stddef.h" +#include "stdbool.h" + +bool swap_str_to_u64(const uint8_t* src, size_t length, uint64_t* result); diff --git a/src/ui/get_pubkey_bagl.c b/src/ui/get_pubkey_bagl.c new file mode 100644 index 00000000..9e2d978e --- /dev/null +++ b/src/ui/get_pubkey_bagl.c @@ -0,0 +1,56 @@ + +/***************************************************************************** + * Ledger App Solana + * (c) 2023 Ledger SAS. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *****************************************************************************/ + +#ifdef HAVE_BAGL + +#include "handle_get_pubkey.h" +#include "apdu.h" +#include "io.h" +#include "ux.h" + +UX_STEP_NOCB(ux_display_public_flow_5_step, + bnnn_paging, + { + .title = "Pubkey", + .text = G_publicKeyStr, + }); +UX_STEP_CB(ux_display_public_flow_6_step, + pb, + sendResponse(set_result_get_pubkey(), ApduReplySuccess, true), + { + &C_icon_validate_14, + "Approve", + }); +UX_STEP_CB(ux_display_public_flow_7_step, + pb, + sendResponse(0, ApduReplyUserRefusal, true), + { + &C_icon_crossmark, + "Reject", + }); + +UX_FLOW(ux_display_public_flow, + &ux_display_public_flow_5_step, + &ux_display_public_flow_6_step, + &ux_display_public_flow_7_step); + +void ui_get_public_key(void) { + ux_flow_init(0, ux_display_public_flow, NULL); +} + +#endif diff --git a/src/ui/get_pubkey_nbgl.c b/src/ui/get_pubkey_nbgl.c new file mode 100644 index 00000000..8c8f3490 --- /dev/null +++ b/src/ui/get_pubkey_nbgl.c @@ -0,0 +1,61 @@ + +/***************************************************************************** + * Ledger App Solana + * (c) 2023 Ledger SAS. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *****************************************************************************/ + +#ifdef HAVE_NBGL + +#include "handle_get_pubkey.h" +#include "io.h" +#include "sol/printer.h" +#include "nbgl_use_case.h" +#include "ui_api.h" +#include "apdu.h" + +static void confirm_address_approval(void) { + // display a success status page and go back to main + sendResponse(set_result_get_pubkey(), ApduReplySuccess, false); + nbgl_useCaseStatus("ADDRESS\nVERIFIED", true, ui_idle); +} + +static void confirm_address_rejection(void) { + // display a status page and go back to main + sendResponse(0, ApduReplyUserRefusal, false); + nbgl_useCaseStatus("Address verification\ncancelled", false, ui_idle); +} + +static void review_choice(bool confirm) { + if (confirm) { + confirm_address_approval(); + } else { + confirm_address_rejection(); + } +} + +static void continue_review(void) { + nbgl_useCaseAddressConfirmation(G_publicKeyStr, review_choice); +} + +void ui_get_public_key(void) { + nbgl_useCaseReviewStart(&C_icon_solana_64x64, + "Verify Solana\naddress", + NULL, + "Cancel", + continue_review, + confirm_address_rejection); +} + +#endif diff --git a/src/menu.c b/src/ui/menu_bagl.c similarity index 90% rename from src/menu.c rename to src/ui/menu_bagl.c index 7c148e53..45e32b63 100644 --- a/src/menu.c +++ b/src/ui/menu_bagl.c @@ -1,13 +1,18 @@ -#include "menu.h" +#ifdef HAVE_BAGL + +#include "ux.h" #include "os.h" +#include "globals.h" +#include "glyphs.h" +#include "ui_api.h" void display_settings(void); void switch_allow_blind_sign_data(void); void switch_pubkey_display_data(void); ////////////////////////////////////////////////////////////////////// -const char* settings_submenu_getter(unsigned int idx); -void settings_submenu_selector(unsigned int idx); +static const char* settings_submenu_getter(unsigned int idx); +static void settings_submenu_selector(unsigned int idx); static const char* allow_blind_sign_data_getter(unsigned int idx); static void allow_blind_sign_data_selector(unsigned int idx); static const char* pubkey_display_data_getter(unsigned int idx); @@ -26,7 +31,7 @@ enum SettingsMenuOption { SettingsMenuOptionBack }; -unsigned int settings_submenu_option_index(enum SettingsMenuOption settings_menu_option) { +static unsigned int settings_submenu_option_index(enum SettingsMenuOption settings_menu_option) { switch (settings_menu_option) { case SettingsMenuOptionAllowBlindSign: case SettingsMenuOptionPubkeyLength: @@ -45,14 +50,14 @@ const char* const settings_submenu_getter_values[] = { "Back", }; -const char* settings_submenu_getter(unsigned int idx) { +static const char* settings_submenu_getter(unsigned int idx) { if (idx < ARRAYLEN(settings_submenu_getter_values)) { return settings_submenu_getter_values[idx]; } return NULL; } -void settings_submenu_selector(unsigned int idx) { +static void settings_submenu_selector(unsigned int idx) { switch (idx) { case 0: ux_menulist_init_select(0, @@ -100,7 +105,7 @@ static const char* allow_blind_sign_data_getter(unsigned int idx) { return NULL; } -void allow_blind_sign_data_selector(unsigned int idx) { +static void allow_blind_sign_data_selector(unsigned int idx) { switch (idx) { case 0: allow_blind_sign_data_change(BlindSignDisabled); @@ -118,7 +123,7 @@ void allow_blind_sign_data_selector(unsigned int idx) { ////////////////////////////////////////////////////////////////////////////////////// // Pubkey display submenu -void pubkey_display_data_change(enum PubkeyDisplay pubkey_display) { +static void pubkey_display_data_change(enum PubkeyDisplay pubkey_display) { uint8_t value; switch (pubkey_display) { case PubkeyDisplayLong: @@ -156,7 +161,7 @@ static void pubkey_display_data_selector(unsigned int idx) { ////////////////////////////////////////////////////////////////////////////////////// // Display mode submenu -void display_mode_data_change(enum DisplayMode display_mode) { +static void display_mode_data_change(enum DisplayMode display_mode) { uint8_t value; switch (display_mode) { case DisplayModeUser: @@ -192,10 +197,11 @@ static void display_mode_data_selector(unsigned int idx) { } ////////////////////////////////////////////////////////////////////// + UX_STEP_NOCB(ux_idle_flow_1_step, pnn, { - &C_solana_logo, + &C_icon_solana_16x16, "Application", "is ready", }); @@ -226,6 +232,8 @@ UX_FLOW(ux_idle_flow, &ux_idle_flow_4_step, FLOW_LOOP); +////////////////////////////////////////////////////////////////////// + void ui_idle(void) { // reserve a display stack slot if none yet if (G_ux.stack_count == 0) { @@ -233,3 +241,5 @@ void ui_idle(void) { } ux_flow_init(0, ux_idle_flow, NULL); } + +#endif diff --git a/src/ui/menu_nbgl.c b/src/ui/menu_nbgl.c new file mode 100644 index 00000000..a0f2d84c --- /dev/null +++ b/src/ui/menu_nbgl.c @@ -0,0 +1,145 @@ + +/***************************************************************************** + * Ledger App Solana + * (c) 2023 Ledger SAS. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *****************************************************************************/ + +#ifdef HAVE_NBGL + +#include "os.h" +#include "glyphs.h" +#include "nbgl_use_case.h" +#include "ui_api.h" +#include "utils.h" + +static void quit_app_callback(void) { + os_sched_exit(-1); +} + +static const char* const info_types[] = {"Version", "Developer"}; +static const char* const info_contents[] = {APPVERSION, "Ledger"}; + +enum { + BLIND_SIGNING_IDX = 0, + PUBLIC_KEY_LENGTH_IDX, + DISPLAY_MODE_IDX, + NB_SETTINGS, +}; +static nbgl_layoutSwitch_t G_switches[NB_SETTINGS]; + +enum { + BLIND_SIGNING_TOKEN = FIRST_USER_TOKEN, + PUBLIC_KEY_LENGTH_TOKEN, + DISPLAY_MODE_TOKEN, +}; + +#define SETTINGS_PAGE_NUMBER 2 +static bool settings_nav_callback(uint8_t page, nbgl_pageContent_t* content) { + if (page == 0) { + content->type = INFOS_LIST; + content->infosList.nbInfos = ARRAY_COUNT(info_types); + content->infosList.infoTypes = info_types; + content->infosList.infoContents = info_contents; + } else if (page == 1) { + // Read again the NVM as the value might have changed following a user touch + if (N_storage.settings.allow_blind_sign == BlindSignDisabled) { + G_switches[BLIND_SIGNING_IDX].initState = OFF_STATE; + } else { + G_switches[BLIND_SIGNING_IDX].initState = ON_STATE; + } + if (N_storage.settings.pubkey_display == PubkeyDisplayLong) { + G_switches[PUBLIC_KEY_LENGTH_IDX].initState = OFF_STATE; + } else { + G_switches[PUBLIC_KEY_LENGTH_IDX].initState = ON_STATE; + } + if (N_storage.settings.display_mode == DisplayModeUser) { + G_switches[DISPLAY_MODE_IDX].initState = OFF_STATE; + } else { + G_switches[DISPLAY_MODE_IDX].initState = ON_STATE; + } + content->type = SWITCHES_LIST; + content->switchesList.nbSwitches = NB_SETTINGS; + content->switchesList.switches = G_switches; + } else { + return false; + } + + return true; +} + +static void settings_controls_callback(int token, uint8_t index) { + UNUSED(index); + uint8_t new_setting; + switch (token) { + case BLIND_SIGNING_TOKEN: + // Write in NVM the opposit of what the current toggle is + new_setting = (G_switches[BLIND_SIGNING_IDX].initState != ON_STATE); + nvm_write((void*) &N_storage.settings.allow_blind_sign, + &new_setting, + sizeof(new_setting)); + break; + case PUBLIC_KEY_LENGTH_TOKEN: + // Write in NVM the opposit of what the current toggle is + new_setting = (G_switches[PUBLIC_KEY_LENGTH_IDX].initState != ON_STATE); + nvm_write((void*) &N_storage.settings.pubkey_display, + &new_setting, + sizeof(new_setting)); + break; + case DISPLAY_MODE_TOKEN: + // Write in NVM the opposit of what the current toggle is + new_setting = (G_switches[DISPLAY_MODE_IDX].initState != ON_STATE); + nvm_write((void*) &N_storage.settings.display_mode, &new_setting, sizeof(new_setting)); + break; + default: + PRINTF("Unreachable\n"); + break; + } +} + +static void ui_menu_settings(void) { + G_switches[BLIND_SIGNING_IDX].text = "Blind signing"; + G_switches[BLIND_SIGNING_IDX].subText = "Enable blind signing"; + G_switches[BLIND_SIGNING_IDX].token = BLIND_SIGNING_TOKEN; + G_switches[BLIND_SIGNING_IDX].tuneId = TUNE_TAP_CASUAL; + + G_switches[PUBLIC_KEY_LENGTH_IDX].text = "Public key length"; + G_switches[PUBLIC_KEY_LENGTH_IDX].subText = "Display short public keys"; + G_switches[PUBLIC_KEY_LENGTH_IDX].token = PUBLIC_KEY_LENGTH_TOKEN; + G_switches[PUBLIC_KEY_LENGTH_IDX].tuneId = TUNE_TAP_CASUAL; + + G_switches[DISPLAY_MODE_IDX].text = "Display mode"; + G_switches[DISPLAY_MODE_IDX].subText = "Use Expert display mode"; + G_switches[DISPLAY_MODE_IDX].token = DISPLAY_MODE_TOKEN; + G_switches[DISPLAY_MODE_IDX].tuneId = TUNE_TAP_CASUAL; + + nbgl_useCaseSettings(APPNAME " settings", + 0, + SETTINGS_PAGE_NUMBER, + false, + ui_idle, + settings_nav_callback, + settings_controls_callback); +} + +void ui_idle(void) { + nbgl_useCaseHome(APPNAME, + &C_icon_solana_64x64, + NULL, + true, + ui_menu_settings, + quit_app_callback); +} + +#endif diff --git a/src/ui/sign_message_bagl.c b/src/ui/sign_message_bagl.c new file mode 100644 index 00000000..22e81a39 --- /dev/null +++ b/src/ui/sign_message_bagl.c @@ -0,0 +1,116 @@ +#ifdef HAVE_BAGL + +#include "io.h" +#include "utils.h" +#include "sol/parser.h" +#include "sol/printer.h" +#include "sol/print_config.h" +#include "sol/message.h" +#include "sol/transaction_summary.h" +#include "apdu.h" + +#include "handle_sign_message.h" + +// Display offchain message screen +UX_STEP_NOCB(ux_sign_msg_text_step, + bnnn_paging, + { + .title = "Message", + .text = (const char *) G_command.message + OFFCHAIN_MESSAGE_HEADER_LENGTH, + }); + +// Display dynamic transaction item screen +UX_STEP_NOCB_INIT(ux_summary_step, + bnnn_paging, + { + size_t step_index = G_ux.flow_stack[stack_slot].index; + enum DisplayFlags flags = DisplayFlagNone; + if (N_storage.settings.pubkey_display == PubkeyDisplayLong) { + flags |= DisplayFlagLongPubkeys; + } + if (transaction_summary_display_item(step_index, flags)) { + THROW(ApduReplySolanaSummaryUpdateFailed); + } + }, + { + .title = G_transaction_summary_title, + .text = G_transaction_summary_text, + }); + +// Approve and sign screen +UX_STEP_CB(ux_approve_step, + pb, + sendResponse(set_result_sign_message(), ApduReplySuccess, true), + { + &C_icon_validate_14, + "Approve", + }); + +// Reject signature screen +UX_STEP_CB(ux_reject_step, + pb, + sendResponse(0, ApduReplyUserRefusal, true), + { + &C_icon_crossmark, + "Reject", + }); + +#define MAX_FLOW_STEPS_ONCHAIN \ + (MAX_TRANSACTION_SUMMARY_ITEMS + 1 /* approve */ \ + + 1 /* reject */ \ + + 1 /* FLOW_END_STEP */ \ + ) +/* +OFFCHAIN UX Steps: +- Sign Message + +if expert mode: +- Version +- Format +- Size +- Hash +- Signer +else if utf8: +- Hash + +if ascii: +- message text +*/ +#define MAX_FLOW_STEPS_OFFCHAIN \ + (7 + 1 /* approve */ \ + + 1 /* reject */ \ + + 1 /* FLOW_END_STEP */ \ + ) +static ux_flow_step_t const *flow_steps[MAX(MAX_FLOW_STEPS_ONCHAIN, MAX_FLOW_STEPS_OFFCHAIN)]; + +void start_sign_tx_ui(size_t num_summary_steps) { + MEMCLEAR(flow_steps); + size_t num_flow_steps = 0; + for (size_t i = 0; i < num_summary_steps; i++) { + flow_steps[num_flow_steps++] = &ux_summary_step; + } + + flow_steps[num_flow_steps++] = &ux_approve_step; + flow_steps[num_flow_steps++] = &ux_reject_step; + flow_steps[num_flow_steps++] = FLOW_END_STEP; + + ux_flow_init(0, flow_steps, NULL); +} + +void start_sign_offchain_message_ui(bool is_ascii, size_t num_summary_steps) { + MEMCLEAR(flow_steps); + size_t num_flow_steps = 0; + for (size_t i = 0; i < num_summary_steps; i++) { + flow_steps[num_flow_steps++] = &ux_summary_step; + } + if (is_ascii) { + flow_steps[num_flow_steps++] = &ux_sign_msg_text_step; + } + flow_steps[num_flow_steps++] = &ux_approve_step; + flow_steps[num_flow_steps++] = &ux_reject_step; + flow_steps[num_flow_steps++] = FLOW_END_STEP; + + ux_flow_init(0, flow_steps, NULL); +} + +#endif diff --git a/src/ui/sign_message_nbgl.c b/src/ui/sign_message_nbgl.c new file mode 100644 index 00000000..e4adfa2c --- /dev/null +++ b/src/ui/sign_message_nbgl.c @@ -0,0 +1,181 @@ +#ifdef HAVE_NBGL + +#include "io.h" +#include "sol/parser.h" +#include "sol/printer.h" +#include "sol/print_config.h" +#include "sol/message.h" +#include "sol/transaction_summary.h" +#include "glyphs.h" +#include "apdu.h" +#include "utils.h" +#include "ui_api.h" + +#include "nbgl_page.h" +#include "nbgl_use_case.h" + +#include "handle_sign_message.h" +#include "handle_sign_offchain_message.h" + +// Layout of the review flow +static nbgl_layoutTagValueList_t layout; +// Used by NBGL to display the reference the pair number N +static nbgl_layoutTagValue_t current_pair; + +// We will display at most 4 items on a Stax review screen +#define MAX_SIMULTANEOUS_DISPLAYED_SLOTS NB_MAX_DISPLAYED_PAIRS_IN_REVIEW +typedef struct dynamic_slot_s { + char title[sizeof(G_transaction_summary_title)]; + char text[sizeof(G_transaction_summary_text)]; +} dynamic_slot_t; +static dynamic_slot_t displayed_slots[MAX_SIMULTANEOUS_DISPLAYED_SLOTS]; + +// Final review screen of the message signing flow +static nbgl_pageInfoLongPress_t review_final_long_press; + +static const char reject_choice_message[] = "Message\nrejected"; +static const char reject_choice_transaction[] = "Transaction\nrejected"; +static const char *reject_choice_text; + +static const char go_back_message[] = "Go back to message"; +static const char go_back_transaction[] = "Go back to transaction"; +static const char *go_back_text; + +static const char option_reject_message[] = "Reject message"; +static const char option_reject_transaction[] = "Reject transaction"; +static const char *option_reject_text; + +static const char ask_reject_message[] = "Reject message?"; +static const char ask_reject_transaction[] = "Reject transaction?"; +static const char *ask_reject_text; + +static const char success_message[] = "MESSAGE\nSIGNED"; +static const char success_transaction[] = "TRANSACTION\nSIGNED"; +static const char *success_text; + +// Callback called when the user confirms the message rejection +static void rejectChoice(void) { + sendResponse(0, ApduReplyUserRefusal, false); + nbgl_useCaseStatus(reject_choice_text, false, ui_idle); +} + +// If the user asks for message rejection, ask for confirmation +static void rejectUseCaseChoice(void) { + nbgl_useCaseConfirm(ask_reject_text, NULL, "Yes, reject", go_back_text, rejectChoice); +} + +// Callback called on the final review screen +static void review_final_callback(bool confirmed) { + if (confirmed) { + sendResponse(set_result_sign_message(), ApduReplySuccess, false); + nbgl_useCaseStatus(success_text, true, ui_idle); + } else { + rejectUseCaseChoice(); + } +} + +// NBGL library has to know how many steps will be displayed +static size_t transaction_steps_number; +static bool last_step_is_ascii; + +// function called by NBGL to get the current_pair indexed by "index" +// current_pair will point at values stored in displayed_slots[] +// this will enable displaying at most sizeof(displayed_slots) values simultaneously +static nbgl_layoutTagValue_t *get_single_action_review_pair(uint8_t index) { + uint8_t slot = index % ARRAY_COUNT(displayed_slots); + // Final step is special for ASCII messages + if (index == transaction_steps_number - 1 && last_step_is_ascii) { + strlcpy(displayed_slots[slot].title, "Message", sizeof(displayed_slots[slot].title)); + strlcpy(displayed_slots[slot].text, + (const char *) G_command.message + OFFCHAIN_MESSAGE_HEADER_LENGTH, + sizeof(displayed_slots[slot].text)); + } else { + enum DisplayFlags flags = DisplayFlagNone; + if (N_storage.settings.pubkey_display == PubkeyDisplayLong) { + flags |= DisplayFlagLongPubkeys; + } + if (transaction_summary_display_item(index, flags)) { + THROW(ApduReplySolanaSummaryUpdateFailed); + } + memcpy(&displayed_slots[slot].title, + &G_transaction_summary_title, + sizeof(displayed_slots[slot].title)); + memcpy(&displayed_slots[slot].text, + &G_transaction_summary_text, + sizeof(displayed_slots[slot].text)); + } + current_pair.item = displayed_slots[slot].title; + current_pair.value = displayed_slots[slot].text; + return ¤t_pair; +} + +// Prepare the review layout structure and starts the review use_case +static void start_review(void) { + layout.nbMaxLinesForValue = 0; + layout.smallCaseForValue = false; + layout.wrapping = true; + layout.pairs = NULL; // to indicate that callback should be used + layout.callback = get_single_action_review_pair; + layout.startIndex = 0; + layout.nbPairs = transaction_steps_number; + + nbgl_useCaseStaticReview(&layout, + &review_final_long_press, + option_reject_text, + review_final_callback); +} + +void start_sign_tx_ui(size_t num_summary_steps) { + review_final_long_press.text = "Sign transaction on\nSolana network?"; + review_final_long_press.icon = &C_icon_solana_64x64; + review_final_long_press.longPressText = "Hold to sign"; + review_final_long_press.longPressToken = 0; + review_final_long_press.tuneId = TUNE_TAP_CASUAL; + + reject_choice_text = reject_choice_transaction; + go_back_text = go_back_transaction; + ask_reject_text = ask_reject_transaction; + success_text = success_transaction; + option_reject_text = option_reject_transaction; + + // Save steps number for later + transaction_steps_number = num_summary_steps; + last_step_is_ascii = false; + // start display + nbgl_useCaseReviewStart(&C_icon_solana_64x64, + "Review transaction", + NULL, + "Reject transaction", + start_review, + rejectUseCaseChoice); +} + +void start_sign_offchain_message_ui(bool is_ascii, size_t num_summary_steps) { + review_final_long_press.text = "Sign Off-Chain\nmessage on Solana\nnetwork?"; + review_final_long_press.icon = &C_icon_solana_64x64; + review_final_long_press.longPressText = "Hold to sign"; + review_final_long_press.longPressToken = 0; + review_final_long_press.tuneId = TUNE_TAP_CASUAL; + + reject_choice_text = reject_choice_message; + go_back_text = go_back_message; + ask_reject_text = ask_reject_message; + success_text = success_message; + option_reject_text = option_reject_message; + + // Save steps number for later + transaction_steps_number = num_summary_steps; + last_step_is_ascii = is_ascii; + if (is_ascii) { + ++transaction_steps_number; + } + // start display + nbgl_useCaseReviewStart(&C_icon_solana_64x64, + "Review off-chain\nmessage", + NULL, + "Reject message", + start_review, + rejectUseCaseChoice); +} + +#endif diff --git a/src/ui/ui_api.h b/src/ui/ui_api.h new file mode 100644 index 00000000..0c5cc054 --- /dev/null +++ b/src/ui/ui_api.h @@ -0,0 +1,11 @@ +#pragma once + +#include "os.h" + +void ui_idle(void); + +void ui_get_public_key(void); + +void start_sign_tx_ui(size_t num_summary_steps); + +void start_sign_offchain_message_ui(bool is_ascii, size_t num_summary_steps); diff --git a/src/utils.c b/src/utils.c index 91083309..234bcd04 100644 --- a/src/utils.c +++ b/src/utils.c @@ -2,100 +2,39 @@ #include "cx.h" #include #include + +#include "lib_standard_app/crypto_helpers.h" + #include "utils.h" -#include "menu.h" -void get_public_key(uint8_t *publicKeyArray, const uint32_t *derivationPath, size_t pathLength) { - cx_ecfp_private_key_t privateKey; - cx_ecfp_public_key_t publicKey; +void get_public_key(uint8_t publicKeyArray[static PUBKEY_LENGTH], + const uint32_t *derivationPath, + size_t pathLength) { + uint8_t rawPubkey[65]; + cx_err_t cx_err; - get_private_key(&privateKey, derivationPath, pathLength); - BEGIN_TRY { - TRY { - cx_ecfp_generate_pair(CX_CURVE_Ed25519, &publicKey, &privateKey, 1); - } - CATCH_OTHER(e) { - MEMCLEAR(privateKey); - THROW(e); - } - FINALLY { - MEMCLEAR(privateKey); - } + cx_err = bip32_derive_with_seed_get_pubkey_256(HDW_ED25519_SLIP10, + CX_CURVE_Ed25519, + derivationPath, + pathLength, + rawPubkey, + NULL, + CX_SHA512, + NULL, + 0); + + if (CX_OK != cx_err) { + THROW(cx_err); } - END_TRY; for (int i = 0; i < PUBKEY_LENGTH; i++) { - publicKeyArray[i] = publicKey.W[PUBKEY_LENGTH + PRIVATEKEY_LENGTH - i]; + publicKeyArray[i] = rawPubkey[PUBKEY_LENGTH + PRIVATEKEY_LENGTH - i]; } - if ((publicKey.W[PUBKEY_LENGTH] & 1) != 0) { + if ((rawPubkey[PUBKEY_LENGTH] & 1) != 0) { publicKeyArray[PUBKEY_LENGTH - 1] |= 0x80; } } -uint32_t readUint32BE(uint8_t *buffer) { - return ((buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | (buffer[3])); -} - -void get_private_key(cx_ecfp_private_key_t *privateKey, - const uint32_t *derivationPath, - size_t pathLength) { - uint8_t privateKeyData[PRIVATEKEY_LENGTH]; - BEGIN_TRY { - TRY { - os_perso_derive_node_bip32_seed_key(HDW_ED25519_SLIP10, - CX_CURVE_Ed25519, - derivationPath, - pathLength, - privateKeyData, - NULL, - NULL, - 0); - cx_ecfp_init_private_key(CX_CURVE_Ed25519, - privateKeyData, - PRIVATEKEY_LENGTH, - privateKey); - } - CATCH_OTHER(e) { - MEMCLEAR(privateKeyData); - THROW(e); - } - FINALLY { - MEMCLEAR(privateKeyData); - } - } - END_TRY; -} - -void get_private_key_with_seed(cx_ecfp_private_key_t *privateKey, - const uint32_t *derivationPath, - uint8_t pathLength) { - uint8_t privateKeyData[PRIVATEKEY_LENGTH]; - BEGIN_TRY { - TRY { - os_perso_derive_node_bip32_seed_key(HDW_ED25519_SLIP10, - CX_CURVE_Ed25519, - derivationPath, - pathLength, - privateKeyData, - NULL, - (unsigned char *) "ed25519 seed", - 12); - cx_ecfp_init_private_key(CX_CURVE_Ed25519, - privateKeyData, - PRIVATEKEY_LENGTH, - privateKey); - } - CATCH_OTHER(e) { - MEMCLEAR(privateKeyData); - THROW(e); - } - FINALLY { - MEMCLEAR(privateKeyData); - } - } - END_TRY; -} - int read_derivation_path(const uint8_t *data_buffer, size_t data_size, uint32_t *derivation_path, @@ -126,29 +65,25 @@ int read_derivation_path(const uint8_t *data_buffer, return 0; } -void sendResponse(uint8_t tx, bool approve, bool display_menu) { - G_io_apdu_buffer[tx++] = approve ? 0x90 : 0x69; - G_io_apdu_buffer[tx++] = approve ? 0x00 : 0x85; - // Send back the response, do not restart the event loop - io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, tx); - if (display_menu) { - // Display back the original UX - ui_idle(); - } -} +uint8_t set_result_sign_message(void) { + size_t sigLen = SIGNATURE_LENGTH; + cx_err_t cx_err; + + cx_err = bip32_derive_with_seed_eddsa_sign_hash_256(HDW_ED25519_SLIP10, + CX_CURVE_Ed25519, + G_command.derivation_path, + G_command.derivation_path_length, + CX_SHA512, + G_command.message, + G_command.message_length, + G_io_apdu_buffer, + &sigLen, + NULL, + 0); -unsigned int ui_prepro(const bagl_element_t *element) { - unsigned int display = 1; - if (element->component.userid > 0) { - display = (ux_step == element->component.userid - 1); - if (display) { - if (element->component.userid == 1) { - UX_CALLBACK_SET_INTERVAL(2000); - } else { - UX_CALLBACK_SET_INTERVAL( - MAX(3000, 1000 + bagl_label_roundtrip_duration_ms(element, 7))); - } - } + if (CX_OK != cx_err) { + THROW(cx_err); } - return display; + + return SIGNATURE_LENGTH; } diff --git a/src/utils.h b/src/utils.h index a5c2ce56..ad0981c8 100644 --- a/src/utils.h +++ b/src/utils.h @@ -7,6 +7,8 @@ #ifndef _UTILS_H_ #define _UTILS_H_ +#define ARRAY_COUNT(array) (sizeof(array) / sizeof(array[0])) + // Marker flag for DEPRECATED ADPU exchange format #define DATA_HAS_LENGTH_PREFIX (1 << 15) @@ -19,19 +21,9 @@ typedef enum rlpTxType { TX_FEE } rlpTxType; -unsigned int ui_prepro(const bagl_element_t *element); - -void get_public_key(uint8_t *publicKeyArray, const uint32_t *derivationPath, size_t pathLength); - -uint32_t readUint32BE(uint8_t *buffer); - -void get_private_key(cx_ecfp_private_key_t *privateKey, - const uint32_t *derivationPath, - size_t pathLength); - -void get_private_key_with_seed(cx_ecfp_private_key_t *privateKey, - const uint32_t *derivationPath, - uint8_t pathLength); +void get_public_key(uint8_t publicKeyArray[static PUBKEY_LENGTH], + const uint32_t *derivationPath, + size_t pathLength); /** * Deserialize derivation path from raw bytes. @@ -53,55 +45,11 @@ int read_derivation_path(const uint8_t *data_buffer, uint32_t *derivation_path, uint32_t *derivation_path_length); -void sendResponse(uint8_t tx, bool approve, bool display_menu); - -// type userid x y w h str rad fill fg bg fid iid txt -// touchparams... ] -#define UI_BUTTONS \ - {{BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, 0xFFFFFF, 0, 0}, \ - NULL, \ - 0, \ - 0, \ - 0, \ - NULL, \ - NULL, \ - NULL}, \ - {{BAGL_ICON, 0x00, 3, 12, 7, 7, 0, 0, 0, 0xFFFFFF, 0x000000, 0, BAGL_GLYPH_ICON_CROSS}, \ - NULL, \ - 0, \ - 0, \ - 0, \ - NULL, \ - NULL, \ - NULL}, \ - { \ - {BAGL_ICON, 0x00, 117, 13, 8, 6, 0, 0, 0, 0xFFFFFF, 0x000000, 0, BAGL_GLYPH_ICON_CHECK}, \ - NULL, 0, 0, 0, NULL, NULL, NULL \ - } - -#define UI_FIRST 1 -#define UI_SECOND 0 - -#define UI_LABELINE(userId, text, isFirst, font, horizontalScrollSpeed) \ - { \ - {BAGL_LABELINE, \ - (userId), \ - 23, \ - (isFirst) ? 12 : 26, \ - 82, \ - 12, \ - (horizontalScrollSpeed) ? BAGL_STROKE_FLAG_ONESHOT | 10 : 0, \ - 0, \ - 0, \ - 0xFFFFFF, \ - 0x000000, \ - (font) | BAGL_FONT_ALIGNMENT_CENTER, \ - horizontalScrollSpeed}, \ - (text), 0, 0, 0, NULL, NULL, NULL \ - } +uint8_t set_result_sign_message(void); -#endif +#endif //_UTILS_H_ +// Outdated ? #ifdef TEST #include #define THROW(code) \ diff --git a/tests/python/apps/solana_utils.py b/tests/python/apps/solana_utils.py index f282b425..09f1a207 100644 --- a/tests/python/apps/solana_utils.py +++ b/tests/python/apps/solana_utils.py @@ -67,8 +67,9 @@ def enable_blind_signing(navigator, device_name: str, snapshots_name: str): ] else: nav = [NavInsID.USE_CASE_HOME_SETTINGS, - NavIns(NavInsID.TOUCH, (348,132)), - NavInsID.USE_CASE_SETTINGS_MULTI_PAGE_EXIT] + NavInsID.USE_CASE_SETTINGS_NEXT, + NavIns(NavInsID.TOUCH, (348,132)), + NavInsID.USE_CASE_SETTINGS_MULTI_PAGE_EXIT] navigator.navigate_and_compare(ROOT_SCREENSHOT_PATH, snapshots_name, nav, @@ -83,8 +84,9 @@ def enable_short_public_key(navigator, device_name: str, snapshots_name: str): ] else: nav = [NavInsID.USE_CASE_HOME_SETTINGS, - NavIns(NavInsID.TOUCH, (348,251)), - NavInsID.USE_CASE_SETTINGS_MULTI_PAGE_EXIT] + NavInsID.USE_CASE_SETTINGS_NEXT, + NavIns(NavInsID.TOUCH, (348,251)), + NavInsID.USE_CASE_SETTINGS_MULTI_PAGE_EXIT] navigator.navigate_and_compare(ROOT_SCREENSHOT_PATH, snapshots_name, nav, @@ -99,8 +101,9 @@ def enable_expert_mode(navigator, device_name: str, snapshots_name: str): ] else: nav = [NavInsID.USE_CASE_HOME_SETTINGS, - NavIns(NavInsID.TOUCH, (348,382)), - NavInsID.USE_CASE_SETTINGS_MULTI_PAGE_EXIT] + NavInsID.USE_CASE_SETTINGS_NEXT, + NavIns(NavInsID.TOUCH, (348,382)), + NavInsID.USE_CASE_SETTINGS_MULTI_PAGE_EXIT] navigator.navigate_and_compare(ROOT_SCREENSHOT_PATH, snapshots_name, nav, @@ -118,9 +121,9 @@ def _navigation_helper(navigator, device_name: str, accept: bool, snapshots_name navigate_instruction = NavInsID.USE_CASE_REVIEW_TAP text = "Hold to sign" if accept: - validation_instructions = [NavInsID.USE_CASE_REVIEW_CONFIRM] + validation_instructions = [NavInsID.USE_CASE_REVIEW_CONFIRM, NavInsID.USE_CASE_STATUS_DISMISS] else: - validation_instructions = [NavInsID.USE_CASE_REVIEW_REJECT, NavInsID.USE_CASE_CHOICE_CONFIRM] + validation_instructions = [NavInsID.USE_CASE_REVIEW_REJECT, NavInsID.USE_CASE_CHOICE_CONFIRM, NavInsID.USE_CASE_STATUS_DISMISS] navigator.navigate_until_text_and_compare(navigate_instruction, diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00009.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00009.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_1/00009.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00003.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00003.png index 0a415f28..fe47f76c 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00003.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00005.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00005.png index 1f8bb2df..0b782048 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00005.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00006.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00006.png index 5c23bf26..de413d6b 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00006.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00006.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00008.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00008.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00008.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_ok_2/00008.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00009.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00009.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_1/00009.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00003.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00003.png index 0a415f28..fe47f76c 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00003.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00005.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00005.png index 1f8bb2df..0b782048 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00005.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00006.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00006.png index 5c23bf26..de413d6b 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00006.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00006.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00008.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00008.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00008.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00008.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00009.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00009.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_expert_refused_2/00009.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00001.png index 5c23bf26..de413d6b 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00003.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00003.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00003.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_ok/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00001.png index 5c23bf26..de413d6b 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00003.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00003.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00003.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00004.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00004.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00004.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_ascii_refused/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00009.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00009.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_1/00009.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00009.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00009.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_2/00009.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00003.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00003.png index bad6c8e2..c6ed4629 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00003.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00004.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00004.png index 79d6436d..cd33dedb 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00004.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00005.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00005.png index 1f8bb2df..0b782048 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00005.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00007.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00007.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00007.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_ok_3/00007.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00009.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00009.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_1/00009.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00009.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00009.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_2/00009.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00003.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00003.png index bad6c8e2..c6ed4629 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00003.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00004.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00004.png index 79d6436d..cd33dedb 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00004.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00005.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00005.png index 1f8bb2df..0b782048 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00005.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00005.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00007.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00007.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00007.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00007.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00008.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00008.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00008.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_expert_refused_3/00008.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00009.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00009.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_1/00009.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00001.png index 79d6436d..cd33dedb 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00003.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00003.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00003.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_ok_2/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00009.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00009.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_1/00009.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00000.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00000.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00001.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00001.png index 79d6436d..cd33dedb 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00001.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00003.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00003.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00003.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00004.png b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00004.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00004.png and b/tests/python/snapshots/nanosp/test_ledger_sign_offchain_message_utf8_refused_2/00004.png differ diff --git a/tests/python/snapshots/nanosp/test_solana_get_public_key_ok/00000.png b/tests/python/snapshots/nanosp/test_solana_get_public_key_ok/00000.png index c233f738..e08f5fb1 100644 Binary files a/tests/python/snapshots/nanosp/test_solana_get_public_key_ok/00000.png and b/tests/python/snapshots/nanosp/test_solana_get_public_key_ok/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_solana_get_public_key_ok/00002.png b/tests/python/snapshots/nanosp/test_solana_get_public_key_ok/00002.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_solana_get_public_key_ok/00002.png and b/tests/python/snapshots/nanosp/test_solana_get_public_key_ok/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00000.png b/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00000.png index c233f738..e08f5fb1 100644 Binary files a/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00000.png and b/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00000.png differ diff --git a/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00002.png b/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00002.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00002.png and b/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00002.png differ diff --git a/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00003.png b/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00003.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00003.png and b/tests/python/snapshots/nanosp/test_solana_get_public_key_refused/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_1/00003.png b/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_1/00003.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_1/00003.png and b/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_1/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_2/00001.png b/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_2/00001.png index 0a1457d9..5ee5f176 100644 Binary files a/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_2/00001.png and b/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_2/00001.png differ diff --git a/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_2/00003.png b/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_2/00003.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_2/00003.png and b/tests/python/snapshots/nanosp/test_solana_simple_transfer_ok_2/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_solana_simple_transfer_refused/00003.png b/tests/python/snapshots/nanosp/test_solana_simple_transfer_refused/00003.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanosp/test_solana_simple_transfer_refused/00003.png and b/tests/python/snapshots/nanosp/test_solana_simple_transfer_refused/00003.png differ diff --git a/tests/python/snapshots/nanosp/test_solana_simple_transfer_refused/00004.png b/tests/python/snapshots/nanosp/test_solana_simple_transfer_refused/00004.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanosp/test_solana_simple_transfer_refused/00004.png and b/tests/python/snapshots/nanosp/test_solana_simple_transfer_refused/00004.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00009.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00009.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_1/00009.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00003.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00003.png index 0a415f28..fe47f76c 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00003.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00003.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00005.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00005.png index 1f8bb2df..0b782048 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00005.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00005.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00006.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00006.png index 5c23bf26..de413d6b 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00006.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00006.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00008.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00008.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00008.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_ok_2/00008.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00009.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00009.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_1/00009.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00003.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00003.png index 0a415f28..fe47f76c 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00003.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00003.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00005.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00005.png index 1f8bb2df..0b782048 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00005.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00005.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00006.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00006.png index 5c23bf26..de413d6b 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00006.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00006.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00008.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00008.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00008.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00008.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00009.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00009.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_expert_refused_2/00009.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00001.png index 5c23bf26..de413d6b 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00003.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00003.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00003.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_ok/00003.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00001.png index 5c23bf26..de413d6b 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00003.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00003.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00003.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00003.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00004.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00004.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00004.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_ascii_refused/00004.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00009.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00009.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_1/00009.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00009.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00009.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_2/00009.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00003.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00003.png index bad6c8e2..c6ed4629 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00003.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00003.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00004.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00004.png index 79d6436d..cd33dedb 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00004.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00004.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00005.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00005.png index 1f8bb2df..0b782048 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00005.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00005.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00007.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00007.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00007.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_ok_3/00007.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00009.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00009.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_1/00009.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00009.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00009.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_2/00009.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00003.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00003.png index bad6c8e2..c6ed4629 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00003.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00003.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00004.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00004.png index 79d6436d..cd33dedb 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00004.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00004.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00005.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00005.png index 1f8bb2df..0b782048 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00005.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00005.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00007.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00007.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00007.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00007.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00008.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00008.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00008.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_expert_refused_3/00008.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00009.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00009.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_1/00009.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00001.png index 79d6436d..cd33dedb 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00003.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00003.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00003.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_ok_2/00003.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00000.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00001.png index ab88bd3a..d885fe67 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00009.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00009.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00009.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_1/00009.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00000.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00000.png index 8b6d9e79..21398f44 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00000.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00000.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00001.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00001.png index 79d6436d..cd33dedb 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00001.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00001.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00003.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00003.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00003.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00003.png differ diff --git a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00004.png b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00004.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00004.png and b/tests/python/snapshots/nanox/test_ledger_sign_offchain_message_utf8_refused_2/00004.png differ diff --git a/tests/python/snapshots/nanox/test_solana_get_public_key_ok/00000.png b/tests/python/snapshots/nanox/test_solana_get_public_key_ok/00000.png index c233f738..e08f5fb1 100644 Binary files a/tests/python/snapshots/nanox/test_solana_get_public_key_ok/00000.png and b/tests/python/snapshots/nanox/test_solana_get_public_key_ok/00000.png differ diff --git a/tests/python/snapshots/nanox/test_solana_get_public_key_ok/00002.png b/tests/python/snapshots/nanox/test_solana_get_public_key_ok/00002.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_solana_get_public_key_ok/00002.png and b/tests/python/snapshots/nanox/test_solana_get_public_key_ok/00002.png differ diff --git a/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00000.png b/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00000.png index c233f738..e08f5fb1 100644 Binary files a/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00000.png and b/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00000.png differ diff --git a/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00002.png b/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00002.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00002.png and b/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00002.png differ diff --git a/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00003.png b/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00003.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00003.png and b/tests/python/snapshots/nanox/test_solana_get_public_key_refused/00003.png differ diff --git a/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_1/00003.png b/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_1/00003.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_1/00003.png and b/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_1/00003.png differ diff --git a/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_2/00001.png b/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_2/00001.png index 0a1457d9..5ee5f176 100644 Binary files a/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_2/00001.png and b/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_2/00001.png differ diff --git a/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_2/00003.png b/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_2/00003.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_2/00003.png and b/tests/python/snapshots/nanox/test_solana_simple_transfer_ok_2/00003.png differ diff --git a/tests/python/snapshots/nanox/test_solana_simple_transfer_refused/00003.png b/tests/python/snapshots/nanox/test_solana_simple_transfer_refused/00003.png index c9222461..e90cd9db 100644 Binary files a/tests/python/snapshots/nanox/test_solana_simple_transfer_refused/00003.png and b/tests/python/snapshots/nanox/test_solana_simple_transfer_refused/00003.png differ diff --git a/tests/python/snapshots/nanox/test_solana_simple_transfer_refused/00004.png b/tests/python/snapshots/nanox/test_solana_simple_transfer_refused/00004.png index 890ae49f..a3b562a7 100644 Binary files a/tests/python/snapshots/nanox/test_solana_simple_transfer_refused/00004.png and b/tests/python/snapshots/nanox/test_solana_simple_transfer_refused/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00000.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00001.png new file mode 100644 index 00000000..68c307a6 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00002.png new file mode 100644 index 00000000..df47c275 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00003.png new file mode 100644 index 00000000..c2f047cc Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_1/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00000.png new file mode 100644 index 00000000..9dbec60f Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00001.png new file mode 100644 index 00000000..5f3f4007 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00002.png new file mode 100644 index 00000000..0f52cf53 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00003.png new file mode 100644 index 00000000..1272d773 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00004.png new file mode 100644 index 00000000..d3bf7539 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00005.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00005.png new file mode 100644 index 00000000..1c2d6cd4 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00005.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00006.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00006.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_ok_2/00006.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00000.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00001.png new file mode 100644 index 00000000..68c307a6 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00002.png new file mode 100644 index 00000000..df47c275 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00003.png new file mode 100644 index 00000000..c2f047cc Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_1/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00000.png new file mode 100644 index 00000000..9dbec60f Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00001.png new file mode 100644 index 00000000..5f3f4007 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00002.png new file mode 100644 index 00000000..0f52cf53 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00003.png new file mode 100644 index 00000000..1272d773 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00004.png new file mode 100644 index 00000000..d3bf7539 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00005.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00005.png new file mode 100644 index 00000000..d4cf6afb Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00005.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00006.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00006.png new file mode 100644 index 00000000..6ff73111 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00006.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00007.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00007.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_expert_refused_2/00007.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00000.png new file mode 100644 index 00000000..9dbec60f Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00001.png new file mode 100644 index 00000000..1f4db0ed Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00002.png new file mode 100644 index 00000000..3646a05e Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00003.png new file mode 100644 index 00000000..1c2d6cd4 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_ok/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00000.png new file mode 100644 index 00000000..9dbec60f Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00001.png new file mode 100644 index 00000000..1f4db0ed Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00002.png new file mode 100644 index 00000000..3646a05e Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00003.png new file mode 100644 index 00000000..d4cf6afb Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00004.png new file mode 100644 index 00000000..6ff73111 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00005.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00005.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_ascii_refused/00005.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00000.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00001.png new file mode 100644 index 00000000..68c307a6 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00002.png new file mode 100644 index 00000000..df47c275 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00003.png new file mode 100644 index 00000000..e7471c20 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_1/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00000.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00001.png new file mode 100644 index 00000000..68c307a6 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00002.png new file mode 100644 index 00000000..e7471c20 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00003.png new file mode 100644 index 00000000..ee8e0320 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_2/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00000.png new file mode 100644 index 00000000..9dbec60f Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00001.png new file mode 100644 index 00000000..50287d12 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00002.png new file mode 100644 index 00000000..93a8699a Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00003.png new file mode 100644 index 00000000..d7f62348 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00004.png new file mode 100644 index 00000000..1c2d6cd4 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00005.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00005.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_ok_3/00005.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00000.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00001.png new file mode 100644 index 00000000..68c307a6 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00002.png new file mode 100644 index 00000000..df47c275 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00003.png new file mode 100644 index 00000000..e7471c20 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_1/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00000.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00001.png new file mode 100644 index 00000000..68c307a6 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00002.png new file mode 100644 index 00000000..e7471c20 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00003.png new file mode 100644 index 00000000..ee8e0320 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_2/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00000.png new file mode 100644 index 00000000..9dbec60f Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00001.png new file mode 100644 index 00000000..50287d12 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00002.png new file mode 100644 index 00000000..93a8699a Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00003.png new file mode 100644 index 00000000..d7f62348 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00004.png new file mode 100644 index 00000000..d4cf6afb Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00005.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00005.png new file mode 100644 index 00000000..6ff73111 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00005.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00006.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00006.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_expert_refused_3/00006.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00000.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00001.png new file mode 100644 index 00000000..68c307a6 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00002.png new file mode 100644 index 00000000..df47c275 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00003.png new file mode 100644 index 00000000..e7471c20 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_1/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00000.png new file mode 100644 index 00000000..9dbec60f Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00001.png new file mode 100644 index 00000000..119f8377 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00002.png new file mode 100644 index 00000000..3646a05e Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00003.png new file mode 100644 index 00000000..1c2d6cd4 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_ok_2/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00000.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00001.png new file mode 100644 index 00000000..68c307a6 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00002.png new file mode 100644 index 00000000..df47c275 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00003.png new file mode 100644 index 00000000..e7471c20 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_1/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00000.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00000.png new file mode 100644 index 00000000..9dbec60f Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00000.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00001.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00001.png new file mode 100644 index 00000000..119f8377 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00001.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00002.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00002.png new file mode 100644 index 00000000..3646a05e Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00002.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00003.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00003.png new file mode 100644 index 00000000..d4cf6afb Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00003.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00004.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00004.png new file mode 100644 index 00000000..6ff73111 Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00004.png differ diff --git a/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00005.png b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00005.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_ledger_sign_offchain_message_utf8_refused_2/00005.png differ diff --git a/tests/python/snapshots/stax/test_solana_get_public_key_ok/00000.png b/tests/python/snapshots/stax/test_solana_get_public_key_ok/00000.png new file mode 100644 index 00000000..6d2f7e89 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_get_public_key_ok/00000.png differ diff --git a/tests/python/snapshots/stax/test_solana_get_public_key_ok/00001.png b/tests/python/snapshots/stax/test_solana_get_public_key_ok/00001.png new file mode 100644 index 00000000..9f6d0d99 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_get_public_key_ok/00001.png differ diff --git a/tests/python/snapshots/stax/test_solana_get_public_key_ok/00002.png b/tests/python/snapshots/stax/test_solana_get_public_key_ok/00002.png new file mode 100644 index 00000000..13499fcc Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_get_public_key_ok/00002.png differ diff --git a/tests/python/snapshots/stax/test_solana_get_public_key_ok/00003.png b/tests/python/snapshots/stax/test_solana_get_public_key_ok/00003.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_get_public_key_ok/00003.png differ diff --git a/tests/python/snapshots/stax/test_solana_get_public_key_refused/00000.png b/tests/python/snapshots/stax/test_solana_get_public_key_refused/00000.png new file mode 100644 index 00000000..6d2f7e89 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_get_public_key_refused/00000.png differ diff --git a/tests/python/snapshots/stax/test_solana_get_public_key_refused/00001.png b/tests/python/snapshots/stax/test_solana_get_public_key_refused/00001.png new file mode 100644 index 00000000..9f6d0d99 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_get_public_key_refused/00001.png differ diff --git a/tests/python/snapshots/stax/test_solana_get_public_key_refused/00002.png b/tests/python/snapshots/stax/test_solana_get_public_key_refused/00002.png new file mode 100644 index 00000000..b0eba3f0 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_get_public_key_refused/00002.png differ diff --git a/tests/python/snapshots/stax/test_solana_get_public_key_refused/00003.png b/tests/python/snapshots/stax/test_solana_get_public_key_refused/00003.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_get_public_key_refused/00003.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00000.png b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00000.png new file mode 100644 index 00000000..57d030b7 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00000.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00001.png b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00001.png new file mode 100644 index 00000000..25e0c620 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00001.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00002.png b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00002.png new file mode 100644 index 00000000..92e64b37 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00002.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00003.png b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00003.png new file mode 100644 index 00000000..a21279c8 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00003.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00004.png b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_1/00004.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00000.png b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00000.png new file mode 100644 index 00000000..57d030b7 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00000.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00001.png b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00001.png new file mode 100644 index 00000000..d3195f44 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00001.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00002.png b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00002.png new file mode 100644 index 00000000..92e64b37 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00002.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00003.png b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00003.png new file mode 100644 index 00000000..a21279c8 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00003.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00004.png b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00004.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_ok_2/00004.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00000.png b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00000.png new file mode 100644 index 00000000..57d030b7 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00000.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00001.png b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00001.png new file mode 100644 index 00000000..25e0c620 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00001.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00002.png b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00002.png new file mode 100644 index 00000000..92e64b37 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00002.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00003.png b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00003.png new file mode 100644 index 00000000..9d261148 Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00003.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00004.png b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00004.png new file mode 100644 index 00000000..17d33d6e Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00004.png differ diff --git a/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00005.png b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00005.png new file mode 100644 index 00000000..a63aad0d Binary files /dev/null and b/tests/python/snapshots/stax/test_solana_simple_transfer_refused/00005.png differ diff --git a/tests/python/test_solana.py b/tests/python/test_solana.py index 2d8c42e4..82b1c254 100644 --- a/tests/python/test_solana.py +++ b/tests/python/test_solana.py @@ -22,9 +22,14 @@ def test_solana_get_public_key_ok(self, backend, navigator, test_name): ROOT_SCREENSHOT_PATH, test_name) else: + instructions = [ + NavInsID.USE_CASE_REVIEW_TAP, + NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CONFIRM, + NavInsID.USE_CASE_STATUS_DISMISS + ] navigator.navigate_and_compare(ROOT_SCREENSHOT_PATH, test_name, - [NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CONFIRM]) + instructions) assert sol.get_async_response().data == from_public_key @@ -40,9 +45,14 @@ def test_solana_get_public_key_refused(self, backend, navigator, test_name): ROOT_SCREENSHOT_PATH, test_name) else: + instructions = [ + NavInsID.USE_CASE_REVIEW_TAP, + NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CANCEL, + NavInsID.USE_CASE_STATUS_DISMISS + ] navigator.navigate_and_compare(ROOT_SCREENSHOT_PATH, test_name, - [NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CANCEL]) + instructions) assert sol.get_async_response().status == ErrorType.USER_CANCEL