Files
app-ethereum/src_features/signMessageEIP712_v0/cmd_signMessage712.c
Charles-Edouard de la Vergne ddd5f3d0d9 Remove useless flag NO_CONSENT
2024-04-29 18:28:27 +02:00

36 lines
1.1 KiB
C

#include "shared_context.h"
#include "apdu_constants.h"
#include "common_utils.h"
#include "common_ui.h"
#include "common_712.h"
void handleSignEIP712Message_v0(uint8_t p1,
uint8_t p2,
const uint8_t *workBuffer,
uint8_t dataLength,
unsigned int *flags,
unsigned int *tx) {
(void) tx;
(void) p2;
if (p1 != 00) {
THROW(APDU_RESPONSE_INVALID_P1_P2);
}
if (appState != APP_STATE_IDLE) {
reset_app_context();
}
workBuffer = parseBip32(workBuffer, &dataLength, &tmpCtx.messageSigningContext.bip32);
if ((workBuffer == NULL) || (dataLength < (KECCAK256_HASH_BYTESIZE * 2))) {
THROW(APDU_RESPONSE_INVALID_DATA);
}
memmove(tmpCtx.messageSigningContext712.domainHash, workBuffer, KECCAK256_HASH_BYTESIZE);
memmove(tmpCtx.messageSigningContext712.messageHash,
workBuffer + KECCAK256_HASH_BYTESIZE,
KECCAK256_HASH_BYTESIZE);
ui_sign_712_v0();
*flags |= IO_ASYNCH_REPLY;
}