From 7154aea32038a3c70b5662925cf2254453725ec1 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Thu, 13 Oct 2022 16:38:35 +0200 Subject: [PATCH] Review --- src/main.c | 2 ++ src/signMessage.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index e10d779d..3729e88f 100644 --- a/src/main.c +++ b/src/main.c @@ -48,8 +48,10 @@ void handleApdu(volatile unsigned int *flags, volatile unsigned int *tx, int rx) const int ret = apdu_handle_message(G_io_apdu_buffer, rx, &G_command); if (ret != 0) { + MEMCLEAR(G_command); THROW(ret); } + if (G_command.state == ApduStatePayloadInProgress) { THROW(ApduReplySuccess); } diff --git a/src/signMessage.c b/src/signMessage.c index 09d0fb17..aa64532a 100644 --- a/src/signMessage.c +++ b/src/signMessage.c @@ -143,8 +143,8 @@ void handle_sign_message_parse_message(volatile unsigned int *tx) { if ((G_command.non_confirm || G_called_from_swap) && !(G_command.non_confirm && G_called_from_swap)) { - // Blind sign requested NOT in swap context - // Or no blind sign requested while in swap context + // User validation bypass requested NOT in swap context + // Or user validation requested while in swap context THROW(ApduReplySdkNotSupported); }