What changed, and why it matters
This is a test-only change to the Python debug-link helper library. It stops sending a 'Cancel' message to newer Trezor models during a test synchronization step, because only the older T1B1 model needs it. There is no change to device firmware or production behavior.
No security action required. Treat as a normal test-infrastructure cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies TrezorClientDebugLink.synchronize_with_device() in trezorlib/debuglink.py. Previously the code sent messages.Cancel() unconditionally when using Protocol V1. Now it only sends Cancel when self.model is models.T1B1. The synchronization loop was also refactored slightly to read until a matching Ping response is received. This affects only the debug/test client library, not the embedded firmware or runtime wallet logic.
Changed components
python/src/trezorlib/debuglink.pyTrezorClientDebugLink.synchronize_with_device()Inspect captured patch +9 / −6
diff --git a/python/src/trezorlib/debuglink.py b/python/src/trezorlib/debuglink.py
index 422f8bd01..2b4de4114 100644
--- a/python/src/trezorlib/debuglink.py
+++ b/python/src/trezorlib/debuglink.py
@@ -1423,17 +1423,20 @@ class TrezorClientDebugLink(TrezorClient):
"""
import secrets
- # Start by canceling whatever is on screen. This will work to cancel T1 PIN
- # prompt, which is in TINY mode and does not respond to `Ping`.
if self.protocol_version is ProtocolVersion.V1:
assert isinstance(self.protocol, ProtocolV1Channel)
- self.protocol.write(messages.Cancel())
- resp = self.protocol.read()
+ if self.model is models.T1B1:
+ # Start by canceling whatever is on screen. This will work to cancel T1 PIN
+ # prompt, which is in TINY mode and does not respond to `Ping`.
+ self.protocol.write(messages.Cancel())
+
message = "SYNC" + secrets.token_hex(8)
self.protocol.write(messages.Ping(message=message))
- while resp != messages.Success(message=message):
+ success = messages.Success(message=message)
+ while True:
try:
- resp = self.protocol.read()
+ if self.protocol.read() == success:
+ return
except Exception:
pass
Why this scored 13/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.