mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 06:18:07 +00:00
core/signverify: add failsafe for an empty message header
This commit is contained in:
parent
56fe5adcfc
commit
981d079d7f
@ -18,6 +18,8 @@ def message_digest(coin: CoinType, message: bytes) -> bytes:
|
||||
h = utils.HashWriter(blake256())
|
||||
else:
|
||||
h = utils.HashWriter(sha256())
|
||||
if not coin.signed_message_header:
|
||||
raise wire.DataError("Empty message header not allowed.")
|
||||
write_bitcoin_varint(h, len(coin.signed_message_header))
|
||||
h.extend(coin.signed_message_header)
|
||||
write_bitcoin_varint(h, len(message))
|
||||
|
Loading…
Reference in New Issue
Block a user