Fix bootloader and fido issues.#297
Conversation
WalkthroughThis update introduces conditional logic and stricter validation in several core components. Display calls were commented out in the bootloader UI. USB initialization now runs only once per session. The firmware update flow clears the display and updates the status bar after user cancellation. Firmware image verification for the second part is now conditional on code length. SPI slave polling now validates headers before processing. An asynchronous buffer flush is scheduled if WebAuthn is disabled in the session manager. Changes
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
core/embed/bootloader/bootui.c(1 hunks)core/embed/bootloader/main.c(1 hunks)core/embed/emmc_wrapper/emmc_commands.c(1 hunks)core/embed/trezorhal/image.c(1 hunks)core/embed/trezorhal/spi_legacy.c(2 hunks)core/src/session.py(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
core/embed/emmc_wrapper/emmc_commands.c (4)
core/embed/extmod/modtrezorui/display.c (1)
display_clear(169-171)core/embed/extmod/modtrezorui/display.h (1)
display_clear(97-97)core/embed/bootloader/bootui.c (1)
ui_statusbar_update(586-654)core/embed/bootloader/bootui.h (1)
ui_statusbar_update(83-83)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Style check
- GitHub Check: Defs check
- GitHub Check: Gen check
🔇 Additional comments (7)
core/embed/emmc_wrapper/emmc_commands.c (1)
1268-1269: UI cleanup added after cancellation.Clear display and update status bar before returning from cancelled installation.
core/embed/bootloader/main.c (1)
217-221: Prevent multiple USB initializations.Added flag prevents redundant USB setup calls.
core/src/session.py (2)
21-26: New async function added to handle SPI FIDO events.Continuous buffer flushing when waiting for specific IO events.
32-33: Schedule buffer flushing when WebAuthn disabled.Ensures SPI FIDO buffer gets flushed even when WebAuthn interface isn't active.
core/embed/trezorhal/spi_legacy.c (2)
333-337: Added early validation for SPI headers.This checks header validity before processing and drops invalid data.
362-367: Added BOOT_ONLY mode filtering.Flushes unexpected data during boot mode operation.
core/embed/trezorhal/image.c (1)
754-793: Added conditional P2 firmware verification.Only checks P2 when firmware exceeds internal size. Cleans memory on failure.
Summary by CodeRabbit