chore(core): remove unused `interface_manager`
What changed, and why it matters
This commit simply deletes an unused helper module that translated between USB/Bluetooth connection identifiers and internal wire interface objects. There is no security-relevant change; it is routine code cleanup.
No action required; treat as routine dead-code removal.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit removes core/src/trezor/wire/thp/interface_manager.py and its associated MicroPython qstr entries. The deleted module only contained decode_iface() and encode_iface() functions mapping usb.iface_wire and (when BLE is enabled) ble.interface to/from one-byte identifiers. No callers, no behavioral changes, and no security logic are present in the diff.
Changed components
core/src/trezor/wire/thp/interface_manager.py (deleted)core/embed/upymod/qstrdefsport.h (qstr cleanup)Inspect captured patch +0 / −38
diff --git a/core/embed/upymod/qstrdefsport.h b/core/embed/upymod/qstrdefsport.h
index 88611f26f..bbea7d5e4 100644
--- a/core/embed/upymod/qstrdefsport.h
+++ b/core/embed/upymod/qstrdefsport.h
@@ -412,7 +412,6 @@ Q(cpace)
Q(credential_manager)
Q(crypto)
Q(interface_context)
-Q(interface_manager)
Q(memory_manager)
Q(pairing)
Q(pairing_context)
@@ -434,7 +433,6 @@ Q(trezor.wire.thp.control_byte)
Q(trezor.wire.thp.cpace)
Q(trezor.wire.thp.crypto)
Q(trezor.wire.thp.interface_context)
-Q(trezor.wire.thp.interface_manager)
Q(trezor.wire.thp.memory_manager)
Q(trezor.wire.thp.pairing_context)
Q(trezor.wire.thp.received_message_handler)
diff --git a/core/src/trezor/wire/thp/interface_manager.py b/core/src/trezor/wire/thp/interface_manager.py
deleted file mode 100644
index c71a729a6..000000000
--- a/core/src/trezor/wire/thp/interface_manager.py
+++ /dev/null
@@ -1,36 +0,0 @@
-from typing import TYPE_CHECKING
-
-import usb
-from trezor import utils
-
-if utils.USE_BLE:
- import trezorble as ble
-
- _WIRE_INTERFACE_BLE = b"\x02"
-
-
-_WIRE_INTERFACE_USB = b"\x01"
-
-if TYPE_CHECKING:
- from trezorio import WireInterface
-
-
-def decode_iface(cached_iface: bytes | None) -> WireInterface:
- """Decode the cached wire interface."""
- if cached_iface == _WIRE_INTERFACE_USB:
- return usb.iface_wire
- if utils.USE_BLE:
- if cached_iface == _WIRE_INTERFACE_BLE:
- return ble.interface
-
- raise ValueError("Unknown WireInterface")
-
-
-def encode_iface(iface: WireInterface) -> bytes:
- """Encode wire interface into bytes."""
- if iface is usb.iface_wire:
- return _WIRE_INTERFACE_USB
- if utils.USE_BLE:
- if iface is ble.interface:
- return _WIRE_INTERFACE_BLE
- raise ValueError("Unknown WireInterface")
Why this scored 15/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.