What changed, and why it matters
This commit simply deletes two helper functions that were no longer being used anywhere in the code. It is a routine cleanup with no visible security effect.
No action needed; this is a benign dead-code cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff removes _should_have_ctrl_byte_encrypted_transport() and _decode_message() from core/src/trezor/wire/thp/received_message_handler.py. The functions are not referenced elsewhere in the shown file, and the commit message explicitly calls this a removal of unused functions with no changelog entry. No logic changes, bug fixes, or security behavior modifications are present.
Changed components
core/src/trezor/wire/thp/received_message_handler.pyInspect captured patch +0 / −23
diff --git a/core/src/trezor/wire/thp/received_message_handler.py b/core/src/trezor/wire/thp/received_message_handler.py
index 56ae6c71c..5a0d9881f 100644
--- a/core/src/trezor/wire/thp/received_message_handler.py
+++ b/core/src/trezor/wire/thp/received_message_handler.py
@@ -224,29 +224,6 @@ async def _handle_pairing(ctx: Channel) -> None:
await ctx.connection_context.handle(message)
-def _should_have_ctrl_byte_encrypted_transport(ctx: Channel) -> bool:
- return ctx.get_channel_state() not in (
- ChannelState.UNALLOCATED,
- ChannelState.TH1,
- ChannelState.TH2,
- )
-
-
-def _decode_message(
- buffer: bytes,
- msg_type: int,
- message_name: str | None = None,
- wire_enum: str = "ThpMessageType",
-) -> protobuf.MessageType:
- if __debug__:
- log.debug(__name__, "decode message")
- if message_name is not None:
- expected_type = protobuf.type_for_name(message_name)
- else:
- expected_type = protobuf.type_for_wire(wire_enum, msg_type)
- return message_handler.wrap_protobuf_load(buffer, expected_type)
-
-
def _is_channel_state_pairing(state: int) -> bool:
return state in (
ChannelState.TP0,
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.