mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 20:11:00 +00:00
client: implement PassphraseRequest.on_device handling
This commit is contained in:
parent
e256281a99
commit
bccd61cb23
@ -278,6 +278,9 @@ class TextUIMixin(object):
|
|||||||
return proto.PinMatrixAck(pin=pin)
|
return proto.PinMatrixAck(pin=pin)
|
||||||
|
|
||||||
def callback_PassphraseRequest(self, msg):
|
def callback_PassphraseRequest(self, msg):
|
||||||
|
if msg.on_device is True:
|
||||||
|
return proto.PassphraseAck()
|
||||||
|
|
||||||
if os.getenv("PASSPHRASE") is not None:
|
if os.getenv("PASSPHRASE") is not None:
|
||||||
log("Passphrase required. Using PASSPHRASE environment variable.")
|
log("Passphrase required. Using PASSPHRASE environment variable.")
|
||||||
passphrase = Mnemonic.normalize_string(os.getenv("PASSPHRASE"))
|
passphrase = Mnemonic.normalize_string(os.getenv("PASSPHRASE"))
|
||||||
|
@ -6,5 +6,6 @@ from .. import protobuf as p
|
|||||||
class PassphraseAck(p.MessageType):
|
class PassphraseAck(p.MessageType):
|
||||||
FIELDS = {
|
FIELDS = {
|
||||||
1: ('passphrase', p.UnicodeType, 0), # required
|
1: ('passphrase', p.UnicodeType, 0), # required
|
||||||
|
2: ('state', p.BytesType, 0),
|
||||||
}
|
}
|
||||||
MESSAGE_WIRE_TYPE = 42
|
MESSAGE_WIRE_TYPE = 42
|
||||||
|
@ -4,4 +4,7 @@ from .. import protobuf as p
|
|||||||
|
|
||||||
|
|
||||||
class PassphraseRequest(p.MessageType):
|
class PassphraseRequest(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('on_device', p.BoolType, 0),
|
||||||
|
}
|
||||||
MESSAGE_WIRE_TYPE = 41
|
MESSAGE_WIRE_TYPE = 41
|
||||||
|
Loading…
Reference in New Issue
Block a user