From 1d8a0070ef15be04c48705cca9630aa32af650c1 Mon Sep 17 00:00:00 2001 From: Salvatore Ingala <6681844+bigspider@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:15:20 +0100 Subject: [PATCH 1/2] Updates for newer SDK --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6ce7e6a48..d87372501 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,9 @@ CURVE_APP_LOAD_PARAMS = secp256k1 # Application allowed derivation paths. PATH_APP_LOAD_PARAMS = "" -APP_LOAD_PARAMS += --path_slip21 "LEDGER-Wallet policy" + +# Allowed SLIP21 paths +PATH_SLIP21_APP_LOAD_PARAMS = "LEDGER-Wallet policy" # Application version APPVERSION_M = 2 @@ -36,8 +38,6 @@ APPVERSION_N = 1 APPVERSION_P = 3 APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" -APP_STACK_SIZE = 3072 - # Setting to allow building variant applications VARIANT_PARAM = COIN VARIANT_VALUES = bitcoin_testnet bitcoin From 26a0818524766bbaa07b8f61ceedae80fbf55ac1 Mon Sep 17 00:00:00 2001 From: Salvatore Ingala <6681844+bigspider@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:41:20 +0100 Subject: [PATCH 2/2] Mark cx_sha256_update usages as 'never-failing' --- src/common/merkle.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/merkle.c b/src/common/merkle.c index a4520fe41..19205670f 100644 --- a/src/common/merkle.c +++ b/src/common/merkle.c @@ -27,6 +27,8 @@ #include "cx_ram.h" #include "debug-helpers/debug.h" +#include "ledger_assert.h" + void merkle_compute_element_hash(const uint8_t *in, size_t in_len, uint8_t out[static 32]) { cx_sha256_t hash; cx_sha256_init(&hash); @@ -63,10 +65,10 @@ void merkle_combine_hashes(const uint8_t left[static 32], cx_sha256_init_no_throw(&G_cx.sha256); uint8_t prefix = 0x01; - cx_sha256_update(&G_cx.sha256, &prefix, 1); + LEDGER_ASSERT(cx_sha256_update(&G_cx.sha256, &prefix, 1) == CX_OK, "It never fails"); - cx_sha256_update(&G_cx.sha256, left, 32); - cx_sha256_update(&G_cx.sha256, right, 32); + LEDGER_ASSERT(cx_sha256_update(&G_cx.sha256, left, 32) == CX_OK, "It never fails"); + LEDGER_ASSERT(cx_sha256_update(&G_cx.sha256, right, 32) == CX_OK, "It never fails"); cx_sha256_final(&G_cx.sha256, out); explicit_bzero(&G_cx.sha256, sizeof(cx_sha256_t));