UI handling WIP

This commit is contained in:
Alexandre Paillier
2022-05-12 17:29:35 +02:00
parent b8424d1a21
commit 9f29a7caa2
11 changed files with 271 additions and 26 deletions

View File

@@ -663,13 +663,20 @@ void handleApdu(unsigned int *flags, unsigned int *tx) {
break;
case INS_SIGN_EIP_712_MESSAGE:
memset(tmpCtx.transactionContext.tokenSet, 0, MAX_ITEMS);
handleSignEIP712Message_v0(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);
if (G_io_apdu_buffer[OFFSET_P2] == 0)
{
memset(tmpCtx.transactionContext.tokenSet, 0, MAX_ITEMS);
handleSignEIP712Message_v0(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);
}
else
{
handle_eip712_sign(G_io_apdu_buffer);
}
break;
#ifdef HAVE_ETH2
@@ -696,10 +703,12 @@ void handleApdu(unsigned int *flags, unsigned int *tx) {
#endif
case INS_EIP712_STRUCT_DEF:
*flags |= IO_ASYNCH_REPLY;
handle_eip712_struct_def(G_io_apdu_buffer);
break;
case INS_EIP712_STRUCT_IMPL:
*flags |= IO_ASYNCH_REPLY;
handle_eip712_struct_impl(G_io_apdu_buffer);
break;