Skip to content

Commit 5c11745

Browse files
committed
Clear FIDO data when the FIDO is disabled.
1 parent 19aa7f9 commit 5c11745

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

core/embed/trezorhal/spi_legacy.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,12 @@ uint32_t _spi_slave_poll_ex(uint8_t* buf, bool fido)
359359
len = total_len > SPI_PKG_SIZE ? SPI_PKG_SIZE : total_len;
360360
return fifo_read_lock(&spi_fifo_in, buf, len);
361361
}
362+
#if BOOT_ONLY
363+
else
364+
{
365+
fifo_flush(&spi_fifo_in);
366+
}
367+
#endif
362368
}
363369

364370
return 0;

core/src/session.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,19 @@
1818
utils.RESTART_MAIN_LOOP = False
1919

2020

21+
async def flush_fido_buffer():
22+
from trezor import io
23+
24+
while True:
25+
await loop.wait(io.SPI_FIDO_FACE | io.POLL_READ)
26+
27+
2128
if not utils.BITCOIN_ONLY and usb.ENABLE_IFACE_WEBAUTHN:
2229
import apps.webauthn
2330

2431
apps.webauthn.boot()
32+
else:
33+
loop.schedule(flush_fido_buffer())
2534

2635
if __debug__:
2736
import apps.debug

0 commit comments

Comments
 (0)