diff --git a/common/protob/messages-common.proto b/common/protob/messages-common.proto index 127be8d6ce..2f08232d09 100644 --- a/common/protob/messages-common.proto +++ b/common/protob/messages-common.proto @@ -62,11 +62,12 @@ message ButtonRequest { ButtonRequest_PublicKey = 11; ButtonRequest_MnemonicWordCount = 12; ButtonRequest_MnemonicInput = 13; - ButtonRequest_PassphraseType = 14; +// ButtonRequest_PassphraseType = 14; DEPRECATED ButtonRequest_UnknownDerivationPath = 15; ButtonRequest_RecoveryHomepage = 16; ButtonRequest_Success = 17; ButtonRequest_Warning = 18; + ButtonRequest_PassphraseEntry = 19; } } diff --git a/core/src/apps/common/passphrase.py b/core/src/apps/common/passphrase.py index 492e821bcf..de39eb6bff 100644 --- a/core/src/apps/common/passphrase.py +++ b/core/src/apps/common/passphrase.py @@ -2,6 +2,9 @@ from micropython import const import storage.device from trezor import wire +from trezor.messages import ButtonRequestType +from trezor.messages.ButtonAck import ButtonAck +from trezor.messages.ButtonRequest import ButtonRequest from trezor.messages.PassphraseAck import PassphraseAck from trezor.messages.PassphraseRequest import PassphraseRequest from trezor.ui.passphrase import CANCELLED, PassphraseKeyboard @@ -42,6 +45,8 @@ async def request_from_user(ctx: wire.Context) -> str: async def request_from_user_on_device(ctx: wire.Context) -> str: + await ctx.call(ButtonRequest(code=ButtonRequestType.PassphraseEntry), ButtonAck) + keyboard = PassphraseKeyboard("Enter passphrase", _MAX_PASSPHRASE_LEN) if __debug__: passphrase = await ctx.wait(keyboard, input_signal()) diff --git a/core/src/trezor/messages/ButtonRequest.py b/core/src/trezor/messages/ButtonRequest.py index 69d1b390bd..334ff59542 100644 --- a/core/src/trezor/messages/ButtonRequest.py +++ b/core/src/trezor/messages/ButtonRequest.py @@ -6,7 +6,7 @@ if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 - EnumTypeButtonRequestType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] + EnumTypeButtonRequestType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19] except ImportError: pass @@ -23,5 +23,5 @@ class ButtonRequest(p.MessageType): @classmethod def get_fields(cls) -> Dict: return { - 1: ('code', p.EnumType("ButtonRequestType", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)), 0), + 1: ('code', p.EnumType("ButtonRequestType", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19)), 0), } diff --git a/core/src/trezor/messages/ButtonRequestType.py b/core/src/trezor/messages/ButtonRequestType.py index f29e98d1e4..c973ce8aa4 100644 --- a/core/src/trezor/messages/ButtonRequestType.py +++ b/core/src/trezor/messages/ButtonRequestType.py @@ -16,8 +16,8 @@ Address = 10 # type: Literal[10] PublicKey = 11 # type: Literal[11] MnemonicWordCount = 12 # type: Literal[12] MnemonicInput = 13 # type: Literal[13] -PassphraseType = 14 # type: Literal[14] UnknownDerivationPath = 15 # type: Literal[15] RecoveryHomepage = 16 # type: Literal[16] Success = 17 # type: Literal[17] Warning = 18 # type: Literal[18] +PassphraseEntry = 19 # type: Literal[19] diff --git a/python/src/trezorlib/messages/ButtonRequest.py b/python/src/trezorlib/messages/ButtonRequest.py index 57f4b524d1..5592eb6388 100644 --- a/python/src/trezorlib/messages/ButtonRequest.py +++ b/python/src/trezorlib/messages/ButtonRequest.py @@ -6,7 +6,7 @@ if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 - EnumTypeButtonRequestType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] + EnumTypeButtonRequestType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19] except ImportError: pass @@ -23,5 +23,5 @@ class ButtonRequest(p.MessageType): @classmethod def get_fields(cls) -> Dict: return { - 1: ('code', p.EnumType("ButtonRequestType", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)), 0), + 1: ('code', p.EnumType("ButtonRequestType", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19)), 0), } diff --git a/python/src/trezorlib/messages/ButtonRequestType.py b/python/src/trezorlib/messages/ButtonRequestType.py index f29e98d1e4..c973ce8aa4 100644 --- a/python/src/trezorlib/messages/ButtonRequestType.py +++ b/python/src/trezorlib/messages/ButtonRequestType.py @@ -16,8 +16,8 @@ Address = 10 # type: Literal[10] PublicKey = 11 # type: Literal[11] MnemonicWordCount = 12 # type: Literal[12] MnemonicInput = 13 # type: Literal[13] -PassphraseType = 14 # type: Literal[14] UnknownDerivationPath = 15 # type: Literal[15] RecoveryHomepage = 16 # type: Literal[16] Success = 17 # type: Literal[17] Warning = 18 # type: Literal[18] +PassphraseEntry = 19 # type: Literal[19]