EIP712 signatures now computed on schema hash

This commit is contained in:
Alexandre Paillier
2022-06-29 15:08:43 +02:00
parent 188a75ffff
commit ee660317aa
2 changed files with 23 additions and 3 deletions

View File

@@ -509,6 +509,14 @@ static bool verify_contract_name_signature(uint8_t dname_length,
NULL,
0);
// Schema hash
cx_hash((cx_hash_t*)&hash_ctx,
0,
eip712_context->schema_hash,
sizeof(eip712_context->schema_hash),
NULL,
0);
// Display name length
cx_hash((cx_hash_t*)&hash_ctx,
0,
@@ -590,6 +598,14 @@ static bool verify_field_name_signature(uint8_t dname_length,
NULL,
0);
// Schema hash
cx_hash((cx_hash_t*)&hash_ctx,
0,
eip712_context->schema_hash,
sizeof(eip712_context->schema_hash),
NULL,
0);
if ((field_ptr = path_get_field()) == NULL)
{
return false;