mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 23:48:12 +00:00
core/fido2: check for HID timeout in send_cmd() (#791)
This commit is contained in:
parent
7c41b40dff
commit
289d8276eb
@ -477,7 +477,10 @@ async def send_cmd(cmd: Cmd, iface: io.HID) -> None:
|
||||
if copied < _FRAME_CONT_SIZE:
|
||||
frm.data[copied:] = bytearray(_FRAME_CONT_SIZE - copied)
|
||||
while True:
|
||||
await write
|
||||
ret = await loop.race(write, loop.sleep(_CTAP_HID_TIMEOUT_MS * 1000))
|
||||
if ret is not None:
|
||||
raise TimeoutError
|
||||
|
||||
if iface.write(buf) > 0:
|
||||
break
|
||||
seq += 1
|
||||
|
Loading…
Reference in New Issue
Block a user