EIP712 STRUCT FIELD IMPL now checks the APDU payload bounds

This commit is contained in:
Alexandre Paillier
2022-07-18 11:31:46 +02:00
parent 38f199e46b
commit 5e5b3c3621
4 changed files with 23 additions and 13 deletions

View File

@@ -296,6 +296,11 @@ bool field_hash(const uint8_t *data,
{
data = field_hash_prepare(field_ptr, data, &data_length);
}
if (data_length > fh->remaining_size)
{
apdu_response_code = APDU_RESPONSE_INVALID_DATA;
return false;
}
fh->remaining_size -= data_length;
// if a dynamic type -> continue progressive hash
if (IS_DYN(field_type))