fixup! u2f: Do not turn off BLE when U2F is used over USB
What changed, and why it matters
This is a tiny one-line fix in the BitBox02 hardware wallet's USB message handling. It changes a 'return false' to a 'break' so that after ignoring a malformed or duplicate USB frame, the code continues to a later cleanup step instead of exiting early. The commit title suggests this is a follow-up fix to keep Bluetooth Low Energy (BLE) from being accidentally disabled when U2F (a web security key protocol) is used over USB. On its own, the change is a bug fix that prevents an early return from skipping state cleanup, but the diff is too small to confirm any direct security consequence.
Review the full usb_packet_process() function and the preceding commit about BLE/U2F to confirm the cleanup logic is now correct. Treat as a normal bug-fix follow-up unless further review shows a security-relevant state corruption or denial-of-service path.
Security signals we found
Change from early return to fall-through in USB packet processing
Follow-up fixup to prior U2F/BLE behavior change
Potential state-cleanup correctness issue addressed
Evidence from the diff
In src/usb/usb_packet.c, usb_packet_process() handles incoming USB frames. When frame processing yields FRAME_ERR_IGNORE, the original code returned false immediately. The patch replaces that return with break, allowing execution to fall through to subsequent code at the end of the function. The commit title indicates this is a fixup for an earlier change intended to avoid turning off BLE during U2F-over-USB operations. The change likely ensures that ignoring a frame still triggers whatever finalization/cleanup logic follows the switch statement, but the supplied diff does not show that downstream code. No explicit security claim is made in the commit message.
Changed components
src/usb/usb_packet.cUSB/U2F packet processingBLE state management (implied by commit title)Inspect captured patch +1 / −1
diff --git a/src/usb/usb_packet.c b/src/usb/usb_packet.c
index 991a1cf..00edb9b 100644
--- a/src/usb/usb_packet.c
+++ b/src/usb/usb_packet.c
@@ -67,7 +67,7 @@ bool usb_packet_process(const USB_FRAME* frame)
switch (usb_frame_process(frame, &_in_state)) {
case FRAME_ERR_IGNORE:
// Ignore this frame, i.e. no response.
- return false;
+ break;
case FRAME_ERR_INVALID_SEQ:
// Reset the state becuase this error indicates that there is a host application bug
_reset_state();
Why this scored 26/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.