From 1bc69fa2d6d8cc76cb7feac5bdf25326f177e263 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 18 Feb 2019 20:05:26 +0100 Subject: [PATCH] src/apps/management/recovery_device: ask for PIN in dry_run --- src/apps/management/recovery_device.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/apps/management/recovery_device.py b/src/apps/management/recovery_device.py index 23b34ad48b..07772b085b 100644 --- a/src/apps/management/recovery_device.py +++ b/src/apps/management/recovery_device.py @@ -17,7 +17,7 @@ from trezor.utils import consteq, format_ordinal from apps.common import storage from apps.common.confirm import require_confirm -from apps.management.change_pin import request_pin_confirm +from apps.management.change_pin import request_pin_ack, request_pin_confirm async def recovery_device(ctx, msg): @@ -38,6 +38,11 @@ async def recovery_device(ctx, msg): await require_confirm(ctx, text, code=ProtectCall) + if msg.dry_run and config.has_pin(): + curpin = await request_pin_ack(ctx, "Enter PIN", config.get_pin_rem()) + if not config.check_pin(pin_to_int(curpin)): + raise wire.PinInvalid("PIN invalid") + # ask for the number of words wordcount = await request_wordcount(ctx)