core/backup: fix mnemonic_module to mnemonic_type

pull/371/head
Tomas Susanka 5 years ago
parent 6f66ad9591
commit c735299bd0

@ -42,7 +42,8 @@ if __debug__:
from apps.common import storage, mnemonic
m = DebugLinkState()
m.mnemonic_secret, m.mnemonic_type = mnemonic.get()
m.mnemonic_secret = mnemonic.get_secret()
m.mnemonic_type = mnemonic.get_type()
m.passphrase_protection = storage.device.has_passphrase()
m.reset_word_pos = reset_word_index
m.reset_entropy = reset_internal_entropy

@ -12,13 +12,13 @@ async def backup_device(ctx, msg):
if not storage.device.needs_backup():
raise wire.ProcessError("Seed already backed up")
mnemonic_secret, mnemonic_module = mnemonic.get()
slip39 = mnemonic_module == mnemonic.slip39
mnemonic_secret, mnemonic_type = mnemonic.get()
is_slip39 = mnemonic_type == mnemonic.TYPE_SLIP39
storage.device.set_unfinished_backup(True)
storage.device.set_backed_up()
if slip39:
if is_slip39:
await backup_slip39_wallet(ctx, mnemonic_secret)
else:
await layout.bip39_show_and_confirm_mnemonic(ctx, mnemonic_secret.decode())

@ -61,7 +61,7 @@ async def _finish_recovery_dry_run(
ctx: wire.Context, secret: bytes, mnemonic_type: int
) -> Success:
digest_input = sha256(secret).digest()
stored, _ = mnemonic.get()
stored = mnemonic.get_secret()
digest_stored = sha256(stored).digest()
result = utils.consteq(digest_stored, digest_input)

Loading…
Cancel
Save