From c735299bd086566a4fc9bee96f663b8ec711c15e Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Fri, 26 Jul 2019 12:06:00 +0200 Subject: [PATCH] core/backup: fix mnemonic_module to mnemonic_type --- core/src/apps/debug/__init__.py | 3 ++- core/src/apps/management/backup_device.py | 6 +++--- core/src/apps/management/recovery_device/homescreen.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/src/apps/debug/__init__.py b/core/src/apps/debug/__init__.py index a945f79907..7292cd51c4 100644 --- a/core/src/apps/debug/__init__.py +++ b/core/src/apps/debug/__init__.py @@ -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 diff --git a/core/src/apps/management/backup_device.py b/core/src/apps/management/backup_device.py index ae758636be..965d39fa6d 100644 --- a/core/src/apps/management/backup_device.py +++ b/core/src/apps/management/backup_device.py @@ -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()) diff --git a/core/src/apps/management/recovery_device/homescreen.py b/core/src/apps/management/recovery_device/homescreen.py index 73b98e6d18..1492d069ef 100644 --- a/core/src/apps/management/recovery_device/homescreen.py +++ b/core/src/apps/management/recovery_device/homescreen.py @@ -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)