From ddd5f3d0d95ebe4196c7aff70f24b9f0ce8c8a39 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Mon, 29 Apr 2024 18:22:22 +0200 Subject: [PATCH] Remove useless flag NO_CONSENT --- makefile_conf/features.mk | 4 ---- src_features/getEth2PublicKey/cmd_getEth2PublicKey.c | 10 ++-------- src_features/getPublicKey/cmd_getPublicKey.c | 10 ++-------- .../cmd_performPrivacyOperation.c | 10 ++-------- src_features/signMessage/cmd_signMessage.c | 4 ---- src_features/signMessageEIP712_v0/cmd_signMessage712.c | 4 ---- src_features/signTx/logic_signTx.c | 9 +-------- 7 files changed, 7 insertions(+), 44 deletions(-) diff --git a/makefile_conf/features.mk b/makefile_conf/features.mk index fa3c5d3c0..59b707fce 100644 --- a/makefile_conf/features.mk +++ b/makefile_conf/features.mk @@ -63,10 +63,6 @@ ifneq ($(TARGET_NAME),TARGET_NANOS) endif endif -ifneq ($(NOCONSENT),) - DEFINES += NO_CONSENT -endif - # Check features incompatibilities # -------------------------------- # NFTs diff --git a/src_features/getEth2PublicKey/cmd_getEth2PublicKey.c b/src_features/getEth2PublicKey/cmd_getEth2PublicKey.c index 8ba2bb9cc..995598053 100644 --- a/src_features/getEth2PublicKey/cmd_getEth2PublicKey.c +++ b/src_features/getEth2PublicKey/cmd_getEth2PublicKey.c @@ -75,20 +75,14 @@ void handleGetEth2PublicKey(uint8_t p1, getEth2PublicKey(bip32.path, bip32.length, tmpCtx.publicKeyContext.publicKey.W); -#ifndef NO_CONSENT - if (p1 == P1_NON_CONFIRM) -#endif // NO_CONSENT - { + if (p1 == P1_NON_CONFIRM) { *tx = set_result_get_eth2_publicKey(); THROW(0x9000); - } -#ifndef NO_CONSENT - else { + } else { ui_display_public_eth2(); *flags |= IO_ASYNCH_REPLY; } -#endif // NO_CONSENT } #endif diff --git a/src_features/getPublicKey/cmd_getPublicKey.c b/src_features/getPublicKey/cmd_getPublicKey.c index 4c5a11566..7fb8baea9 100644 --- a/src_features/getPublicKey/cmd_getPublicKey.c +++ b/src_features/getPublicKey/cmd_getPublicKey.c @@ -60,15 +60,10 @@ void handleGetPublicKey(uint8_t p1, THROW(APDU_RESPONSE_INVALID_DATA); } -#ifndef NO_CONSENT - if (p1 == P1_NON_CONFIRM) -#endif // NO_CONSENT - { + if (p1 == P1_NON_CONFIRM) { *tx = set_result_get_publicKey(); THROW(APDU_RESPONSE_OK); - } -#ifndef NO_CONSENT - else { + } else { snprintf(strings.common.fullAddress, sizeof(strings.common.fullAddress), "0x%.*s", @@ -79,5 +74,4 @@ void handleGetPublicKey(uint8_t p1, *flags |= IO_ASYNCH_REPLY; } -#endif // NO_CONSENT } diff --git a/src_features/performPrivacyOperation/cmd_performPrivacyOperation.c b/src_features/performPrivacyOperation/cmd_performPrivacyOperation.c index a58ab1981..ba8a1026e 100644 --- a/src_features/performPrivacyOperation/cmd_performPrivacyOperation.c +++ b/src_features/performPrivacyOperation/cmd_performPrivacyOperation.c @@ -90,15 +90,10 @@ void handlePerformPrivacyOperation(uint8_t p1, THROW(0x6A80); } -#ifndef NO_CONSENT - if (p1 == P1_NON_CONFIRM) -#endif // NO_CONSENT - { + if (p1 == P1_NON_CONFIRM) { *tx = set_result_perform_privacy_operation(); THROW(0x9000); - } -#ifndef NO_CONSENT - else { + } else { snprintf(strings.common.fullAddress, sizeof(strings.common.fullAddress), "0x%.*s", @@ -120,5 +115,4 @@ void handlePerformPrivacyOperation(uint8_t p1, *flags |= IO_ASYNCH_REPLY; } -#endif // NO_CONSENT } diff --git a/src_features/signMessage/cmd_signMessage.c b/src_features/signMessage/cmd_signMessage.c index 14ea72d6f..711073059 100644 --- a/src_features/signMessage/cmd_signMessage.c +++ b/src_features/signMessage/cmd_signMessage.c @@ -255,11 +255,7 @@ bool handleSignPersonalMessage(uint8_t p1, } else // hash only { if (tmpCtx.messageSigningContext.remainingLength == 0) { -#ifdef NO_CONSENT - io_seproxyhal_touch_signMessage_ok(); -#else ui_191_switch_to_sign(); -#endif } else { apdu_reply(APDU_RESPONSE_OK); } diff --git a/src_features/signMessageEIP712_v0/cmd_signMessage712.c b/src_features/signMessageEIP712_v0/cmd_signMessage712.c index 058495e76..d9587e67f 100644 --- a/src_features/signMessageEIP712_v0/cmd_signMessage712.c +++ b/src_features/signMessageEIP712_v0/cmd_signMessage712.c @@ -29,11 +29,7 @@ void handleSignEIP712Message_v0(uint8_t p1, workBuffer + KECCAK256_HASH_BYTESIZE, KECCAK256_HASH_BYTESIZE); -#ifdef NO_CONSENT - io_seproxyhal_touch_signMessage_ok(NULL); -#else // NO_CONSENT ui_sign_712_v0(); -#endif // NO_CONSENT *flags |= IO_ASYNCH_REPLY; } diff --git a/src_features/signTx/logic_signTx.c b/src_features/signTx/logic_signTx.c index 08f0938cf..c16c857f1 100644 --- a/src_features/signTx/logic_signTx.c +++ b/src_features/signTx/logic_signTx.c @@ -535,20 +535,13 @@ __attribute__((noinline)) static bool finalize_parsing_helper(bool direct, bool void finalizeParsing(bool direct) { bool use_standard_UI = true; - bool no_consent_check; if (!finalize_parsing_helper(direct, &use_standard_UI)) { return; } // If called from swap, the user has already validated a standard transaction // And we have already checked the fields of this transaction above - no_consent_check = G_called_from_swap && use_standard_UI; - -#ifdef NO_CONSENT - no_consent_check = true; -#endif // NO_CONSENT - - if (no_consent_check) { + if (G_called_from_swap && use_standard_UI) { io_seproxyhal_touch_tx_ok(NULL); } else { if (use_standard_UI) {