mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-09 06:02:40 +00:00
core/backup: fix mnemonic_module to mnemonic_type
This commit is contained in:
parent
6f66ad9591
commit
c735299bd0
@ -42,7 +42,8 @@ if __debug__:
|
|||||||
from apps.common import storage, mnemonic
|
from apps.common import storage, mnemonic
|
||||||
|
|
||||||
m = DebugLinkState()
|
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.passphrase_protection = storage.device.has_passphrase()
|
||||||
m.reset_word_pos = reset_word_index
|
m.reset_word_pos = reset_word_index
|
||||||
m.reset_entropy = reset_internal_entropy
|
m.reset_entropy = reset_internal_entropy
|
||||||
|
@ -12,13 +12,13 @@ async def backup_device(ctx, msg):
|
|||||||
if not storage.device.needs_backup():
|
if not storage.device.needs_backup():
|
||||||
raise wire.ProcessError("Seed already backed up")
|
raise wire.ProcessError("Seed already backed up")
|
||||||
|
|
||||||
mnemonic_secret, mnemonic_module = mnemonic.get()
|
mnemonic_secret, mnemonic_type = mnemonic.get()
|
||||||
slip39 = mnemonic_module == mnemonic.slip39
|
is_slip39 = mnemonic_type == mnemonic.TYPE_SLIP39
|
||||||
|
|
||||||
storage.device.set_unfinished_backup(True)
|
storage.device.set_unfinished_backup(True)
|
||||||
storage.device.set_backed_up()
|
storage.device.set_backed_up()
|
||||||
|
|
||||||
if slip39:
|
if is_slip39:
|
||||||
await backup_slip39_wallet(ctx, mnemonic_secret)
|
await backup_slip39_wallet(ctx, mnemonic_secret)
|
||||||
else:
|
else:
|
||||||
await layout.bip39_show_and_confirm_mnemonic(ctx, mnemonic_secret.decode())
|
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
|
ctx: wire.Context, secret: bytes, mnemonic_type: int
|
||||||
) -> Success:
|
) -> Success:
|
||||||
digest_input = sha256(secret).digest()
|
digest_input = sha256(secret).digest()
|
||||||
stored, _ = mnemonic.get()
|
stored = mnemonic.get_secret()
|
||||||
digest_stored = sha256(stored).digest()
|
digest_stored = sha256(stored).digest()
|
||||||
result = utils.consteq(digest_stored, digest_input)
|
result = utils.consteq(digest_stored, digest_input)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user