fix(python): avoid reseeding in HW tests
What changed, and why it matters
This is a tiny test-only fix that stops the Python test helper from sending a special 'reseed' debug command to real Trezor hardware during automated tests. The reseed command is meant only for the software emulator used in testing. Sending it to a physical device had no production security effect, but it could cause hardware tests to behave unexpectedly or fail. It is not a vulnerability in the firmware that end users run.
No end-user action needed. For developers, ensure hardware test runs use this updated helper and confirm that wipe() no longer emits reseed on physical devices.
Security signals we found
Debug-only command gated behind emulator check
Test infrastructure change, not firmware runtime change
No changelog entry indicates low user-facing impact
Evidence from the diff
In python/src/trezorlib/debuglink.py, the TrezorTestContext.wipe() helper now calls self.debug.reseed(0) only when self.is_emulator is true. Previously the reseed was issued whenever the reseed parameter was true, including during hardware (HW) test runs. Reseeding is a debug/emulator-only operation, so this change prevents an invalid/unsupported debug operation from being sent to physical devices during tests. The patch is one line and test-infrastructure only.
Changed components
python/src/trezorlib/debuglink.pyTrezor hardware-wallet test harnessInspect captured patch +1 / −1
diff --git a/python/src/trezorlib/debuglink.py b/python/src/trezorlib/debuglink.py
index c0704661..6c1e38e8 100644
--- a/python/src/trezorlib/debuglink.py
+++ b/python/src/trezorlib/debuglink.py
@@ -1705,7 +1705,7 @@ class TrezorTestContext:
so that we get consistent storage contents (specifically device id)
after the wipe.
"""
- if reseed:
+ if reseed and self.is_emulator:
self.debug.reseed(0)
if self.model is models.T1B1:
self.client._get_any_session().call(
Why this scored 18/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.