Remove useless flag NO_CONSENT

This commit is contained in:
Charles-Edouard de la Vergne
2024-04-29 18:22:22 +02:00
parent 41c9ece546
commit ddd5f3d0d9
7 changed files with 7 additions and 44 deletions

View File

@@ -63,10 +63,6 @@ ifneq ($(TARGET_NAME),TARGET_NANOS)
endif endif
endif endif
ifneq ($(NOCONSENT),)
DEFINES += NO_CONSENT
endif
# Check features incompatibilities # Check features incompatibilities
# -------------------------------- # --------------------------------
# NFTs # NFTs

View File

@@ -75,20 +75,14 @@ void handleGetEth2PublicKey(uint8_t p1,
getEth2PublicKey(bip32.path, bip32.length, tmpCtx.publicKeyContext.publicKey.W); getEth2PublicKey(bip32.path, bip32.length, tmpCtx.publicKeyContext.publicKey.W);
#ifndef NO_CONSENT if (p1 == P1_NON_CONFIRM) {
if (p1 == P1_NON_CONFIRM)
#endif // NO_CONSENT
{
*tx = set_result_get_eth2_publicKey(); *tx = set_result_get_eth2_publicKey();
THROW(0x9000); THROW(0x9000);
} } else {
#ifndef NO_CONSENT
else {
ui_display_public_eth2(); ui_display_public_eth2();
*flags |= IO_ASYNCH_REPLY; *flags |= IO_ASYNCH_REPLY;
} }
#endif // NO_CONSENT
} }
#endif #endif

View File

@@ -60,15 +60,10 @@ void handleGetPublicKey(uint8_t p1,
THROW(APDU_RESPONSE_INVALID_DATA); THROW(APDU_RESPONSE_INVALID_DATA);
} }
#ifndef NO_CONSENT if (p1 == P1_NON_CONFIRM) {
if (p1 == P1_NON_CONFIRM)
#endif // NO_CONSENT
{
*tx = set_result_get_publicKey(); *tx = set_result_get_publicKey();
THROW(APDU_RESPONSE_OK); THROW(APDU_RESPONSE_OK);
} } else {
#ifndef NO_CONSENT
else {
snprintf(strings.common.fullAddress, snprintf(strings.common.fullAddress,
sizeof(strings.common.fullAddress), sizeof(strings.common.fullAddress),
"0x%.*s", "0x%.*s",
@@ -79,5 +74,4 @@ void handleGetPublicKey(uint8_t p1,
*flags |= IO_ASYNCH_REPLY; *flags |= IO_ASYNCH_REPLY;
} }
#endif // NO_CONSENT
} }

View File

@@ -90,15 +90,10 @@ void handlePerformPrivacyOperation(uint8_t p1,
THROW(0x6A80); THROW(0x6A80);
} }
#ifndef NO_CONSENT if (p1 == P1_NON_CONFIRM) {
if (p1 == P1_NON_CONFIRM)
#endif // NO_CONSENT
{
*tx = set_result_perform_privacy_operation(); *tx = set_result_perform_privacy_operation();
THROW(0x9000); THROW(0x9000);
} } else {
#ifndef NO_CONSENT
else {
snprintf(strings.common.fullAddress, snprintf(strings.common.fullAddress,
sizeof(strings.common.fullAddress), sizeof(strings.common.fullAddress),
"0x%.*s", "0x%.*s",
@@ -120,5 +115,4 @@ void handlePerformPrivacyOperation(uint8_t p1,
*flags |= IO_ASYNCH_REPLY; *flags |= IO_ASYNCH_REPLY;
} }
#endif // NO_CONSENT
} }

View File

@@ -255,11 +255,7 @@ bool handleSignPersonalMessage(uint8_t p1,
} else // hash only } else // hash only
{ {
if (tmpCtx.messageSigningContext.remainingLength == 0) { if (tmpCtx.messageSigningContext.remainingLength == 0) {
#ifdef NO_CONSENT
io_seproxyhal_touch_signMessage_ok();
#else
ui_191_switch_to_sign(); ui_191_switch_to_sign();
#endif
} else { } else {
apdu_reply(APDU_RESPONSE_OK); apdu_reply(APDU_RESPONSE_OK);
} }

View File

@@ -29,11 +29,7 @@ void handleSignEIP712Message_v0(uint8_t p1,
workBuffer + KECCAK256_HASH_BYTESIZE, workBuffer + KECCAK256_HASH_BYTESIZE,
KECCAK256_HASH_BYTESIZE); KECCAK256_HASH_BYTESIZE);
#ifdef NO_CONSENT
io_seproxyhal_touch_signMessage_ok(NULL);
#else // NO_CONSENT
ui_sign_712_v0(); ui_sign_712_v0();
#endif // NO_CONSENT
*flags |= IO_ASYNCH_REPLY; *flags |= IO_ASYNCH_REPLY;
} }

View File

@@ -535,20 +535,13 @@ end:
void finalizeParsing(bool direct) { void finalizeParsing(bool direct) {
bool use_standard_UI = true; bool use_standard_UI = true;
bool no_consent_check;
if (!finalize_parsing_helper(direct, &use_standard_UI)) { if (!finalize_parsing_helper(direct, &use_standard_UI)) {
return; return;
} }
// If called from swap, the user has already validated a standard transaction // If called from swap, the user has already validated a standard transaction
// And we have already checked the fields of this transaction above // And we have already checked the fields of this transaction above
no_consent_check = G_called_from_swap && use_standard_UI; if (G_called_from_swap && use_standard_UI) {
#ifdef NO_CONSENT
no_consent_check = true;
#endif // NO_CONSENT
if (no_consent_check) {
io_seproxyhal_touch_tx_ok(NULL); io_seproxyhal_touch_tx_ok(NULL);
} else { } else {
if (use_standard_UI) { if (use_standard_UI) {