From af48e678487efccf181bc8d52d37707eae6774da 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] Mark cx_sha256_update usages as 'never-failing' --- src/common/merkle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/merkle.c b/src/common/merkle.c index a4520fe41..0721a11b9 100644 --- a/src/common/merkle.c +++ b/src/common/merkle.c @@ -63,10 +63,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));