1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

src/apps/management/recovery_device: ask for PIN in dry_run

This commit is contained in:
Pavol Rusnak 2019-02-18 20:05:26 +01:00
parent b1a382c75b
commit 1bc69fa2d6
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -17,7 +17,7 @@ from trezor.utils import consteq, format_ordinal
from apps.common import storage from apps.common import storage
from apps.common.confirm import require_confirm 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): async def recovery_device(ctx, msg):
@ -38,6 +38,11 @@ async def recovery_device(ctx, msg):
await require_confirm(ctx, text, code=ProtectCall) 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 # ask for the number of words
wordcount = await request_wordcount(ctx) wordcount = await request_wordcount(ctx)