diff --git a/core/src/apps/management/common/layout.py b/core/src/apps/management/common/layout.py index 02d76d043..e5ff1a0fe 100644 --- a/core/src/apps/management/common/layout.py +++ b/core/src/apps/management/common/layout.py @@ -68,15 +68,16 @@ async def confirm_backup_again(ctx): async def _confirm_share_words(ctx, share_index, share_words): numbered = list(enumerate(share_words)) - # check a word from the first half - first_half = numbered[: len(numbered) // 2] - if not await _confirm_word(ctx, share_index, first_half): - return False - - # check a word from the second half - second_half = numbered[len(numbered) // 2 :] - if not await _confirm_word(ctx, share_index, second_half): - return False + # check three words + third = len(numbered) // 3 + # if the num of words is not dividable by 3 let's add 1 + # to have more words at the beggining and to check all of them + if len(numbered) % 3: + third += 1 + + for part in utils.chunks(numbered, third): + if not await _confirm_word(ctx, share_index, part): + return False return True diff --git a/python/trezorlib/tests/device_tests/test_msg_resetdevice_shamir.py b/python/trezorlib/tests/device_tests/test_msg_resetdevice_shamir.py index 038af2ffe..3987a4517 100644 --- a/python/trezorlib/tests/device_tests/test_msg_resetdevice_shamir.py +++ b/python/trezorlib/tests/device_tests/test_msg_resetdevice_shamir.py @@ -84,7 +84,7 @@ class TestMsgResetDeviceT2(TrezorTest): self.client.debug.press_yes() # check share - for _ in range(2): + for _ in range(3): time.sleep(1) index = self.client.debug.state().reset_word_pos self.client.debug.input(words[index]) diff --git a/python/trezorlib/tests/device_tests/test_msg_resetdevice_t2.py b/python/trezorlib/tests/device_tests/test_msg_resetdevice_t2.py index 96f1e4908..9da1721ea 100644 --- a/python/trezorlib/tests/device_tests/test_msg_resetdevice_t2.py +++ b/python/trezorlib/tests/device_tests/test_msg_resetdevice_t2.py @@ -64,7 +64,7 @@ class TestMsgResetDeviceT2(TrezorTest): self.client.debug.press_yes() # check backup words - for _ in range(2): + for _ in range(3): time.sleep(1) index = self.client.debug.state().reset_word_pos self.client.debug.input(words[index]) @@ -169,7 +169,7 @@ class TestMsgResetDeviceT2(TrezorTest): self.client.debug.press_yes() # check backup words - for _ in range(2): + for _ in range(3): time.sleep(1) index = self.client.debug.state().reset_word_pos self.client.debug.input(words[index])