diff --git a/src/apdu_constants.h b/src/apdu_constants.h index 19111b3..55ff4c9 100644 --- a/src/apdu_constants.h +++ b/src/apdu_constants.h @@ -35,6 +35,7 @@ #define COMMON_INS_GET_WALLET_ID 0x04 #define APDU_RESPONSE_OK 0x9000 +#define APDU_RESPONSE_ERROR_NO_INFO 0x6a00 #define APDU_RESPONSE_INVALID_DATA 0x6a80 #define APDU_RESPONSE_INSUFFICIENT_MEMORY 0x6a84 #define APDU_RESPONSE_INVALID_INS 0x6d00 diff --git a/src_features/signMessageEIP712/commands_712.c b/src_features/signMessageEIP712/commands_712.c index 9d926ba..b51f519 100644 --- a/src_features/signMessageEIP712/commands_712.c +++ b/src_features/signMessageEIP712/commands_712.c @@ -25,6 +25,8 @@ void handle_eip712_return_code(bool success) { if (success) { apdu_response_code = APDU_RESPONSE_OK; + } else if (apdu_response_code == APDU_RESPONSE_OK) { // somehow not set + apdu_response_code = APDU_RESPONSE_ERROR_NO_INFO; } *(uint16_t *) G_io_apdu_buffer = __builtin_bswap16(apdu_response_code); diff --git a/src_features/signMessageEIP712/filtering.c b/src_features/signMessageEIP712/filtering.c index 19eb2f0..71a87cb 100644 --- a/src_features/signMessageEIP712/filtering.c +++ b/src_features/signMessageEIP712/filtering.c @@ -110,6 +110,7 @@ static bool verify_filtering_signature(uint8_t dname_length, if (!cx_ecdsa_verify(&verifying_key, CX_LAST, CX_SHA256, hash, sizeof(hash), sig, sig_length)) { #ifndef HAVE_BYPASS_SIGNATURES PRINTF("Invalid EIP-712 filtering signature\n"); + apdu_response_code = APDU_RESPONSE_INVALID_DATA; return false; #endif }