diff --git a/.github/workflows/check_version.yml b/.github/workflows/check_version.yml index 42051866..571c54c5 100644 --- a/.github/workflows/check_version.yml +++ b/.github/workflows/check_version.yml @@ -28,7 +28,7 @@ jobs: version: ${{ steps.store-version.outputs.version }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - run: make version diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c9fd3208..957e8285 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,14 +13,14 @@ jobs: name: Analyse strategy: matrix: - sdk: ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK"] + sdk: ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK", "$FLEX_SDK"] runs-on: ubuntu-latest container: image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7bb5891b..80596109 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Install deps @@ -41,7 +41,7 @@ jobs: size: ${{steps.build.outputs.size}} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Build Standard app @@ -71,7 +71,7 @@ jobs: echo $HOME echo $DISPLAY - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev @@ -100,7 +100,7 @@ jobs: BOLOS_SDK: /opt/nanos-secure-sdk steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Install deps @@ -109,7 +109,7 @@ jobs: - name: Build NanoS shell: bash -l {0} run: | - make + PRODUCTION_BUILD=0 make mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos.sh - name: Set tag id: nanos @@ -136,7 +136,7 @@ jobs: BOLOS_SDK: /opt/nanosplus-secure-sdk steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Install deps @@ -145,7 +145,7 @@ jobs: - name: Build NanoSP shell: bash -l {0} run: | - make + PRODUCTION_BUILD=0 make mv ./app/pkg/installer_s2.sh ./app/pkg/installer_nanos_plus.sh - name: Set tag id: nanosp @@ -160,3 +160,75 @@ jobs: tag_name: ${{ steps.nanosp.outputs.tag_name }} draft: false prerelease: false + + build_package_stax: + needs: [configure, build, build_ledger, test_zemu] + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ubuntu-latest + container: + image: zondax/ledger-app-builder:latest + options: --user ${{ needs.configure.outputs.uid_gid }} + env: + BOLOS_SDK: /opt/stax-secure-sdk + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Install deps + run: pip install ledgerblue + + - name: Build Stax + shell: bash -l {0} + run: | + PRODUCTION_BUILD=0 make + - name: Set tag + id: stax + run: echo "tag_name=$(./app/pkg/installer_stax.sh version)" >> $GITHUB_OUTPUT + - name: Update Release + id: update_release_2 + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + files: | + ./app/pkg/installer_stax.sh + tag_name: ${{ steps.stax.outputs.tag_name }} + draft: false + prerelease: false + + build_package_flex: + needs: [configure, build, build_ledger, test_zemu] + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ubuntu-latest + container: + image: zondax/ledger-app-builder:latest + options: --user ${{ needs.configure.outputs.uid_gid }} + env: + BOLOS_SDK: /opt/flex-secure-sdk + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Install deps + run: pip install ledgerblue + + - name: Build Flex + shell: bash -l {0} + run: | + PRODUCTION_BUILD=0 make + - name: Set tag + id: flex + run: echo "tag_name=$(./app/pkg/installer_flex.sh version)" >> $GITHUB_OUTPUT + - name: Update Release + id: update_release_2 + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + files: | + ./app/pkg/installer_flex.sh + tag_name: ${{ steps.flex.outputs.tag_name }} + draft: false + prerelease: false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..3d8f9142 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,54 @@ +name: "Publish js packages" + +on: + release: + types: + - created + tags: + - "npm_v[0-9]+(\\.[0-9]+)*" + +jobs: + publish_npm_package: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Install node + uses: actions/setup-node@v3 + with: + registry-url: "https://registry.npmjs.org" + scope: "@zondax" + - name: Install yarn + run: npm install -g yarn + - name: Build package + run: | + cd js + yarn install + yarn build + - name: Get latest release version number + id: get_version + run: | + GITHUB_REF=${{ github.ref }} + echo "version=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT + - name: Show version + run: echo ${{ steps.get_version.outputs.version }} + - name: Clean latest release version number + id: get_version_cleaned + uses: bhowell2/github-substring-action@v1 + with: + output_name: version + value: ${{ steps.get_version.outputs.version }} + index_of_str: "npm_" + - name: Update tag + run: | + cd js + echo Publishing as ${{ steps.get_version_cleaned.outputs.version }} + npm --allow-same-version --no-git-tag-version version ${{ steps.get_version_cleaned.outputs.version }} + - name: Publish package + run: | + cd js + npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH_AUTO }} diff --git a/.gitmodules b/.gitmodules index 25c36f0a..88129b14 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,21 +1,9 @@ -[submodule "deps/nanos-secure-sdk"] - path = deps/nanos-secure-sdk - url = https://github.com/LedgerHQ/nanos-secure-sdk -[submodule "deps/nanosplus-secure-sdk"] - path = deps/nanosplus-secure-sdk - url = https://github.com/LedgerHQ/ledger-secure-sdk.git -[submodule "deps/nanox-secure-sdk"] - path = deps/nanox-secure-sdk - url = https://github.com/LedgerHQ/ledger-secure-sdk.git -[submodule "cmake/cmake-modules"] - path = cmake/cmake-modules - url = https://github.com/bilke/cmake-modules [submodule "deps/picohash"] path = deps/picohash url = https://github.com/kazuho/picohash [submodule "deps/ledger-zxlib"] path = deps/ledger-zxlib url = https://github.com/Zondax/ledger-zxlib.git -[submodule "deps/stax-secure-sdk"] - path = deps/stax-secure-sdk - url = https://github.com/LedgerHQ/ledger-secure-sdk.git +[submodule "deps/ledger-secure-sdk"] + path = deps/ledger-secure-sdk + url = https://github.com/LedgerHQ/ledger-secure-sdk diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c054b97..7acd0807 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,84 +1,105 @@ -#******************************************************************************* -#* (c) 2018 -2022 Zondax AG -#* -#* 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. -#******************************************************************************** -cmake_minimum_required(VERSION 3.0) -project(ledger-algorand VERSION 0.0.0) -enable_testing() +# ******************************************************************************* +# * (c) 2018 - 2024 Zondax AG +# * +# * 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. +# ******************************************************************************** +cmake_minimum_required(VERSION 3.28) +include("cmake/HunterGate.cmake") +HunterGate( + URL "https://github.com/cpp-pm/hunter/archive/v0.25.5.tar.gz" + SHA1 "a20151e4c0740ee7d0f9994476856d813cdead29" + LOCAL +) +if(CMAKE_GENERATOR MATCHES "Ninja") + message(FATAL_ERROR "This project does not support the Ninja generator. " + "Please use Unix Makefiles or another supported generator. " + "This error is typical in CLion. In this case, switch to generator Unix Makefiles.") +endif() + +######################################################## + +project(ledger-algorand VERSION 0.0.0) +set(CMAKE_CXX_STANDARD 17) cmake_policy(SET CMP0025 NEW) -set(CMAKE_CXX_STANDARD 11) +cmake_policy(SET CMP0144 NEW) -option(ENABLE_FUZZING "Build with fuzzing instrumentation and build fuzz targets" OFF) -option(ENABLE_COVERAGE "Build with source code coverage instrumentation" OFF) -option(ENABLE_SANITIZERS "Build with ASAN and UBSAN" OFF) +set(HUNTER_STATUS_DEBUG ON) +set(HUNTER_TLS_VERIFY OFF) + +enable_testing() + +option(ENABLE_FUZZING "Enable fuzzing instrumentation and build fuzz targets" OFF) +option(ENABLE_COVERAGE "Enable source code coverage instrumentation" OFF) +option(ENABLE_SANITIZERS "Enable ASAN and UBSAN" OFF) string(APPEND CMAKE_C_FLAGS " -fno-omit-frame-pointer -g") string(APPEND CMAKE_CXX_FLAGS " -fno-omit-frame-pointer -g") string(APPEND CMAKE_LINKER_FLAGS " -fno-omit-frame-pointer -g") -add_definitions(-DAPP_STANDARD) -add_definitions(-DSUBSTRATE_PARSER_FULL) +hunter_add_package(fmt) +find_package(fmt CONFIG REQUIRED) -if(ENABLE_FUZZING) - add_definitions(-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1) - SET(ENABLE_SANITIZERS ON CACHE BOOL "Sanitizer automatically enabled" FORCE) - SET(CMAKE_BUILD_TYPE Debug) +hunter_add_package(jsoncpp) +find_package(jsoncpp CONFIG REQUIRED) - if (DEFINED ENV{FUZZ_LOGGING}) - add_definitions(-DFUZZING_LOGGING) - message(FATAL_ERROR "Fuzz logging enabled") - endif() +hunter_add_package(GTest) +find_package(GTest CONFIG REQUIRED) - set(CMAKE_CXX_CLANG_TIDY clang-tidy -checks=-*,bugprone-*,cert-*,clang-analyzer-*,-cert-err58-cpp,misc-*) +if(ENABLE_FUZZING) + add_definitions(-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1) + SET(ENABLE_SANITIZERS ON CACHE BOOL "Sanitizer automatically enabled" FORCE) + SET(CMAKE_BUILD_TYPE Debug) + + if(DEFINED ENV{FUZZ_LOGGING}) + add_definitions(-DFUZZING_LOGGING) + message(FATAL_ERROR "Fuzz logging enabled") + endif() - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - # require at least clang 3.2 - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) - message(FATAL_ERROR "Clang version must be at least 10.0!") + set(CMAKE_CXX_CLANG_TIDY clang-tidy -checks=-*,bugprone-*,cert-*,clang-analyzer-*,-cert-err58-cpp,misc-*) + + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) + message(FATAL_ERROR "Clang version must be at least 10.0!") + endif() + else() + message(FATAL_ERROR + "Unsupported compiler! Fuzzing requires Clang 10.\n" + "1. Install clang-10 \n" + "2. Use -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_COMPILER=clang++-10") endif() - else() - message(FATAL_ERROR - "You are using an unsupported compiler! Fuzzing only works with Clang 10.\n" - "1. Install clang-10 \n" - "2. Pass -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_COMPILER=clang++-10") - endif() - - string(APPEND CMAKE_C_FLAGS " -fsanitize=fuzzer-no-link") - string(APPEND CMAKE_CXX_FLAGS " -fsanitize=fuzzer-no-link") - string(APPEND CMAKE_LINKER_FLAGS " -fsanitize=fuzzer-no-link") + + string(APPEND CMAKE_C_FLAGS " -fsanitize=fuzzer-no-link") + string(APPEND CMAKE_CXX_FLAGS " -fsanitize=fuzzer-no-link") + string(APPEND CMAKE_LINKER_FLAGS " -fsanitize=fuzzer-no-link") endif() if(ENABLE_COVERAGE) - string(APPEND CMAKE_C_FLAGS " -fprofile-instr-generate -fcoverage-mapping") - string(APPEND CMAKE_CXX_FLAGS " -fprofile-instr-generate -fcoverage-mapping") - string(APPEND CMAKE_LINKER_FLAGS " -fprofile-instr-generate -fcoverage-mapping") + string(APPEND CMAKE_C_FLAGS " -fprofile-instr-generate -fcoverage-mapping") + string(APPEND CMAKE_CXX_FLAGS " -fprofile-instr-generate -fcoverage-mapping") + string(APPEND CMAKE_LINKER_FLAGS " -fprofile-instr-generate -fcoverage-mapping") endif() if(ENABLE_SANITIZERS) - string(APPEND CMAKE_C_FLAGS " -fsanitize=address,undefined -fsanitize-recover=address,undefined") - string(APPEND CMAKE_CXX_FLAGS " -fsanitize=address,undefined -fsanitize-recover=address,undefined") - string(APPEND CMAKE_LINKER_FLAGS " -fsanitize=address,undefined -fsanitize-recover=address,undefined") + string(APPEND CMAKE_C_FLAGS " -fsanitize=address,undefined -fsanitize-recover=address,undefined") + string(APPEND CMAKE_CXX_FLAGS " -fsanitize=address,undefined -fsanitize-recover=address,undefined") + string(APPEND CMAKE_LINKER_FLAGS " -fsanitize=address,undefined -fsanitize-recover=address,undefined") endif() -include(cmake/conan/CMakeLists.txt) -add_subdirectory(cmake/gtest) - -set (RETRIEVE_MAJOR_CMD +set(RETRIEVE_MAJOR_CMD "cat ${CMAKE_CURRENT_SOURCE_DIR}/app/Makefile.version | grep APPVERSION_M | cut -b 14- | tr -d '\n'" ) -set (RETRIEVE_MINOR_CMD +set(RETRIEVE_MINOR_CMD "cat ${CMAKE_CURRENT_SOURCE_DIR}/app/Makefile.version | grep APPVERSION_N | cut -b 14- | tr -d '\n'" ) execute_process( @@ -92,17 +113,17 @@ execute_process( OUTPUT_VARIABLE MINOR_VERSION ) -message(STATUS "LEDGER_MAJOR_VERSION [${MAJOR_RESULT}]: ${MAJOR_VERSION}" ) -message(STATUS "LEDGER_MINOR_VERSION [${MINOR_RESULT}]: ${MINOR_VERSION}" ) +message(STATUS "LEDGER_MAJOR_VERSION [${MAJOR_RESULT}]: ${MAJOR_VERSION}") +message(STATUS "LEDGER_MINOR_VERSION [${MINOR_RESULT}]: ${MINOR_VERSION}") add_definitions( - -DLEDGER_MAJOR_VERSION=${MAJOR_VERSION} - -DLEDGER_MINOR_VERSION=${MINOR_VERSION} + -DLEDGER_MAJOR_VERSION=${MAJOR_VERSION} + -DLEDGER_MINOR_VERSION=${MINOR_VERSION} ) ############################################################## ############################################################## -# static libs +# Static Libraries file(GLOB_RECURSE LIB_SRC ${CMAKE_CURRENT_SOURCE_DIR}/deps/ledger-zxlib/src/app_mode.c ${CMAKE_CURRENT_SOURCE_DIR}/deps/ledger-zxlib/src/base64.c @@ -132,43 +153,39 @@ target_include_directories(app_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/app/src/common ) -############################################################## -############################################################## -# Tests -file(GLOB_RECURSE TESTS_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp) - -add_executable(unittests ${TESTS_SRC}) -target_include_directories(unittests PRIVATE - ${gtest_SOURCE_DIR}/include - ${gmock_SOURCE_DIR}/include - ${CONAN_INCLUDE_DIRS_FMT} - ${CONAN_INCLUDE_DIRS_JSONCPP} - ${CMAKE_CURRENT_SOURCE_DIR}/app/src - ${CMAKE_CURRENT_SOURCE_DIR}/app/src/lib - ) - -target_link_libraries(unittests PRIVATE - gtest_main - app_lib - CONAN_PKG::fmt - CONAN_PKG::jsoncpp) - -add_compile_definitions(TESTVECTORS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/tests/") -add_test(unittests ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittests) -set_tests_properties(unittests PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests) - ############################################################## ############################################################## # Fuzz Targets if(ENABLE_FUZZING) - set(FUZZ_TARGETS - parser_parse + set(FUZZ_TARGETS + parser_parse ) - foreach(target ${FUZZ_TARGETS}) - add_executable(fuzz-${target} ${CMAKE_CURRENT_SOURCE_DIR}/fuzz/${target}.cpp) - target_link_libraries(fuzz-${target} PRIVATE app_lib) - target_link_options(fuzz-${target} PRIVATE "-fsanitize=fuzzer") - endforeach() + foreach(target ${FUZZ_TARGETS}) + add_executable(fuzz-${target} ${CMAKE_CURRENT_SOURCE_DIR}/fuzz/${target}.cpp) + target_link_libraries(fuzz-${target} PRIVATE app_lib) + target_link_options(fuzz-${target} PRIVATE "-fsanitize=fuzzer") + endforeach() +else() +############################################################# +# Tests + file(GLOB_RECURSE TESTS_SRC + ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp) + + add_executable(unittests ${TESTS_SRC}) + target_include_directories(unittests PRIVATE + "${GTEST_ROOT}/include" + fmt::fmt + jsoncpp::jsoncpp + ) + + target_link_libraries(unittests PRIVATE + app_lib + GTest::gtest_main + fmt::fmt + JsonCpp::JsonCpp) + + add_compile_definitions(TESTVECTORS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/tests/") + add_test(NAME unittests COMMAND unittests) + set_tests_properties(unittests PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests) endif() diff --git a/Makefile b/Makefile index 2e913098..fca29601 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ ifeq ($(BOLOS_SDK),) # In this case, there is not predefined SDK and we run dockerized # When not using the SDK, we override and build the XL complete app -ZXLIB_COMPILE_STAX ?= 1 +PRODUCTION_BUILD ?= 1 include $(CURDIR)/deps/ledger-zxlib/dockerized_build.mk else diff --git a/app/Makefile b/app/Makefile index 51abc248..d251d876 100755 --- a/app/Makefile +++ b/app/Makefile @@ -28,6 +28,16 @@ include $(BOLOS_SDK)/Makefile.defines $(info ************ TARGET_NAME = [$(TARGET_NAME)]) +## Display whether this is a production build or for internal use +PRODUCTION_BUILD ?= 1 +ifeq ($(PRODUCTION_BUILD), 1) + $(info ************ PRODUCTION_BUILD = [PRODUCTION BUILD]) +else + $(info ************ PRODUCTION_BUILD = [INTERNAL USE]) +endif + +DEFINES += PRODUCTION_BUILD=$(PRODUCTION_BUILD) + include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.app_testing DEFINES += REVIEW_SCREEN_ENABLED SHORTCUT_MODE_ENABLED diff --git a/app/Makefile.version b/app/Makefile.version index 2e3c4480..be85216e 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=2 # This is the `spec_version` field of `Runtime` APPVERSION_N=1 # This is the patch version of this release -APPVERSION_P=12 +APPVERSION_P=14 diff --git a/app/flex_icon.gif b/app/flex_icon.gif new file mode 100644 index 00000000..e04f5ca2 Binary files /dev/null and b/app/flex_icon.gif differ diff --git a/app/src/common/parser.h b/app/src/common/parser.h index f07f43c1..a847b217 100644 --- a/app/src/common/parser.h +++ b/app/src/common/parser.h @@ -46,8 +46,6 @@ parser_error_t parser_getItem(parser_context_t *ctx, parser_error_t getItem(uint8_t index, uint8_t* displayIdx); -parser_error_t parser_getTxnText(parser_context_t *ctx, char *outVal, uint16_t outValLen); - #ifdef __cplusplus } #endif diff --git a/app/src/common/tx.c b/app/src/common/tx.c index 69b4c424..d2e2756a 100644 --- a/app/src/common/tx.c +++ b/app/src/common/tx.c @@ -1,5 +1,5 @@ /******************************************************************************* -* (c) 2018 - 2022 Zondax AG +* (c) 2018 - 2024 Zondax AG * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ #include #include "zxmacros.h" -#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) +#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX) #define RAM_BUFFER_SIZE 8192 #define FLASH_BUFFER_SIZE 16384 #elif defined(TARGET_NANOS) @@ -38,7 +38,7 @@ typedef struct uint8_t buffer[FLASH_BUFFER_SIZE]; } storage_t; -#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX) storage_t NV_CONST N_appdata_impl __attribute__((aligned(64))); #define N_appdata (*(NV_VOLATILE storage_t *)PIC(&N_appdata_impl)) #endif @@ -122,13 +122,6 @@ zxerr_t tx_getItem(int8_t displayIdx, { uint8_t numItems = 0; -#if defined(TARGET_STAX) - if (displayIdx == -1) { - const parser_error_t tmpError = parser_getTxnText(&ctx_parsed_tx, outVal, outValLen); - return (tmpError == parser_ok ? zxerr_ok : zxerr_no_data); - } -#endif - CHECK_ZXERR(tx_getNumItems(&numItems)) if (displayIdx > numItems) { diff --git a/app/src/parser_encoding.c b/app/src/parser_encoding.c index f097a87a..28a75b99 100644 --- a/app/src/parser_encoding.c +++ b/app/src/parser_encoding.c @@ -1,5 +1,5 @@ /******************************************************************************* -* (c) 2018 - 2022 Zondax AG +* (c) 2018 - 2024 Zondax AG * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ #include "base32.h" #define CX_SHA512_SIZE 64 - #if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) || defined(TARGET_STAX) + #if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) || defined(TARGET_STAX) || defined(TARGET_FLEX) #else #include "picohash.h" @@ -48,7 +48,7 @@ uint32_t encodePubKey(uint8_t *buffer, uint16_t bufferLen, const uint8_t *public parser_error_t b64hash_data(unsigned char *data, size_t data_len, char *b64hash, size_t b64hashLen) { unsigned char hash[32]; -#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) || defined(TARGET_STAX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) || defined(TARGET_STAX) || defined(TARGET_FLEX) // Hash program and b64 encode for display cx_sha256_t ctx; memset(&ctx, 0, sizeof(ctx)); diff --git a/cmake/Hunter/config.cmake b/cmake/Hunter/config.cmake new file mode 100644 index 00000000..13447cb5 --- /dev/null +++ b/cmake/Hunter/config.cmake @@ -0,0 +1,3 @@ +hunter_config(jsoncpp VERSION 1.9.5-b1) +hunter_config(fmt VERSION 10.1.1) +hunter_config(GTest VERSION 1.14.0) diff --git a/cmake/HunterGate.cmake b/cmake/HunterGate.cmake new file mode 100644 index 00000000..17c6d380 --- /dev/null +++ b/cmake/HunterGate.cmake @@ -0,0 +1,543 @@ +# Copyright (c) 2013-2019, Ruslan Baratov +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# This is a gate file to Hunter package manager. +# Include this file using `include` command and add package you need, example: +# +# cmake_minimum_required(VERSION 3.5) +# +# include("cmake/HunterGate.cmake") +# HunterGate( +# URL "https://github.com/path/to/hunter/archive.tar.gz" +# SHA1 "798501e983f14b28b10cda16afa4de69eee1da1d" +# ) +# +# project(MyProject) +# +# hunter_add_package(Foo) +# hunter_add_package(Boo COMPONENTS Bar Baz) +# +# Projects: +# * https://github.com/cpp-pm/gate/ +# * https://github.com/cpp-pm/hunter + +option(HUNTER_ENABLED "Enable Hunter package manager support" ON) + +if(HUNTER_ENABLED) + if(CMAKE_VERSION VERSION_LESS "3.5") + message( + FATAL_ERROR + "At least CMake version 3.5 required for Hunter dependency management." + " Update CMake or set HUNTER_ENABLED to OFF." + ) + endif() +endif() + +include(CMakeParseArguments) # cmake_parse_arguments + +option(HUNTER_STATUS_PRINT "Print working status" ON) +option(HUNTER_STATUS_DEBUG "Print a lot info" OFF) +option(HUNTER_TLS_VERIFY "Enable/disable TLS certificate checking on downloads" ON) +set(HUNTER_ROOT "" CACHE FILEPATH "Override the HUNTER_ROOT.") + +set(HUNTER_ERROR_PAGE "https://hunter.readthedocs.io/en/latest/reference/errors") + +function(hunter_gate_status_print) + if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG) + foreach(print_message ${ARGV}) + message(STATUS "[hunter] ${print_message}") + endforeach() + endif() +endfunction() + +function(hunter_gate_status_debug) + if(HUNTER_STATUS_DEBUG) + foreach(print_message ${ARGV}) + string(TIMESTAMP timestamp) + message(STATUS "[hunter *** DEBUG *** ${timestamp}] ${print_message}") + endforeach() + endif() +endfunction() + +function(hunter_gate_error_page error_page) + message("------------------------------ ERROR ------------------------------") + message(" ${HUNTER_ERROR_PAGE}/${error_page}.html") + message("-------------------------------------------------------------------") + message("") + message(FATAL_ERROR "") +endfunction() + +function(hunter_gate_internal_error) + message("") + foreach(print_message ${ARGV}) + message("[hunter ** INTERNAL **] ${print_message}") + endforeach() + message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]") + message("") + hunter_gate_error_page("error.internal") +endfunction() + +function(hunter_gate_fatal_error) + cmake_parse_arguments(hunter "" "ERROR_PAGE" "" "${ARGV}") + if("${hunter_ERROR_PAGE}" STREQUAL "") + hunter_gate_internal_error("Expected ERROR_PAGE") + endif() + message("") + foreach(x ${hunter_UNPARSED_ARGUMENTS}) + message("[hunter ** FATAL ERROR **] ${x}") + endforeach() + message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]") + message("") + hunter_gate_error_page("${hunter_ERROR_PAGE}") +endfunction() + +function(hunter_gate_user_error) + hunter_gate_fatal_error(${ARGV} ERROR_PAGE "error.incorrect.input.data") +endfunction() + +function(hunter_gate_self root version sha1 result) + string(COMPARE EQUAL "${root}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("root is empty") + endif() + + string(COMPARE EQUAL "${version}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("version is empty") + endif() + + string(COMPARE EQUAL "${sha1}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("sha1 is empty") + endif() + + string(SUBSTRING "${sha1}" 0 7 archive_id) + + if(EXISTS "${root}/cmake/Hunter") + set(hunter_self "${root}") + else() + set( + hunter_self + "${root}/_Base/Download/Hunter/${version}/${archive_id}/Unpacked" + ) + endif() + + set("${result}" "${hunter_self}" PARENT_SCOPE) +endfunction() + +# Set HUNTER_GATE_ROOT cmake variable to suitable value. +function(hunter_gate_detect_root) + # Check CMake variable + if(HUNTER_ROOT) + set(HUNTER_GATE_ROOT "${HUNTER_ROOT}" PARENT_SCOPE) + hunter_gate_status_debug("HUNTER_ROOT detected by cmake variable") + return() + endif() + + # Check environment variable + if(DEFINED ENV{HUNTER_ROOT}) + set(HUNTER_GATE_ROOT "$ENV{HUNTER_ROOT}" PARENT_SCOPE) + hunter_gate_status_debug("HUNTER_ROOT detected by environment variable") + return() + endif() + + # Check HOME environment variable + if(DEFINED ENV{HOME}) + set(HUNTER_GATE_ROOT "$ENV{HOME}/.hunter" PARENT_SCOPE) + hunter_gate_status_debug("HUNTER_ROOT set using HOME environment variable") + return() + endif() + + # Check SYSTEMDRIVE and USERPROFILE environment variable (windows only) + if(WIN32) + if(DEFINED ENV{SYSTEMDRIVE}) + set(HUNTER_GATE_ROOT "$ENV{SYSTEMDRIVE}/.hunter" PARENT_SCOPE) + hunter_gate_status_debug( + "HUNTER_ROOT set using SYSTEMDRIVE environment variable" + ) + return() + endif() + + if(DEFINED ENV{USERPROFILE}) + set(HUNTER_GATE_ROOT "$ENV{USERPROFILE}/.hunter" PARENT_SCOPE) + hunter_gate_status_debug( + "HUNTER_ROOT set using USERPROFILE environment variable" + ) + return() + endif() + endif() + + hunter_gate_fatal_error( + "Can't detect HUNTER_ROOT" + ERROR_PAGE "error.detect.hunter.root" + ) +endfunction() + +function(hunter_gate_download dir) + string( + COMPARE + NOTEQUAL + "$ENV{HUNTER_DISABLE_AUTOINSTALL}" + "" + disable_autoinstall + ) + if(disable_autoinstall AND NOT HUNTER_RUN_INSTALL) + hunter_gate_fatal_error( + "Hunter not found in '${dir}'" + "Set HUNTER_RUN_INSTALL=ON to auto-install it from '${HUNTER_GATE_URL}'" + "Settings:" + " HUNTER_ROOT: ${HUNTER_GATE_ROOT}" + " HUNTER_SHA1: ${HUNTER_GATE_SHA1}" + ERROR_PAGE "error.run.install" + ) + endif() + string(COMPARE EQUAL "${dir}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("Empty 'dir' argument") + endif() + + string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("HUNTER_GATE_SHA1 empty") + endif() + + string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("HUNTER_GATE_URL empty") + endif() + + set(done_location "${dir}/DONE") + set(sha1_location "${dir}/SHA1") + + set(build_dir "${dir}/Build") + set(cmakelists "${dir}/CMakeLists.txt") + + hunter_gate_status_debug("Locking directory: ${dir}") + file(LOCK "${dir}" DIRECTORY GUARD FUNCTION) + hunter_gate_status_debug("Lock done") + + if(EXISTS "${done_location}") + # while waiting for lock other instance can do all the job + hunter_gate_status_debug("File '${done_location}' found, skip install") + return() + endif() + + file(REMOVE_RECURSE "${build_dir}") + file(REMOVE_RECURSE "${cmakelists}") + + file(MAKE_DIRECTORY "${build_dir}") # check directory permissions + + # Disabling languages speeds up a little bit, reduces noise in the output + # and avoids path too long windows error + file( + WRITE + "${cmakelists}" + "cmake_minimum_required(VERSION 3.5)\n" + "if(POLICY CMP0114)\n" + " cmake_policy(SET CMP0114 NEW)\n" + "endif()\n" + "if(POLICY CMP0135)\n" + " cmake_policy(SET CMP0135 NEW)\n" + "endif()\n" + "project(HunterDownload LANGUAGES NONE)\n" + "include(ExternalProject)\n" + "ExternalProject_Add(\n" + " Hunter\n" + " URL\n" + " \"${HUNTER_GATE_URL}\"\n" + " URL_HASH\n" + " SHA1=${HUNTER_GATE_SHA1}\n" + " DOWNLOAD_DIR\n" + " \"${dir}\"\n" + " TLS_VERIFY\n" + " ${HUNTER_TLS_VERIFY}\n" + " SOURCE_DIR\n" + " \"${dir}/Unpacked\"\n" + " CONFIGURE_COMMAND\n" + " \"\"\n" + " BUILD_COMMAND\n" + " \"\"\n" + " INSTALL_COMMAND\n" + " \"\"\n" + ")\n" + ) + + if(HUNTER_STATUS_DEBUG) + set(logging_params "") + else() + set(logging_params OUTPUT_QUIET) + endif() + + hunter_gate_status_debug("Run generate") + + # Need to add toolchain file too. + # Otherwise on Visual Studio + MDD this will fail with error: + # "Could not find an appropriate version of the Windows 10 SDK installed on this machine" + if(EXISTS "${CMAKE_TOOLCHAIN_FILE}") + get_filename_component(absolute_CMAKE_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE) + set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=${absolute_CMAKE_TOOLCHAIN_FILE}") + else() + # 'toolchain_arg' can't be empty + set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=") + endif() + + string(COMPARE EQUAL "${CMAKE_MAKE_PROGRAM}" "" no_make) + if(no_make) + set(make_arg "") + else() + # Test case: remove Ninja from PATH but set it via CMAKE_MAKE_PROGRAM + set(make_arg "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}") + endif() + + execute_process( + COMMAND + "${CMAKE_COMMAND}" + "-H${dir}" + "-B${build_dir}" + "-G${CMAKE_GENERATOR}" + "${toolchain_arg}" + ${make_arg} + WORKING_DIRECTORY "${dir}" + RESULT_VARIABLE download_result + ${logging_params} + ) + + if(NOT download_result EQUAL 0) + hunter_gate_internal_error( + "Configure project failed." + "To reproduce the error run: ${CMAKE_COMMAND} -H${dir} -B${build_dir} -G${CMAKE_GENERATOR} ${toolchain_arg} ${make_arg}" + "In directory ${dir}" + ) + endif() + + hunter_gate_status_print( + "Initializing Hunter workspace (${HUNTER_GATE_SHA1})" + " ${HUNTER_GATE_URL}" + " -> ${dir}" + ) + execute_process( + COMMAND "${CMAKE_COMMAND}" --build "${build_dir}" + WORKING_DIRECTORY "${dir}" + RESULT_VARIABLE download_result + ${logging_params} + ) + + if(NOT download_result EQUAL 0) + hunter_gate_internal_error("Build project failed") + endif() + + file(REMOVE_RECURSE "${build_dir}") + file(REMOVE_RECURSE "${cmakelists}") + + file(WRITE "${sha1_location}" "${HUNTER_GATE_SHA1}") + file(WRITE "${done_location}" "DONE") + + hunter_gate_status_debug("Finished") +endfunction() + +# Must be a macro so master file 'cmake/Hunter' can +# apply all variables easily just by 'include' command +# (otherwise PARENT_SCOPE magic needed) +macro(HunterGate) + if(HUNTER_GATE_DONE) + # variable HUNTER_GATE_DONE set explicitly for external project + # (see `hunter_download`) + set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES) + endif() + + # First HunterGate command will init Hunter, others will be ignored + get_property(_hunter_gate_done GLOBAL PROPERTY HUNTER_GATE_DONE SET) + + if(NOT HUNTER_ENABLED) + # Empty function to avoid error "unknown function" + function(hunter_add_package) + endfunction() + + set( + _hunter_gate_disabled_mode_dir + "${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/disabled-mode" + ) + if(EXISTS "${_hunter_gate_disabled_mode_dir}") + hunter_gate_status_debug( + "Adding \"disabled-mode\" modules: ${_hunter_gate_disabled_mode_dir}" + ) + list(APPEND CMAKE_PREFIX_PATH "${_hunter_gate_disabled_mode_dir}") + endif() + elseif(_hunter_gate_done) + hunter_gate_status_debug("Secondary HunterGate (use old settings)") + hunter_gate_self( + "${HUNTER_CACHED_ROOT}" + "${HUNTER_VERSION}" + "${HUNTER_SHA1}" + _hunter_self + ) + include("${_hunter_self}/cmake/Hunter") + else() + set(HUNTER_GATE_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}") + + string(COMPARE NOTEQUAL "${PROJECT_NAME}" "" _have_project_name) + if(_have_project_name) + hunter_gate_fatal_error( + "Please set HunterGate *before* 'project' command. " + "Detected project: ${PROJECT_NAME}" + ERROR_PAGE "error.huntergate.before.project" + ) + endif() + + cmake_parse_arguments( + HUNTER_GATE "LOCAL" "URL;SHA1;GLOBAL;FILEPATH" "" ${ARGV} + ) + + string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" _empty_sha1) + string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" _empty_url) + string( + COMPARE + NOTEQUAL + "${HUNTER_GATE_UNPARSED_ARGUMENTS}" + "" + _have_unparsed + ) + string(COMPARE NOTEQUAL "${HUNTER_GATE_GLOBAL}" "" _have_global) + string(COMPARE NOTEQUAL "${HUNTER_GATE_FILEPATH}" "" _have_filepath) + + if(_have_unparsed) + hunter_gate_user_error( + "HunterGate unparsed arguments: ${HUNTER_GATE_UNPARSED_ARGUMENTS}" + ) + endif() + if(_empty_sha1) + hunter_gate_user_error("SHA1 suboption of HunterGate is mandatory") + endif() + if(_empty_url) + hunter_gate_user_error("URL suboption of HunterGate is mandatory") + endif() + if(_have_global) + if(HUNTER_GATE_LOCAL) + hunter_gate_user_error("Unexpected LOCAL (already has GLOBAL)") + endif() + if(_have_filepath) + hunter_gate_user_error("Unexpected FILEPATH (already has GLOBAL)") + endif() + endif() + if(HUNTER_GATE_LOCAL) + if(_have_global) + hunter_gate_user_error("Unexpected GLOBAL (already has LOCAL)") + endif() + if(_have_filepath) + hunter_gate_user_error("Unexpected FILEPATH (already has LOCAL)") + endif() + endif() + if(_have_filepath) + if(_have_global) + hunter_gate_user_error("Unexpected GLOBAL (already has FILEPATH)") + endif() + if(HUNTER_GATE_LOCAL) + hunter_gate_user_error("Unexpected LOCAL (already has FILEPATH)") + endif() + endif() + + hunter_gate_detect_root() # set HUNTER_GATE_ROOT + + # Beautify path, fix probable problems with windows path slashes + get_filename_component( + HUNTER_GATE_ROOT "${HUNTER_GATE_ROOT}" ABSOLUTE + ) + hunter_gate_status_debug("HUNTER_ROOT: ${HUNTER_GATE_ROOT}") + if(NOT HUNTER_ALLOW_SPACES_IN_PATH) + string(FIND "${HUNTER_GATE_ROOT}" " " _contain_spaces) + if(NOT _contain_spaces EQUAL -1) + hunter_gate_fatal_error( + "HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces." + "Set HUNTER_ALLOW_SPACES_IN_PATH=ON to skip this error" + "(Use at your own risk!)" + ERROR_PAGE "error.spaces.in.hunter.root" + ) + endif() + endif() + + string( + REGEX + MATCH + "[0-9]+\\.[0-9]+\\.[0-9]+[-_a-z0-9]*" + HUNTER_GATE_VERSION + "${HUNTER_GATE_URL}" + ) + string(COMPARE EQUAL "${HUNTER_GATE_VERSION}" "" _is_empty) + if(_is_empty) + set(HUNTER_GATE_VERSION "unknown") + endif() + + hunter_gate_self( + "${HUNTER_GATE_ROOT}" + "${HUNTER_GATE_VERSION}" + "${HUNTER_GATE_SHA1}" + _hunter_self + ) + + set(_master_location "${_hunter_self}/cmake/Hunter") + if(EXISTS "${HUNTER_GATE_ROOT}/cmake/Hunter") + # Hunter downloaded manually (e.g. by 'git clone') + set(_unused "xxxxxxxxxx") + set(HUNTER_GATE_SHA1 "${_unused}") + set(HUNTER_GATE_VERSION "${_unused}") + else() + get_filename_component(_archive_id_location "${_hunter_self}/.." ABSOLUTE) + set(_done_location "${_archive_id_location}/DONE") + set(_sha1_location "${_archive_id_location}/SHA1") + + # Check Hunter already downloaded by HunterGate + if(NOT EXISTS "${_done_location}") + hunter_gate_download("${_archive_id_location}") + endif() + + if(NOT EXISTS "${_done_location}") + hunter_gate_internal_error("hunter_gate_download failed") + endif() + + if(NOT EXISTS "${_sha1_location}") + hunter_gate_internal_error("${_sha1_location} not found") + endif() + file(READ "${_sha1_location}" _sha1_value) + string(TOLOWER "${_sha1_value}" _sha1_value_lower) + string(TOLOWER "${HUNTER_GATE_SHA1}" _HUNTER_GATE_SHA1_lower) + string(COMPARE EQUAL "${_sha1_value_lower}" "${_HUNTER_GATE_SHA1_lower}" _is_equal) + if(NOT _is_equal) + hunter_gate_internal_error( + "Short SHA1 collision:" + " ${_sha1_value} (from ${_sha1_location})" + " ${HUNTER_GATE_SHA1} (HunterGate)" + ) + endif() + if(NOT EXISTS "${_master_location}") + hunter_gate_user_error( + "Master file not found:" + " ${_master_location}" + "try to update Hunter/HunterGate" + ) + endif() + endif() + include("${_master_location}") + set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES) + endif() +endmacro() diff --git a/cmake/cmake-modules b/cmake/cmake-modules deleted file mode 160000 index fb7d2a3f..00000000 --- a/cmake/cmake-modules +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fb7d2a3f9c060b6ce42aa6f8c796b4ba5b0b9dd3 diff --git a/cmake/conan/CMakeLists.txt b/cmake/conan/CMakeLists.txt deleted file mode 100644 index 4899e70e..00000000 --- a/cmake/conan/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Download automatically, you can also just copy the conan.cmake file - -if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake") - message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan") - file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.13/conan.cmake" - "${CMAKE_BINARY_DIR}/conan.cmake") -endif () -include(${CMAKE_BINARY_DIR}/conan.cmake) - -conan_check(REQUIRED) - -conan_cmake_run(CONANFILE conanfile.txt BASIC_SETUP CMAKE_TARGETS BUILD missing) diff --git a/cmake/gtest/CMakeLists.txt b/cmake/gtest/CMakeLists.txt deleted file mode 100644 index 5962ac3e..00000000 --- a/cmake/gtest/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -############################## -# Google Test -# Based on instructions in https://github.com/google/googletest/tree/master/googletest#incorporating-into-an-existing-cmake-project -# Download and unpack googletest at configure time -configure_file(CMakeLists.txt.gtest.in ${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt) - -execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . - RESULT_VARIABLE result - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download) -if (result) - message(FATAL_ERROR "CMake step for googletest failed: ${result}") -endif () - -execute_process(COMMAND ${CMAKE_COMMAND} --build . - RESULT_VARIABLE result - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download) -if (result) - message(FATAL_ERROR "Build step for googletest failed: ${result}") -endif () - -# Prevent overriding the parent project's compiler/linker settings on Windows -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - -add_subdirectory( - ${CMAKE_BINARY_DIR}/googletest-src - ${CMAKE_BINARY_DIR}/googletest-build -) - -if (CMAKE_VERSION VERSION_LESS 2.8.11) - include_directories("${gtest_SOURCE_DIR}/include") - include_directories("${gtest_SOURCE_DIR}/include") -endif () diff --git a/cmake/gtest/CMakeLists.txt.gtest.in b/cmake/gtest/CMakeLists.txt.gtest.in deleted file mode 100644 index b4566319..00000000 --- a/cmake/gtest/CMakeLists.txt.gtest.in +++ /dev/null @@ -1,16 +0,0 @@ -# Based on https://github.com/google/googletest/tree/master/googletest#incorporating-into-an-existing-cmake-project -cmake_minimum_required(VERSION 3.0.0) - -project(googletest-download NONE) - -include(ExternalProject) -ExternalProject_Add(googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG release-1.11.0 - SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" - BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" - TEST_COMMAND "" - ) diff --git a/deps/ledger-secure-sdk b/deps/ledger-secure-sdk new file mode 160000 index 00000000..b46b4b51 --- /dev/null +++ b/deps/ledger-secure-sdk @@ -0,0 +1 @@ +Subproject commit b46b4b516650c08dfe913054dc7535dd52e2503a diff --git a/deps/ledger-zxlib b/deps/ledger-zxlib index 6cc072ab..4b60244c 160000 --- a/deps/ledger-zxlib +++ b/deps/ledger-zxlib @@ -1 +1 @@ -Subproject commit 6cc072ab3a6b863f988d2ed78e0d81cb27d88f7a +Subproject commit 4b60244c489e6d4e0e48a7f38272dadd24415ef6 diff --git a/deps/nanos-secure-sdk b/deps/nanos-secure-sdk deleted file mode 160000 index 48a3e379..00000000 --- a/deps/nanos-secure-sdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 48a3e379c72fe89f1b00f710f90e7adb8f52c6a2 diff --git a/deps/nanosplus-secure-sdk b/deps/nanosplus-secure-sdk deleted file mode 160000 index 0ca6412d..00000000 --- a/deps/nanosplus-secure-sdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0ca6412d0dc5dd2d9789b4f231211f967f041052 diff --git a/deps/nanox-secure-sdk b/deps/nanox-secure-sdk deleted file mode 160000 index 0ca6412d..00000000 --- a/deps/nanox-secure-sdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0ca6412d0dc5dd2d9789b4f231211f967f041052 diff --git a/deps/stax-secure-sdk b/deps/stax-secure-sdk deleted file mode 160000 index 0ca6412d..00000000 --- a/deps/stax-secure-sdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0ca6412d0dc5dd2d9789b4f231211f967f041052 diff --git a/fuzz/parser_parse.cpp b/fuzz/parser_parse.cpp index c518f9b7..2bf3bdf6 100644 --- a/fuzz/parser_parse.cpp +++ b/fuzz/parser_parse.cpp @@ -4,12 +4,10 @@ #include "parser.h" - #ifdef NDEBUG #error "This fuzz target won't work correctly with NDEBUG defined, which will cause asserts to be eliminated" #endif - using std::size_t; static char PARSER_KEY[16384]; @@ -23,38 +21,44 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) parser_error_t rc; rc = parser_parse(&ctx, data, size, &txObj); - if (rc != parser_ok) { + if (rc != parser_ok) + { return 0; } rc = parser_validate(&ctx); - if (rc != parser_ok) { + if (rc != parser_ok) + { return 0; } uint8_t num_items; rc = parser_getNumItems(&num_items); - if (rc != parser_ok) { - fprintf(stderr, - "error in parser_getNumItems: %s\n", - parser_getErrorDescription(rc)); + if (rc != parser_ok) + { + // fprintf(stderr, + // "error in parser_getNumItems: %s\n", + // parser_getErrorDescription(rc)); assert(false); } -// fprintf(stderr, "----------------------------------------------\n"); + // fprintf(stderr, "----------------------------------------------\n"); - for (uint8_t i = 0; i < num_items; i += 1) { + for (uint8_t i = 0; i < num_items; i += 1) + { uint8_t page_idx = 0; uint8_t page_count = 1; - while (page_idx < page_count) { + while (page_idx < page_count) + { rc = parser_getItem(&ctx, i, PARSER_KEY, sizeof(PARSER_KEY), PARSER_VALUE, sizeof(PARSER_VALUE), page_idx, &page_count); -// fprintf(stderr, "%s = %s\n", PARSER_KEY, PARSER_VALUE); + // fprintf(stderr, "%s = %s\n", PARSER_KEY, PARSER_VALUE); - if (rc != parser_ok) { + if (rc != parser_ok) + { fprintf(stderr, "error getting item %u at page index %u: %s\n", (unsigned)i, diff --git a/fuzz/run-fuzz-crashes.py b/fuzz/run-fuzz-crashes.py index d6d32be4..801e1abf 100755 --- a/fuzz/run-fuzz-crashes.py +++ b/fuzz/run-fuzz-crashes.py @@ -20,7 +20,7 @@ artifact_dir = os.path.join('fuzz', 'corpora', f'{fuzzer}-artifacts') corpus_dir = os.path.join('fuzz', 'corpora', f'{fuzzer}') - fuzz_path = os.path.join(f'build/bin/fuzz-{fuzzer}') + fuzz_path = os.path.join(f'build/fuzz-{fuzzer}') os.makedirs(artifact_dir, exist_ok=True) os.makedirs(corpus_dir, exist_ok=True) @@ -37,5 +37,3 @@ error_code = subprocess.call(cmd, env=env) if error_code != 0: exit(error_code) - - diff --git a/fuzz/run-fuzzers.py b/fuzz/run-fuzzers.py index 39377532..4fc927b9 100755 --- a/fuzz/run-fuzzers.py +++ b/fuzz/run-fuzzers.py @@ -20,7 +20,7 @@ artifact_dir = os.path.join('fuzz', 'corpora', f'{fuzzer}-artifacts') corpus_dir = os.path.join('fuzz', 'corpora', f'{fuzzer}') - fuzz_path = os.path.join(f'build/bin/fuzz-{fuzzer}') + fuzz_path = os.path.join(f'build/fuzz-{fuzzer}') os.makedirs(artifact_dir, exist_ok=True) os.makedirs(corpus_dir, exist_ok=True) diff --git a/ledger_app.toml b/ledger_app.toml index 3e4cbb1f..7f63dfec 100644 --- a/ledger_app.toml +++ b/ledger_app.toml @@ -1,7 +1,7 @@ [app] build_directory = "./app/" sdk = "C" -devices = ["nanos", "nanox", "nanos+", "stax"] +devices = ["nanos", "nanox", "nanos+", "stax", "flex"] [tests] unit_directory = "./tests/" diff --git a/tests_zemu/package.json b/tests_zemu/package.json index 2c23916e..2f80962a 100644 --- a/tests_zemu/package.json +++ b/tests_zemu/package.json @@ -19,20 +19,20 @@ }, "dependencies": { "@zondax/ledger-algorand": "../js", - "@zondax/zemu": "^0.46.2" + "@zondax/zemu": "^0.50.2" }, "devDependencies": { "@types/jest": "^29.4.0", "@types/ledgerhq__hw-transport": "^4.21.4", - "@typescript-eslint/eslint-plugin": "^6.7.2", - "@typescript-eslint/parser": "^6.7.2", + "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/parser": "^7.17.0", "blakejs": "^1.1.1", "crypto-js": "4.2.0", "ed25519-supercop": "^2.0.1", - "eslint": "^8.34.0", + "eslint": "^9.7.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.24.2", - "eslint-plugin-jest": "^27.2.1", + "eslint-plugin-jest": "^28.6.0", "eslint-plugin-prettier": "^5.0.0", "jest": "29.7.0", "jssha": "^3.2.0", diff --git a/tests_zemu/snapshots/fl-mainmenu/00000.png b/tests_zemu/snapshots/fl-mainmenu/00000.png new file mode 100644 index 00000000..f2af62bc Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00000.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00001.png b/tests_zemu/snapshots/fl-mainmenu/00001.png new file mode 100644 index 00000000..daa33758 Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00002.png b/tests_zemu/snapshots/fl-mainmenu/00002.png new file mode 100644 index 00000000..35c42663 Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00002.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00003.png b/tests_zemu/snapshots/fl-mainmenu/00003.png new file mode 100644 index 00000000..daa33758 Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00003.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00004.png b/tests_zemu/snapshots/fl-mainmenu/00004.png new file mode 100644 index 00000000..eecf1f3c Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00005.png b/tests_zemu/snapshots/fl-mainmenu/00005.png new file mode 100644 index 00000000..187adf2a Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00005.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00006.png b/tests_zemu/snapshots/fl-mainmenu/00006.png new file mode 100644 index 00000000..f2af62bc Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00006.png differ diff --git a/tests_zemu/snapshots/fl-show_address/00000.png b/tests_zemu/snapshots/fl-show_address/00000.png new file mode 100644 index 00000000..a9b03c5f Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address/00000.png differ diff --git a/tests_zemu/snapshots/fl-show_address/00001.png b/tests_zemu/snapshots/fl-show_address/00001.png new file mode 100644 index 00000000..748a6dbf Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address/00001.png differ diff --git a/tests_zemu/snapshots/fl-show_address/00002.png b/tests_zemu/snapshots/fl-show_address/00002.png new file mode 100644 index 00000000..f2af62bc Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address/00002.png differ diff --git a/tests_zemu/snapshots/fl-show_address_reject/00000.png b/tests_zemu/snapshots/fl-show_address_reject/00000.png new file mode 100644 index 00000000..a9b03c5f Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address_reject/00000.png differ diff --git a/tests_zemu/snapshots/fl-show_address_reject/00001.png b/tests_zemu/snapshots/fl-show_address_reject/00001.png new file mode 100644 index 00000000..748a6dbf Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address_reject/00001.png differ diff --git a/tests_zemu/snapshots/fl-show_address_reject/00002.png b/tests_zemu/snapshots/fl-show_address_reject/00002.png new file mode 100644 index 00000000..45c08d4e Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address_reject/00002.png differ diff --git a/tests_zemu/snapshots/fl-show_address_reject/00003.png b/tests_zemu/snapshots/fl-show_address_reject/00003.png new file mode 100644 index 00000000..f2af62bc Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address_reject/00003.png differ diff --git a/tests_zemu/snapshots/fl-sign_application/00000.png b/tests_zemu/snapshots/fl-sign_application/00000.png new file mode 100644 index 00000000..5bf7b711 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application/00000.png differ diff --git a/tests_zemu/snapshots/fl-sign_application/00001.png b/tests_zemu/snapshots/fl-sign_application/00001.png new file mode 100644 index 00000000..e1cc0028 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application/00001.png differ diff --git a/tests_zemu/snapshots/fl-sign_application/00002.png b/tests_zemu/snapshots/fl-sign_application/00002.png new file mode 100644 index 00000000..de4e1096 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application/00002.png differ diff --git a/tests_zemu/snapshots/fl-sign_application/00003.png b/tests_zemu/snapshots/fl-sign_application/00003.png new file mode 100644 index 00000000..c0cfbb9e Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application/00003.png differ diff --git a/tests_zemu/snapshots/fl-sign_application/00004.png b/tests_zemu/snapshots/fl-sign_application/00004.png new file mode 100644 index 00000000..47cc4f50 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application/00004.png differ diff --git a/tests_zemu/snapshots/fl-sign_application/00005.png b/tests_zemu/snapshots/fl-sign_application/00005.png new file mode 100644 index 00000000..1ae42cf9 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application/00005.png differ diff --git a/tests_zemu/snapshots/fl-sign_application/00006.png b/tests_zemu/snapshots/fl-sign_application/00006.png new file mode 100644 index 00000000..2c82a616 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application/00006.png differ diff --git a/tests_zemu/snapshots/fl-sign_application/00007.png b/tests_zemu/snapshots/fl-sign_application/00007.png new file mode 100644 index 00000000..27b412e2 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application/00007.png differ diff --git a/tests_zemu/snapshots/fl-sign_application/00008.png b/tests_zemu/snapshots/fl-sign_application/00008.png new file mode 100644 index 00000000..f2af62bc Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application/00008.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00000.png b/tests_zemu/snapshots/fl-sign_application_big/00000.png new file mode 100644 index 00000000..a18ffbd5 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00000.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00001.png b/tests_zemu/snapshots/fl-sign_application_big/00001.png new file mode 100644 index 00000000..a95cce44 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00001.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00002.png b/tests_zemu/snapshots/fl-sign_application_big/00002.png new file mode 100644 index 00000000..adc0af05 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00002.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00003.png b/tests_zemu/snapshots/fl-sign_application_big/00003.png new file mode 100644 index 00000000..20994c02 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00003.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00004.png b/tests_zemu/snapshots/fl-sign_application_big/00004.png new file mode 100644 index 00000000..55b9a8df Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00004.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00005.png b/tests_zemu/snapshots/fl-sign_application_big/00005.png new file mode 100644 index 00000000..103de0be Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00005.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00006.png b/tests_zemu/snapshots/fl-sign_application_big/00006.png new file mode 100644 index 00000000..47bd9d49 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00006.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00007.png b/tests_zemu/snapshots/fl-sign_application_big/00007.png new file mode 100644 index 00000000..d211a6a9 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00007.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00008.png b/tests_zemu/snapshots/fl-sign_application_big/00008.png new file mode 100644 index 00000000..daed6290 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00008.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00009.png b/tests_zemu/snapshots/fl-sign_application_big/00009.png new file mode 100644 index 00000000..d545371f Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00009.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00010.png b/tests_zemu/snapshots/fl-sign_application_big/00010.png new file mode 100644 index 00000000..c8a4a8b6 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00010.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00011.png b/tests_zemu/snapshots/fl-sign_application_big/00011.png new file mode 100644 index 00000000..ce282d9c Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00011.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00012.png b/tests_zemu/snapshots/fl-sign_application_big/00012.png new file mode 100644 index 00000000..fd26617e Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00012.png differ diff --git a/tests_zemu/snapshots/fl-sign_application_big/00013.png b/tests_zemu/snapshots/fl-sign_application_big/00013.png new file mode 100644 index 00000000..f2af62bc Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_application_big/00013.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_config/00000.png b/tests_zemu/snapshots/fl-sign_asset_config/00000.png new file mode 100644 index 00000000..dc72ad38 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_config/00000.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_config/00001.png b/tests_zemu/snapshots/fl-sign_asset_config/00001.png new file mode 100644 index 00000000..949efc7d Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_config/00001.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_config/00002.png b/tests_zemu/snapshots/fl-sign_asset_config/00002.png new file mode 100644 index 00000000..517ca764 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_config/00002.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_config/00003.png b/tests_zemu/snapshots/fl-sign_asset_config/00003.png new file mode 100644 index 00000000..6b529dcb Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_config/00003.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_config/00004.png b/tests_zemu/snapshots/fl-sign_asset_config/00004.png new file mode 100644 index 00000000..edc4049c Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_config/00004.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_config/00005.png b/tests_zemu/snapshots/fl-sign_asset_config/00005.png new file mode 100644 index 00000000..06378a97 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_config/00005.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_config/00006.png b/tests_zemu/snapshots/fl-sign_asset_config/00006.png new file mode 100644 index 00000000..f2af62bc Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_config/00006.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_freeze/00000.png b/tests_zemu/snapshots/fl-sign_asset_freeze/00000.png new file mode 100644 index 00000000..74720b48 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_freeze/00000.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_freeze/00001.png b/tests_zemu/snapshots/fl-sign_asset_freeze/00001.png new file mode 100644 index 00000000..fab3c0ad Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_freeze/00001.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_freeze/00002.png b/tests_zemu/snapshots/fl-sign_asset_freeze/00002.png new file mode 100644 index 00000000..01339865 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_freeze/00002.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_freeze/00003.png b/tests_zemu/snapshots/fl-sign_asset_freeze/00003.png new file mode 100644 index 00000000..5c014fec Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_freeze/00003.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_freeze/00004.png b/tests_zemu/snapshots/fl-sign_asset_freeze/00004.png new file mode 100644 index 00000000..072f5ca0 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_freeze/00004.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_freeze/00005.png b/tests_zemu/snapshots/fl-sign_asset_freeze/00005.png new file mode 100644 index 00000000..f2af62bc Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_freeze/00005.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_transfer/00000.png b/tests_zemu/snapshots/fl-sign_asset_transfer/00000.png new file mode 100644 index 00000000..74720b48 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_transfer/00000.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_transfer/00001.png b/tests_zemu/snapshots/fl-sign_asset_transfer/00001.png new file mode 100644 index 00000000..6ff4309c Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_transfer/00001.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_transfer/00002.png b/tests_zemu/snapshots/fl-sign_asset_transfer/00002.png new file mode 100644 index 00000000..95c0e2a3 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_transfer/00002.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_transfer/00003.png b/tests_zemu/snapshots/fl-sign_asset_transfer/00003.png new file mode 100644 index 00000000..b29c2cf8 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_transfer/00003.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_transfer/00004.png b/tests_zemu/snapshots/fl-sign_asset_transfer/00004.png new file mode 100644 index 00000000..072f5ca0 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_transfer/00004.png differ diff --git a/tests_zemu/snapshots/fl-sign_asset_transfer/00005.png b/tests_zemu/snapshots/fl-sign_asset_transfer/00005.png new file mode 100644 index 00000000..f2af62bc Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_asset_transfer/00005.png differ diff --git a/tests_zemu/snapshots/fl-sign_keyreg/00000.png b/tests_zemu/snapshots/fl-sign_keyreg/00000.png new file mode 100644 index 00000000..16d7a4d8 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_keyreg/00000.png differ diff --git a/tests_zemu/snapshots/fl-sign_keyreg/00001.png b/tests_zemu/snapshots/fl-sign_keyreg/00001.png new file mode 100644 index 00000000..64519897 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_keyreg/00001.png differ diff --git a/tests_zemu/snapshots/fl-sign_keyreg/00002.png b/tests_zemu/snapshots/fl-sign_keyreg/00002.png new file mode 100644 index 00000000..6c86d3d3 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_keyreg/00002.png differ diff --git a/tests_zemu/snapshots/fl-sign_keyreg/00003.png b/tests_zemu/snapshots/fl-sign_keyreg/00003.png new file mode 100644 index 00000000..394d766e Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_keyreg/00003.png differ diff --git a/tests_zemu/snapshots/fl-sign_keyreg/00004.png b/tests_zemu/snapshots/fl-sign_keyreg/00004.png new file mode 100644 index 00000000..bd1552c1 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_keyreg/00004.png differ diff --git a/tests_zemu/snapshots/fl-sign_keyreg/00005.png b/tests_zemu/snapshots/fl-sign_keyreg/00005.png new file mode 100644 index 00000000..822beff0 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_keyreg/00005.png differ diff --git a/tests_zemu/snapshots/fl-sign_keyreg/00006.png b/tests_zemu/snapshots/fl-sign_keyreg/00006.png new file mode 100644 index 00000000..35d03b84 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_keyreg/00006.png differ diff --git a/tests_zemu/snapshots/fl-sign_keyreg/00007.png b/tests_zemu/snapshots/fl-sign_keyreg/00007.png new file mode 100644 index 00000000..f2af62bc Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_keyreg/00007.png differ diff --git a/tests_zemu/snapshots/fl-sign_payment/00000.png b/tests_zemu/snapshots/fl-sign_payment/00000.png new file mode 100644 index 00000000..dc72ad38 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_payment/00000.png differ diff --git a/tests_zemu/snapshots/fl-sign_payment/00001.png b/tests_zemu/snapshots/fl-sign_payment/00001.png new file mode 100644 index 00000000..4d37cd70 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_payment/00001.png differ diff --git a/tests_zemu/snapshots/fl-sign_payment/00002.png b/tests_zemu/snapshots/fl-sign_payment/00002.png new file mode 100644 index 00000000..e86deb45 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_payment/00002.png differ diff --git a/tests_zemu/snapshots/fl-sign_payment/00003.png b/tests_zemu/snapshots/fl-sign_payment/00003.png new file mode 100644 index 00000000..6fe3e311 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_payment/00003.png differ diff --git a/tests_zemu/snapshots/fl-sign_payment/00004.png b/tests_zemu/snapshots/fl-sign_payment/00004.png new file mode 100644 index 00000000..c47019c4 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_payment/00004.png differ diff --git a/tests_zemu/snapshots/fl-sign_payment/00005.png b/tests_zemu/snapshots/fl-sign_payment/00005.png new file mode 100644 index 00000000..06378a97 Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_payment/00005.png differ diff --git a/tests_zemu/snapshots/fl-sign_payment/00006.png b/tests_zemu/snapshots/fl-sign_payment/00006.png new file mode 100644 index 00000000..f2af62bc Binary files /dev/null and b/tests_zemu/snapshots/fl-sign_payment/00006.png differ diff --git a/tests_zemu/snapshots/s-mainmenu/00005.png b/tests_zemu/snapshots/s-mainmenu/00005.png index 51715eb9..107c4aec 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00005.png and b/tests_zemu/snapshots/s-mainmenu/00005.png differ diff --git a/tests_zemu/snapshots/s-mainmenu/00011.png b/tests_zemu/snapshots/s-mainmenu/00011.png index 51715eb9..107c4aec 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00011.png and b/tests_zemu/snapshots/s-mainmenu/00011.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00005.png b/tests_zemu/snapshots/sp-mainmenu/00005.png index 5e953ef4..89611bec 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00005.png and b/tests_zemu/snapshots/sp-mainmenu/00005.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00011.png b/tests_zemu/snapshots/sp-mainmenu/00011.png index 5e953ef4..89611bec 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00011.png and b/tests_zemu/snapshots/sp-mainmenu/00011.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00000.png b/tests_zemu/snapshots/st-mainmenu/00000.png index 242650df..835a1669 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00000.png and b/tests_zemu/snapshots/st-mainmenu/00000.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00001.png b/tests_zemu/snapshots/st-mainmenu/00001.png index cb738e2e..17e7e60a 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00001.png and b/tests_zemu/snapshots/st-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00002.png b/tests_zemu/snapshots/st-mainmenu/00002.png index b6537f2a..14718b1c 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00002.png and b/tests_zemu/snapshots/st-mainmenu/00002.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00003.png b/tests_zemu/snapshots/st-mainmenu/00003.png index 2520fe76..17e7e60a 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00003.png and b/tests_zemu/snapshots/st-mainmenu/00003.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00004.png b/tests_zemu/snapshots/st-mainmenu/00004.png index b6537f2a..81d8e424 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00004.png and b/tests_zemu/snapshots/st-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00005.png b/tests_zemu/snapshots/st-mainmenu/00005.png index 242650df..fc008a4e 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00005.png and b/tests_zemu/snapshots/st-mainmenu/00005.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00006.png b/tests_zemu/snapshots/st-mainmenu/00006.png new file mode 100644 index 00000000..835a1669 Binary files /dev/null and b/tests_zemu/snapshots/st-mainmenu/00006.png differ diff --git a/tests_zemu/snapshots/st-show_address/00000.png b/tests_zemu/snapshots/st-show_address/00000.png index 9ccae940..2974f490 100644 Binary files a/tests_zemu/snapshots/st-show_address/00000.png and b/tests_zemu/snapshots/st-show_address/00000.png differ diff --git a/tests_zemu/snapshots/st-show_address/00001.png b/tests_zemu/snapshots/st-show_address/00001.png index 50775e27..46748a03 100644 Binary files a/tests_zemu/snapshots/st-show_address/00001.png and b/tests_zemu/snapshots/st-show_address/00001.png differ diff --git a/tests_zemu/snapshots/st-show_address/00002.png b/tests_zemu/snapshots/st-show_address/00002.png index 242650df..835a1669 100644 Binary files a/tests_zemu/snapshots/st-show_address/00002.png and b/tests_zemu/snapshots/st-show_address/00002.png differ diff --git a/tests_zemu/snapshots/st-show_address_reject/00000.png b/tests_zemu/snapshots/st-show_address_reject/00000.png index 9ccae940..2974f490 100644 Binary files a/tests_zemu/snapshots/st-show_address_reject/00000.png and b/tests_zemu/snapshots/st-show_address_reject/00000.png differ diff --git a/tests_zemu/snapshots/st-show_address_reject/00001.png b/tests_zemu/snapshots/st-show_address_reject/00001.png index 50775e27..46748a03 100644 Binary files a/tests_zemu/snapshots/st-show_address_reject/00001.png and b/tests_zemu/snapshots/st-show_address_reject/00001.png differ diff --git a/tests_zemu/snapshots/st-show_address_reject/00002.png b/tests_zemu/snapshots/st-show_address_reject/00002.png index 8c5f472e..94c91bb6 100644 Binary files a/tests_zemu/snapshots/st-show_address_reject/00002.png and b/tests_zemu/snapshots/st-show_address_reject/00002.png differ diff --git a/tests_zemu/snapshots/st-show_address_reject/00003.png b/tests_zemu/snapshots/st-show_address_reject/00003.png index 242650df..835a1669 100644 Binary files a/tests_zemu/snapshots/st-show_address_reject/00003.png and b/tests_zemu/snapshots/st-show_address_reject/00003.png differ diff --git a/tests_zemu/snapshots/st-sign_application/00000.png b/tests_zemu/snapshots/st-sign_application/00000.png index 0dc8df57..efa3e6bf 100644 Binary files a/tests_zemu/snapshots/st-sign_application/00000.png and b/tests_zemu/snapshots/st-sign_application/00000.png differ diff --git a/tests_zemu/snapshots/st-sign_application/00001.png b/tests_zemu/snapshots/st-sign_application/00001.png index 3a131411..e0ed1a4c 100644 Binary files a/tests_zemu/snapshots/st-sign_application/00001.png and b/tests_zemu/snapshots/st-sign_application/00001.png differ diff --git a/tests_zemu/snapshots/st-sign_application/00002.png b/tests_zemu/snapshots/st-sign_application/00002.png index 4bf4b659..02b9e5d9 100644 Binary files a/tests_zemu/snapshots/st-sign_application/00002.png and b/tests_zemu/snapshots/st-sign_application/00002.png differ diff --git a/tests_zemu/snapshots/st-sign_application/00003.png b/tests_zemu/snapshots/st-sign_application/00003.png index 66c1bb01..6a557afa 100644 Binary files a/tests_zemu/snapshots/st-sign_application/00003.png and b/tests_zemu/snapshots/st-sign_application/00003.png differ diff --git a/tests_zemu/snapshots/st-sign_application/00004.png b/tests_zemu/snapshots/st-sign_application/00004.png index da48688c..19569d20 100644 Binary files a/tests_zemu/snapshots/st-sign_application/00004.png and b/tests_zemu/snapshots/st-sign_application/00004.png differ diff --git a/tests_zemu/snapshots/st-sign_application/00005.png b/tests_zemu/snapshots/st-sign_application/00005.png index 1f1de19e..f85614dd 100644 Binary files a/tests_zemu/snapshots/st-sign_application/00005.png and b/tests_zemu/snapshots/st-sign_application/00005.png differ diff --git a/tests_zemu/snapshots/st-sign_application/00006.png b/tests_zemu/snapshots/st-sign_application/00006.png index 62578379..d49be38e 100644 Binary files a/tests_zemu/snapshots/st-sign_application/00006.png and b/tests_zemu/snapshots/st-sign_application/00006.png differ diff --git a/tests_zemu/snapshots/st-sign_application/00007.png b/tests_zemu/snapshots/st-sign_application/00007.png index f27b581a..835a1669 100644 Binary files a/tests_zemu/snapshots/st-sign_application/00007.png and b/tests_zemu/snapshots/st-sign_application/00007.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00000.png b/tests_zemu/snapshots/st-sign_application_big/00000.png index 0dc8df57..6d605f5b 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00000.png and b/tests_zemu/snapshots/st-sign_application_big/00000.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00001.png b/tests_zemu/snapshots/st-sign_application_big/00001.png index 8cd03529..e92dcebb 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00001.png and b/tests_zemu/snapshots/st-sign_application_big/00001.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00002.png b/tests_zemu/snapshots/st-sign_application_big/00002.png index 0d2b2628..c3e04ef7 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00002.png and b/tests_zemu/snapshots/st-sign_application_big/00002.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00003.png b/tests_zemu/snapshots/st-sign_application_big/00003.png index 9ea4ac67..d7c5082f 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00003.png and b/tests_zemu/snapshots/st-sign_application_big/00003.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00004.png b/tests_zemu/snapshots/st-sign_application_big/00004.png index 5024dbac..4961d872 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00004.png and b/tests_zemu/snapshots/st-sign_application_big/00004.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00005.png b/tests_zemu/snapshots/st-sign_application_big/00005.png index 1ff10512..043d8bb8 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00005.png and b/tests_zemu/snapshots/st-sign_application_big/00005.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00006.png b/tests_zemu/snapshots/st-sign_application_big/00006.png index 45e013ab..d366d649 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00006.png and b/tests_zemu/snapshots/st-sign_application_big/00006.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00007.png b/tests_zemu/snapshots/st-sign_application_big/00007.png index ace72919..3cc7e33f 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00007.png and b/tests_zemu/snapshots/st-sign_application_big/00007.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00008.png b/tests_zemu/snapshots/st-sign_application_big/00008.png index 9d1c4e08..cd67cee1 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00008.png and b/tests_zemu/snapshots/st-sign_application_big/00008.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00009.png b/tests_zemu/snapshots/st-sign_application_big/00009.png index 83df0b9d..fb584f97 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00009.png and b/tests_zemu/snapshots/st-sign_application_big/00009.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00010.png b/tests_zemu/snapshots/st-sign_application_big/00010.png index caeb9fa8..1d3bec01 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00010.png and b/tests_zemu/snapshots/st-sign_application_big/00010.png differ diff --git a/tests_zemu/snapshots/st-sign_application_big/00011.png b/tests_zemu/snapshots/st-sign_application_big/00011.png index 7a2dca6e..835a1669 100644 Binary files a/tests_zemu/snapshots/st-sign_application_big/00011.png and b/tests_zemu/snapshots/st-sign_application_big/00011.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_config/00000.png b/tests_zemu/snapshots/st-sign_asset_config/00000.png index efbcc120..c87e48f7 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_config/00000.png and b/tests_zemu/snapshots/st-sign_asset_config/00000.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_config/00001.png b/tests_zemu/snapshots/st-sign_asset_config/00001.png index 9b178b5d..af47fda5 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_config/00001.png and b/tests_zemu/snapshots/st-sign_asset_config/00001.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_config/00002.png b/tests_zemu/snapshots/st-sign_asset_config/00002.png index 583bab37..a072b3d1 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_config/00002.png and b/tests_zemu/snapshots/st-sign_asset_config/00002.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_config/00003.png b/tests_zemu/snapshots/st-sign_asset_config/00003.png index 2107a5ea..107f1dae 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_config/00003.png and b/tests_zemu/snapshots/st-sign_asset_config/00003.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_config/00004.png b/tests_zemu/snapshots/st-sign_asset_config/00004.png index 59cd513c..c514589d 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_config/00004.png and b/tests_zemu/snapshots/st-sign_asset_config/00004.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_config/00005.png b/tests_zemu/snapshots/st-sign_asset_config/00005.png index cbbe1012..5e348f8e 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_config/00005.png and b/tests_zemu/snapshots/st-sign_asset_config/00005.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_config/00006.png b/tests_zemu/snapshots/st-sign_asset_config/00006.png index 4026f35a..835a1669 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_config/00006.png and b/tests_zemu/snapshots/st-sign_asset_config/00006.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_freeze/00000.png b/tests_zemu/snapshots/st-sign_asset_freeze/00000.png index 1ebd90a1..6e1522b6 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_freeze/00000.png and b/tests_zemu/snapshots/st-sign_asset_freeze/00000.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_freeze/00001.png b/tests_zemu/snapshots/st-sign_asset_freeze/00001.png index 53247c13..779237e6 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_freeze/00001.png and b/tests_zemu/snapshots/st-sign_asset_freeze/00001.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_freeze/00002.png b/tests_zemu/snapshots/st-sign_asset_freeze/00002.png index 537cdbea..5d1c5636 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_freeze/00002.png and b/tests_zemu/snapshots/st-sign_asset_freeze/00002.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_freeze/00003.png b/tests_zemu/snapshots/st-sign_asset_freeze/00003.png index df50a0f8..b8162631 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_freeze/00003.png and b/tests_zemu/snapshots/st-sign_asset_freeze/00003.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_freeze/00004.png b/tests_zemu/snapshots/st-sign_asset_freeze/00004.png index 2dddbbc6..b131b60f 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_freeze/00004.png and b/tests_zemu/snapshots/st-sign_asset_freeze/00004.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_freeze/00005.png b/tests_zemu/snapshots/st-sign_asset_freeze/00005.png index 242650df..835a1669 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_freeze/00005.png and b/tests_zemu/snapshots/st-sign_asset_freeze/00005.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_transfer/00000.png b/tests_zemu/snapshots/st-sign_asset_transfer/00000.png index bed6540b..6e1522b6 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_transfer/00000.png and b/tests_zemu/snapshots/st-sign_asset_transfer/00000.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_transfer/00001.png b/tests_zemu/snapshots/st-sign_asset_transfer/00001.png index 5f1df91d..ee5f86d1 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_transfer/00001.png and b/tests_zemu/snapshots/st-sign_asset_transfer/00001.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_transfer/00002.png b/tests_zemu/snapshots/st-sign_asset_transfer/00002.png index bb473225..92335576 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_transfer/00002.png and b/tests_zemu/snapshots/st-sign_asset_transfer/00002.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_transfer/00003.png b/tests_zemu/snapshots/st-sign_asset_transfer/00003.png index 9616ad5e..7656e2f5 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_transfer/00003.png and b/tests_zemu/snapshots/st-sign_asset_transfer/00003.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_transfer/00004.png b/tests_zemu/snapshots/st-sign_asset_transfer/00004.png index 2dddbbc6..b131b60f 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_transfer/00004.png and b/tests_zemu/snapshots/st-sign_asset_transfer/00004.png differ diff --git a/tests_zemu/snapshots/st-sign_asset_transfer/00005.png b/tests_zemu/snapshots/st-sign_asset_transfer/00005.png index 242650df..835a1669 100644 Binary files a/tests_zemu/snapshots/st-sign_asset_transfer/00005.png and b/tests_zemu/snapshots/st-sign_asset_transfer/00005.png differ diff --git a/tests_zemu/snapshots/st-sign_keyreg/00000.png b/tests_zemu/snapshots/st-sign_keyreg/00000.png index 94badee6..c87e48f7 100644 Binary files a/tests_zemu/snapshots/st-sign_keyreg/00000.png and b/tests_zemu/snapshots/st-sign_keyreg/00000.png differ diff --git a/tests_zemu/snapshots/st-sign_keyreg/00001.png b/tests_zemu/snapshots/st-sign_keyreg/00001.png index 8b79be11..d6120b1f 100644 Binary files a/tests_zemu/snapshots/st-sign_keyreg/00001.png and b/tests_zemu/snapshots/st-sign_keyreg/00001.png differ diff --git a/tests_zemu/snapshots/st-sign_keyreg/00002.png b/tests_zemu/snapshots/st-sign_keyreg/00002.png index 0900c6dc..dd814ccd 100644 Binary files a/tests_zemu/snapshots/st-sign_keyreg/00002.png and b/tests_zemu/snapshots/st-sign_keyreg/00002.png differ diff --git a/tests_zemu/snapshots/st-sign_keyreg/00003.png b/tests_zemu/snapshots/st-sign_keyreg/00003.png index c4ef7ab0..9fec75c5 100644 Binary files a/tests_zemu/snapshots/st-sign_keyreg/00003.png and b/tests_zemu/snapshots/st-sign_keyreg/00003.png differ diff --git a/tests_zemu/snapshots/st-sign_keyreg/00004.png b/tests_zemu/snapshots/st-sign_keyreg/00004.png index 137283ff..f325504a 100644 Binary files a/tests_zemu/snapshots/st-sign_keyreg/00004.png and b/tests_zemu/snapshots/st-sign_keyreg/00004.png differ diff --git a/tests_zemu/snapshots/st-sign_keyreg/00005.png b/tests_zemu/snapshots/st-sign_keyreg/00005.png index 7aee8c05..5e348f8e 100644 Binary files a/tests_zemu/snapshots/st-sign_keyreg/00005.png and b/tests_zemu/snapshots/st-sign_keyreg/00005.png differ diff --git a/tests_zemu/snapshots/st-sign_keyreg/00006.png b/tests_zemu/snapshots/st-sign_keyreg/00006.png index c5d25e74..835a1669 100644 Binary files a/tests_zemu/snapshots/st-sign_keyreg/00006.png and b/tests_zemu/snapshots/st-sign_keyreg/00006.png differ diff --git a/tests_zemu/snapshots/st-sign_payment/00000.png b/tests_zemu/snapshots/st-sign_payment/00000.png index dcf7a588..6e1522b6 100644 Binary files a/tests_zemu/snapshots/st-sign_payment/00000.png and b/tests_zemu/snapshots/st-sign_payment/00000.png differ diff --git a/tests_zemu/snapshots/st-sign_payment/00001.png b/tests_zemu/snapshots/st-sign_payment/00001.png index 88633f71..34581e29 100644 Binary files a/tests_zemu/snapshots/st-sign_payment/00001.png and b/tests_zemu/snapshots/st-sign_payment/00001.png differ diff --git a/tests_zemu/snapshots/st-sign_payment/00002.png b/tests_zemu/snapshots/st-sign_payment/00002.png index eaa3a1e1..d736e206 100644 Binary files a/tests_zemu/snapshots/st-sign_payment/00002.png and b/tests_zemu/snapshots/st-sign_payment/00002.png differ diff --git a/tests_zemu/snapshots/st-sign_payment/00003.png b/tests_zemu/snapshots/st-sign_payment/00003.png index fb78cd7e..6a46137f 100644 Binary files a/tests_zemu/snapshots/st-sign_payment/00003.png and b/tests_zemu/snapshots/st-sign_payment/00003.png differ diff --git a/tests_zemu/snapshots/st-sign_payment/00004.png b/tests_zemu/snapshots/st-sign_payment/00004.png index a215b314..b131b60f 100644 Binary files a/tests_zemu/snapshots/st-sign_payment/00004.png and b/tests_zemu/snapshots/st-sign_payment/00004.png differ diff --git a/tests_zemu/snapshots/st-sign_payment/00005.png b/tests_zemu/snapshots/st-sign_payment/00005.png index 4d6a7e6a..835a1669 100644 Binary files a/tests_zemu/snapshots/st-sign_payment/00005.png and b/tests_zemu/snapshots/st-sign_payment/00005.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00005.png b/tests_zemu/snapshots/x-mainmenu/00005.png index 5e953ef4..89611bec 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00005.png and b/tests_zemu/snapshots/x-mainmenu/00005.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00011.png b/tests_zemu/snapshots/x-mainmenu/00011.png index 5e953ef4..89611bec 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00011.png and b/tests_zemu/snapshots/x-mainmenu/00011.png differ diff --git a/tests_zemu/tests/common.ts b/tests_zemu/tests/common.ts index 5e7722cc..058bc341 100644 --- a/tests_zemu/tests/common.ts +++ b/tests_zemu/tests/common.ts @@ -8,12 +8,14 @@ const APP_PATH_S = resolve('../app/output/app_s.elf') const APP_PATH_X = resolve('../app/output/app_x.elf') const APP_PATH_SP = resolve('../app/output/app_s2.elf') const APP_PATH_ST = resolve('../app/output/app_stax.elf') +const APP_PATH_FL = resolve('../app/output/app_flex.elf') export const models: IDeviceModel[] = [ { name: 'nanos', prefix: 'S', path: APP_PATH_S }, { name: 'nanox', prefix: 'X', path: APP_PATH_X }, { name: 'nanosp', prefix: 'SP', path: APP_PATH_SP }, { name: 'stax', prefix: 'ST', path: APP_PATH_ST }, + { name: 'flex', prefix: 'FL', path: APP_PATH_FL }, ] export const txAssetFreeze = [ diff --git a/tests_zemu/tests/standard.test.ts b/tests_zemu/tests/standard.test.ts index 59853ee8..2a844dea 100644 --- a/tests_zemu/tests/standard.test.ts +++ b/tests_zemu/tests/standard.test.ts @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************* */ -import Zemu, { zondaxMainmenuNavigation, DEFAULT_START_OPTIONS, ButtonKind } from '@zondax/zemu' +import Zemu, { zondaxMainmenuNavigation, DEFAULT_START_OPTIONS, ButtonKind, isTouchDevice } from '@zondax/zemu' // @ts-ignore import AlgorandApp from '@zondax/ledger-algorand' import { APP_SEED, models, txApplication, txAssetConfig, txAssetFreeze, txAssetXfer, txKeyreg, txPayment } from './common' @@ -126,8 +126,8 @@ describe('Standard', function () { await sim.start({ ...defaultOptions, model: m.name, - approveKeyword: m.name === 'stax' ? 'Show as QR' : '', - approveAction: ButtonKind.ApproveTapButton, + approveKeyword: isTouchDevice(m.name) ? 'Confirm' : '', + approveAction: ButtonKind.DynamicTapButton, }) const app = new AlgorandApp(sim.getTransport()) @@ -152,7 +152,7 @@ describe('Standard', function () { await sim.start({ ...defaultOptions, model: m.name, - rejectKeyword: m.name === 'stax' ? 'Show as QR' : '', + rejectKeyword: isTouchDevice(m.name) ? 'Confirm' : '', }) const app = new AlgorandApp(sim.getTransport())