From 4cd0f9636776b9225b98528583e3fb81829e86f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Palmer=20S=C3=A9bastien?= Date: Fri, 18 Oct 2024 16:40:33 +0200 Subject: [PATCH] Audit feedback fixes (v3.0.5) (#299) * [format] add missing header guard to format.h file - plus add missing documentation * [sign] fix assertion for message type prints --- app/src/apdu_sign.c | 2 +- app/src/format.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/apdu_sign.c b/app/src/apdu_sign.c index 55e2641ce..e82143179 100644 --- a/app/src/apdu_sign.c +++ b/app/src/apdu_sign.c @@ -898,7 +898,7 @@ static void get_blindsign_type(char *type, size_t type_size) { TZ_PREAMBLE(("type=%s", type)); - TZ_ASSERT(type_size >= OPERATION_TYPE_STR_LENGTH, EXC_MEMORY_ERROR); + TZ_ASSERT(EXC_MEMORY_ERROR, type_size >= OPERATION_TYPE_STR_LENGTH); // clang-format off switch (global.keys.apdu.sign.tag) { case 0x01: diff --git a/app/src/format.h b/app/src/format.h index 098469064..17cb4e640 100644 --- a/app/src/format.h +++ b/app/src/format.h @@ -18,8 +18,17 @@ See the License for the specific language governing permissions and limitations under the License. */ +#pragma once #include #include #include +/** + * @brief Prints mutez as XTZ + * + * @param obuf: output buffer + * @param olen: length of the output buffer + * @param amount: amount in mutez + * @return bool: true on success + */ bool tz_mutez_to_string(char *obuf, size_t olen, uint64_t amount);