From ca37612f614a2016b68e0d361cdce06bf6648cd6 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Fri, 24 Jun 2022 11:25:13 +0200 Subject: [PATCH] Fix io_exchange exception Was trying to reply to EIP712 ARRAY size APDU twice --- src_features/signMessageEIP712/entrypoint.c | 8 +++++--- src_features/signMessageEIP712/path.c | 3 --- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src_features/signMessageEIP712/entrypoint.c b/src_features/signMessageEIP712/entrypoint.c index 796234b..640152b 100644 --- a/src_features/signMessageEIP712/entrypoint.c +++ b/src_features/signMessageEIP712/entrypoint.c @@ -726,9 +726,11 @@ bool handle_eip712_filtering(const uint8_t *const apdu_buf) case P1_CONTRACT_NAME: if (ui_712_get_filtering_mode() == EIP712_FILTERING_FULL) { - ret = provide_contract_name(&apdu_buf[OFFSET_CDATA], - apdu_buf[OFFSET_LC]); - reply_apdu = false; + if ((ret = provide_contract_name(&apdu_buf[OFFSET_CDATA], + apdu_buf[OFFSET_LC]))) + { + reply_apdu = false; + } } break; case P1_FIELD_NAME: diff --git a/src_features/signMessageEIP712/path.c b/src_features/signMessageEIP712/path.c index 609d6a7..485bb97 100644 --- a/src_features/signMessageEIP712/path.c +++ b/src_features/signMessageEIP712/path.c @@ -496,9 +496,6 @@ bool path_new_array_depth(uint8_t size) cx_keccak_init(hash_ctx, 256); // init hash } - G_io_apdu_buffer[0] = 0x90; - G_io_apdu_buffer[1] = 0x00; - io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, 2); return true; }