src/apps/management: add confirmation screens to Reset and Recovery

pull/25/head
Pavol Rusnak 6 years ago
parent e9995bf060
commit a0a195fdd3
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -1,7 +1,11 @@
from trezor import config, ui, wire
from trezor.crypto import bip39
from trezor.messages.ButtonRequest import ButtonRequest
from trezor.messages.ButtonRequestType import MnemonicInput, MnemonicWordCount
from trezor.messages.ButtonRequestType import (
MnemonicInput,
MnemonicWordCount,
ProtectCall,
)
from trezor.messages.MessageType import ButtonAck
from trezor.messages.Success import Success
from trezor.pin import pin_to_int
@ -11,6 +15,7 @@ from trezor.ui.word_select import WordSelector
from trezor.utils import format_ordinal
from apps.common import storage
from apps.common.confirm import require_confirm
from apps.management.change_pin import request_pin_confirm
@ -27,6 +32,11 @@ async def recovery_device(ctx, msg):
if not msg.dry_run and storage.is_initialized():
raise wire.UnexpectedMessage("Already initialized")
text = Text("Device recovery", ui.ICON_RECOVERY)
text.normal("Do you really want to", "recover the device?", "")
await require_confirm(ctx, text, code=ProtectCall)
# ask for the number of words
wordcount = await request_wordcount(ctx)

@ -31,6 +31,11 @@ async def reset_device(ctx, msg):
if storage.is_initialized():
raise wire.UnexpectedMessage("Already initialized")
text = Text("Create a new wallet", ui.ICON_RESET)
text.normal("Do you really want to", "create a new wallet?", "")
await require_confirm(ctx, text, code=ButtonRequestType.ResetDevice)
# request new PIN
if msg.pin_protection:
newpin = await request_pin_confirm(ctx)

Loading…
Cancel
Save