Merge branch 'master' of github.com:Coldcard/firmware

This commit is contained in:
Peter D. Gray 2023-06-20 08:58:22 -04:00
commit ebd4cd9812
No known key found for this signature in database
GPG Key ID: A2DCD558C2BE5D7C
2 changed files with 17 additions and 2 deletions

View File

@ -821,12 +821,15 @@ class PassphraseMenu(MenuSystem):
async def add_numbers(self, *a):
global pp_sofar
pp_sofar = await ux_input_numbers(pp_sofar, self.check_length)
pw = await ux_input_numbers(pp_sofar, self.check_length)
if pw is not None:
pp_sofar = pw
self.check_length()
async def empty_phrase(self, *a):
global pp_sofar
if pp_sofar and len(pp_sofar) >= 3:
if len(pp_sofar) >= 3:
if not await ux_confirm("Press OK to clear passphrase. X to cancel."):
return

View File

@ -127,6 +127,18 @@ def test_b39p_refused(dev, need_keypress, pw='testing 123'):
done = dev.send_recv(CCProtocolPacker.get_passphrase_done(), timeout=None)
def test_cancel_on_empty_added_numbers(pick_menu_item, goto_home, need_keypress, cap_menu):
goto_home()
pick_menu_item('Passphrase')
need_keypress("y") # intro story
pick_menu_item('Add Numbers')
need_keypress("x") # do not add any numbers and cancel with x
pick_menu_item('CANCEL')
time.sleep(0.1)
m = cap_menu()
assert m[0] == "Ready To Sign"
@pytest.mark.parametrize('haz', [ False, True ])
def test_lockdown(dev, haz, cap_menu, pick_menu_item, set_bip39_pw, goto_home, cap_story, need_keypress, sim_exec, sim_eval, get_settings, reset_seed_words, get_setting):
# test UX and operation of the 'seed lockdown' option