1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-13 19:18:56 +00:00

core: show passphrase on device

This commit is contained in:
Pavol Rusnak 2020-07-10 15:38:52 +02:00 committed by Tomas Susanka
parent e2632b16dc
commit cdf0f68bb0

View File

@ -10,6 +10,7 @@ from trezor.ui.passphrase import CANCELLED, PassphraseKeyboard
from trezor.ui.text import Text
from . import button_request
from .confirm import require_confirm
_MAX_PASSPHRASE_LEN = const(50)
@ -53,6 +54,22 @@ async def _request_on_host(ctx: wire.Context) -> str:
raise wire.DataError(
"Passphrase not provided and on_device is False. Use empty string to set an empty passphrase."
)
# non-empty passphrase
if ack.passphrase:
text = Text("Hidden wallet", ICON_CONFIG)
text.normal("Access hidden wallet?")
text.br()
text.normal("Next screen will show")
text.normal("the passphrase!")
await require_confirm(ctx, text, ButtonRequestType.Other)
text = Text("Hidden wallet", ICON_CONFIG)
text.normal("Use this passphrase?")
text.br()
text.mono(ack.passphrase)
await require_confirm(ctx, text, ButtonRequestType.Other)
return ack.passphrase