What changed, and why it matters
This commit only updates automated test scripts for the Trezor hardware wallet. It changes how the test code simulates button presses during a wallet backup flow to match the actual device behavior. There is no change to the firmware or wallet security itself.
No action needed. This is a test-only change and does not affect device security.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies two test files: tests/device_tests/test_msg_backup_device.py and tests/input_flows.py. It removes a confirm_success parameter that previously varied by device layout type and standardizes the backup input flow so that all models send a success_backup button request, while only Bolt/Caesar layouts send success_share_confirm. This is a test-only correction with no firmware changes.
Changed components
tests/device_tests/test_msg_backup_device.pytests/input_flows.pyInspect captured patch +10 / −19
diff --git a/tests/device_tests/test_msg_backup_device.py b/tests/device_tests/test_msg_backup_device.py
index 6f89c630..e58a324e 100644
--- a/tests/device_tests/test_msg_backup_device.py
+++ b/tests/device_tests/test_msg_backup_device.py
@@ -115,12 +115,7 @@ def test_backup_slip39_single(session: Session, adapt_flow: "FlowAdapter"):
assert session.features.backup_availability == messages.BackupAvailability.Required
with session.test_ctx as client:
- IF = InputFlowBip39Backup(
- session,
- confirm_success=(
- session.layout_type not in (LayoutType.Delizia, LayoutType.Eckhart)
- ),
- )
+ IF = InputFlowBip39Backup(session)
client.set_input_flow(adapt_flow(session, IF.get()))
device.backup(session)
diff --git a/tests/input_flows.py b/tests/input_flows.py
index 164b593e..8e60b6cf 100644
--- a/tests/input_flows.py
+++ b/tests/input_flows.py
@@ -1793,23 +1793,20 @@ class InputFlowEthereumSignTxStaking(InputFlowBase):
yield from self.ETH.confirm_tx_staking(info=True)
-def get_mnemonic(
- debug: DebugLink,
- confirm_success: bool = True,
-) -> Generator[None, "messages.ButtonRequest", str]:
+def get_mnemonic(debug: DebugLink) -> Generator[None, "messages.ButtonRequest", str]:
+ """Used for BIP39 or SLIP-39 1-of-1 backup."""
# mnemonic phrases
mnemonic = yield from read_and_confirm_mnemonic(debug)
- is_slip39 = len(mnemonic.split()) in (20, 33)
- if debug.layout_type in (LayoutType.Bolt, LayoutType.Caesar) or is_slip39:
+ if debug.layout_type in (LayoutType.Bolt, LayoutType.Caesar):
br = yield # confirm recovery share check
assert br.code == B.Success
+ assert br.name == "success_share_confirm"
debug.press_yes()
- if confirm_success:
- br = yield
- assert br.code == B.Success
-
+ br = yield
+ assert br.code == B.Success
+ assert br.name == "success_backup"
debug.press_yes()
assert mnemonic is not None
@@ -1817,10 +1814,9 @@ def get_mnemonic(
class InputFlowBip39Backup(InputFlowBase):
- def __init__(self, client: Client, confirm_success: bool = True):
+ def __init__(self, client: Client):
super().__init__(client)
self.mnemonic = None
- self.confirm_success = confirm_success
def input_flow_common(self) -> BRGeneratorType:
# 1. Backup intro
@@ -1828,7 +1824,7 @@ class InputFlowBip39Backup(InputFlowBase):
yield from click_through(self.debug, screens=2, code=B.ResetDevice)
# mnemonic phrases and rest
- self.mnemonic = yield from get_mnemonic(self.debug, self.confirm_success)
+ self.mnemonic = yield from get_mnemonic(self.debug)
class InputFlowBip39ResetBackup(InputFlowBase):
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.