mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 12:00:59 +00:00
wire: fix when the footer is too short
This commit is contained in:
parent
ecd8bd3b2a
commit
e556aea42b
@ -115,7 +115,10 @@ Pass report payloads as `memoryview` for cheaper slicing.
|
||||
msg_footer = data_tail[:_MSG_FOOTER_LEN]
|
||||
if len(msg_footer) < _MSG_FOOTER_LEN:
|
||||
data_tail = yield # read report with the rest of checksum
|
||||
msg_footer += data_tail[:_MSG_FOOTER_LEN - len(msg_footer)]
|
||||
footer_tail = data_tail[:_MSG_FOOTER_LEN - len(msg_footer)]
|
||||
if isinstance(msg_footer, memoryview):
|
||||
msg_footer = bytearray(msg_footer)
|
||||
msg_footer.extend(footer_tail)
|
||||
|
||||
data_checksum, = parse_message_footer(msg_footer)
|
||||
if data_checksum != checksum:
|
||||
|
Loading…
Reference in New Issue
Block a user