mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +00:00
src/apps/management: ask for mnemonic words twice in reset_device
This commit is contained in:
parent
fedfde7e99
commit
d5ae4d72b6
@ -177,6 +177,10 @@ async def show_mnemonic_page(page: int, page_count: int, pages: list):
|
||||
@ui.layout
|
||||
async def check_mnemonic(ctx, mnemonic: str) -> bool:
|
||||
words = mnemonic.split()
|
||||
index = random.uniform(len(words))
|
||||
index = random.uniform(len(words) // 2) # first half
|
||||
result = await MnemonicKeyboard('Type %s. word' % (index + 1))
|
||||
if result != words[index]:
|
||||
return False
|
||||
index = len(words) // 2 + random.uniform(len(words) // 2) # second half
|
||||
result = await MnemonicKeyboard('Type %s. word' % (index + 1))
|
||||
return result == words[index]
|
||||
|
Loading…
Reference in New Issue
Block a user