Now uses some of the old EIP712 code as common code between the two implementations + approve/reject button now works
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
#include "apdu_constants.h"
|
||||
#include "utils.h"
|
||||
#include "ui_flow.h"
|
||||
#include "eip712.h"
|
||||
#include "common_712.h"
|
||||
|
||||
void handleSignEIP712Message_v0(uint8_t p1,
|
||||
uint8_t p2,
|
||||
const uint8_t *workBuffer,
|
||||
uint16_t dataLength,
|
||||
uint8_t dataLength,
|
||||
unsigned int *flags,
|
||||
unsigned int *tx) {
|
||||
uint8_t i;
|
||||
|
||||
UNUSED(tx);
|
||||
if ((p1 != 00) || (p2 != 00)) {
|
||||
THROW(0x6B00);
|
||||
@@ -21,11 +21,15 @@ void handleSignEIP712Message_v0(uint8_t p1,
|
||||
|
||||
workBuffer = parseBip32(workBuffer, &dataLength, &tmpCtx.messageSigningContext.bip32);
|
||||
|
||||
if ((workBuffer == NULL) || (dataLength < (32 + 32))) {
|
||||
if ((workBuffer == NULL) || (dataLength < (KECCAK256_HASH_BYTESIZE * 2))) {
|
||||
THROW(0x6a80);
|
||||
}
|
||||
memmove(tmpCtx.messageSigningContext712.domainHash, workBuffer, 32);
|
||||
memmove(tmpCtx.messageSigningContext712.messageHash, workBuffer + 32, 32);
|
||||
memmove(tmpCtx.messageSigningContext712.domainHash,
|
||||
workBuffer,
|
||||
KECCAK256_HASH_BYTESIZE);
|
||||
memmove(tmpCtx.messageSigningContext712.messageHash,
|
||||
workBuffer + KECCAK256_HASH_BYTESIZE,
|
||||
KECCAK256_HASH_BYTESIZE);
|
||||
|
||||
#ifdef NO_CONSENT
|
||||
io_seproxyhal_touch_signMessage_ok(NULL);
|
||||
|
||||
Reference in New Issue
Block a user