EIP-712 filtering UI adjustments; Removed half-blind special compilation flag

This commit is contained in:
Alexandre Paillier
2022-06-20 15:15:58 +02:00
parent a24f621ce3
commit b7a4c0d93b
8 changed files with 137 additions and 98 deletions

View File

@@ -67,17 +67,7 @@ bool field_hash(const uint8_t *data,
if (IS_DYN(field_type))
{
cx_keccak_init(&global_sha3, 256); // init hash
#ifdef HAVE_EIP712_HALF_BLIND
if (path_get_root_type() == ROOT_DOMAIN)
{
if ((keylen == 4) && (strncmp(key, "name", keylen) == 0))
{
#endif // HAVE_EIP712_HALF_BLIND
ui_712_new_field(field_ptr, data, data_length);
#ifdef HAVE_EIP712_HALF_BLIND
}
}
#endif // HAVE_EIP712_HALF_BLIND
}
}
fh->remaining_size -= data_length;
@@ -136,17 +126,7 @@ bool field_hash(const uint8_t *data,
{
return false;
}
#ifdef HAVE_EIP712_HALF_BLIND
if (path_get_root_type() == ROOT_DOMAIN)
{
if ((keylen == 4) && (strncmp(key, "name", keylen) == 0))
{
#endif // HAVE_EIP712_HALF_BLIND
ui_712_new_field(field_ptr, data, data_length);
#ifdef HAVE_EIP712_HALF_BLIND
}
}
#endif // HAVE_EIP712_HALF_BLIND
}
else
{
@@ -193,16 +173,7 @@ bool field_hash(const uint8_t *data,
}
path_advance();
fh->state = FHS_IDLE;
#ifdef HAVE_EIP712_HALF_BLIND
if ((path_get_root_type() == ROOT_MESSAGE) ||
((keylen != 4) || (strncmp(key, "name", keylen) != 0)))
{
G_io_apdu_buffer[0] = 0x90;
G_io_apdu_buffer[1] = 0x00;
io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, 2);
}
#endif // HAVE_EIP712_HALF_BLIND
ui_712_finalize_field();
}
else
{