What changed, and why it matters
This commit only adds a debug-only error log message when a Trezor hardware wallet's THP (Trezor Host Protocol) channel reports an error. It does not change how errors are handled, what data is sent, or any security behavior. The logging is wrapped in `if __debug__:` so it only runs in debug builds and is stripped from production firmware.
No security action needed. This is a routine observability/logging change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
A single logging statement was added to InterfaceContext.write_error() in core/src/trezor/wire/thp/interface_context.py. The statement logs the channel ID and ThpErrorType enum value when an error response is being written. It is guarded by if __debug__: and uses log.error(). The actual error response construction (PacketHeader.get_error_header, write_payload) is unchanged.
Changed components
core/src/trezor/wire/thp/interface_context.pyInspect captured patch +2 / −0
diff --git a/core/src/trezor/wire/thp/interface_context.py b/core/src/trezor/wire/thp/interface_context.py
index 7d66c42f0..91e9bc21f 100644
--- a/core/src/trezor/wire/thp/interface_context.py
+++ b/core/src/trezor/wire/thp/interface_context.py
@@ -223,6 +223,8 @@ class InterfaceContext:
await self.write_payload(response_header, response_data)
def write_error(self, cid: int, err_type: ThpErrorType) -> Awaitable[None]:
+ if __debug__:
+ log.error(__name__, "(cid: %04x) THP error #%d", cid, err_type)
msg_data = err_type.to_bytes(1, "big")
length = len(msg_data) + CHECKSUM_LENGTH
header = PacketHeader.get_error_header(cid, length)
Why this scored 14/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.