What changed, and why it matters
This commit only adds a new automated test that checks whether a user can cancel the setup of a wipe code on a Trezor device. It does not change any firmware code, user-facing behavior, or security logic. There is no security issue here.
No action needed. This is a benign test-only commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a test case test_set_wipe_code_cancel and a helper input flow class InputFlowNewCodeCancel that simulates UI interactions across four device layouts (bolt, caesar, delizia, eckhart) to cancel wipe-code setup. It is purely test infrastructure; no production code is modified.
Changed components
tests/device_tests/test_msg_change_wipe_code_t2.pytests/input_flows.pyInspect captured patch +45 / −1
diff --git a/tests/device_tests/test_msg_change_wipe_code_t2.py b/tests/device_tests/test_msg_change_wipe_code_t2.py
index de330d301..7ea15071c 100644
--- a/tests/device_tests/test_msg_change_wipe_code_t2.py
+++ b/tests/device_tests/test_msg_change_wipe_code_t2.py
@@ -22,7 +22,7 @@ from trezorlib.debuglink import LayoutType
from trezorlib.debuglink import SessionDebugWrapper as Session
from trezorlib.exceptions import Cancelled, TrezorFailure
-from ..input_flows import InputFlowNewCodeMismatch
+from ..input_flows import InputFlowNewCodeCancel, InputFlowNewCodeMismatch
PIN4 = "1234"
WIPE_CODE4 = "4321"
@@ -124,6 +124,13 @@ def test_set_wipe_code_mismatch(session: Session):
assert session.features.wipe_code_protection is False
+def test_set_wipe_code_cancel(session: Session):
+ with session.client as client, pytest.raises(Cancelled):
+ IF = InputFlowNewCodeCancel(session.client)
+ client.set_input_flow(IF.get())
+ device.change_wipe_code(session)
+
+
@pytest.mark.setup_client(pin=PIN4)
def test_set_wipe_code_to_pin(session: Session):
_ensure_unlocked(session, PIN4)
diff --git a/tests/input_flows.py b/tests/input_flows.py
index 9b4625c41..618f31f9b 100644
--- a/tests/input_flows.py
+++ b/tests/input_flows.py
@@ -91,6 +91,43 @@ class InputFlowBase:
return self.debug.read_layout().title()
+class InputFlowNewCodeCancel(InputFlowBase):
+ def input_flow_bolt(self) -> BRGeneratorType:
+ br = yield
+ assert br.name == "set_wipe_code"
+ self.debug.press_no()
+
+ def input_flow_caesar(self) -> BRGeneratorType:
+ br = yield
+ assert br.name == "set_wipe_code"
+ self.debug.press_no()
+
+ def input_flow_delizia(self) -> BRGeneratorType:
+ br = yield
+ assert br.name == "set_wipe_code"
+
+ self.debug.click(self.debug.screen_buttons.menu())
+ self.debug.synchronize_at("VerticalMenu")
+ self.debug.button_actions.navigate_to_menu_item(0)
+
+ self.debug.read_layout().title == TR.wipe_code__cancel_setup
+ self.debug.swipe_up()
+ self.debug.read_layout()
+ self.debug.synchronize_at("PromptScreen")
+ self.debug.click(self.debug.screen_buttons.tap_to_confirm())
+
+ def input_flow_eckhart(self) -> BRGeneratorType:
+ br = yield
+ assert br.name == "set_wipe_code"
+
+ self.debug.click(self.debug.screen_buttons.menu())
+ self.debug.synchronize_at("VerticalMenu")
+ self.debug.button_actions.navigate_to_menu_item(0)
+
+ self.debug.read_layout().title == TR.wipe_code__cancel_setup
+ self.debug.press_no()
+
+
class InputFlowNewCodeMismatch(InputFlowBase):
def __init__(
self,
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.