Add EIP 712 signing v0
This commit is contained in:
committed by
TamtamHero
parent
c308b55535
commit
27c34e271a
@@ -10,6 +10,7 @@
|
||||
#define INS_GET_APP_CONFIGURATION 0x06
|
||||
#define INS_SIGN_PERSONAL_MESSAGE 0x08
|
||||
#define INS_PROVIDE_ERC20_TOKEN_INFORMATION 0x0A
|
||||
#define INS_SIGN_EIP_712_MESSAGE 0x0C
|
||||
#define P1_CONFIRM 0x01
|
||||
#define P1_NON_CONFIRM 0x00
|
||||
#define P2_NO_CHAINCODE 0x00
|
||||
|
||||
@@ -544,6 +544,11 @@ void handleApdu(unsigned int *flags, unsigned int *tx) {
|
||||
handleSignPersonalMessage(G_io_apdu_buffer[OFFSET_P1], G_io_apdu_buffer[OFFSET_P2], G_io_apdu_buffer + OFFSET_CDATA, G_io_apdu_buffer[OFFSET_LC], flags, tx);
|
||||
break;
|
||||
|
||||
case INS_SIGN_EIP_712_MESSAGE:
|
||||
os_memset(tmpCtx.transactionContext.tokenSet, 0, MAX_TOKEN);
|
||||
handleSignEIP712Message(G_io_apdu_buffer[OFFSET_P1], G_io_apdu_buffer[OFFSET_P2], G_io_apdu_buffer + OFFSET_CDATA, G_io_apdu_buffer[OFFSET_LC], flags, tx);
|
||||
break;
|
||||
|
||||
#if 0
|
||||
case 0xFF: // return to dashboard
|
||||
goto return_to_dashboard;
|
||||
|
||||
@@ -71,10 +71,19 @@ typedef struct messageSigningContext_t {
|
||||
uint32_t remainingLength;
|
||||
} messageSigningContext_t;
|
||||
|
||||
typedef struct messageSigningContext712_t {
|
||||
uint8_t pathLength;
|
||||
uint32_t bip32Path[MAX_BIP32_PATH];
|
||||
uint8_t domainHash[32];
|
||||
uint8_t messageHash[32];
|
||||
} messageSigningContext712_t;
|
||||
|
||||
|
||||
typedef union {
|
||||
publicKeyContext_t publicKeyContext;
|
||||
transactionContext_t transactionContext;
|
||||
messageSigningContext_t messageSigningContext;
|
||||
messageSigningContext712_t messageSigningContext712;
|
||||
} tmpCtx_t;
|
||||
|
||||
typedef union {
|
||||
|
||||
@@ -10,6 +10,8 @@ unsigned int io_seproxyhal_touch_signMessage_ok(const bagl_element_t *e);
|
||||
unsigned int io_seproxyhal_touch_signMessage_cancel(const bagl_element_t *e);
|
||||
unsigned int io_seproxyhal_touch_data_ok(const bagl_element_t *e);
|
||||
unsigned int io_seproxyhal_touch_data_cancel(const bagl_element_t *e);
|
||||
unsigned int io_seproxyhal_touch_signMessage712_v0_ok(const bagl_element_t *e);
|
||||
unsigned int io_seproxyhal_touch_signMessage712_v0_cancel(const bagl_element_t *e);
|
||||
|
||||
void ui_idle(void);
|
||||
|
||||
|
||||
@@ -20,10 +20,12 @@ extern const ux_flow_step_t * const ux_approval_allowance_flow [];
|
||||
|
||||
extern const ux_flow_step_t * const ux_sign_flow [];
|
||||
|
||||
extern const ux_flow_step_t * const ux_display_stark_public_flow [];
|
||||
extern const ux_flow_step_t * const ux_sign_712_v0_flow [];
|
||||
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
extern const ux_flow_step_t * const ux_display_stark_public_flow [];
|
||||
|
||||
extern const ux_flow_step_t * const ux_stark_limit_order_flow [];
|
||||
|
||||
extern const ux_flow_step_t * const ux_stark_transfer_flow [];
|
||||
|
||||
Reference in New Issue
Block a user