mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-31 18:40:56 +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)
|
||||
|
||||
def callback_PassphraseRequest(self, msg):
|
||||
if msg.on_device is True:
|
||||
return proto.PassphraseAck()
|
||||
|
||||
if os.getenv("PASSPHRASE") is not None:
|
||||
log("Passphrase required. Using PASSPHRASE environment variable.")
|
||||
passphrase = Mnemonic.normalize_string(os.getenv("PASSPHRASE"))
|
||||
|
@ -6,5 +6,6 @@ from .. import protobuf as p
|
||||
class PassphraseAck(p.MessageType):
|
||||
FIELDS = {
|
||||
1: ('passphrase', p.UnicodeType, 0), # required
|
||||
2: ('state', p.BytesType, 0),
|
||||
}
|
||||
MESSAGE_WIRE_TYPE = 42
|
||||
|
@ -4,4 +4,7 @@ from .. import protobuf as p
|
||||
|
||||
|
||||
class PassphraseRequest(p.MessageType):
|
||||
FIELDS = {
|
||||
1: ('on_device', p.BoolType, 0),
|
||||
}
|
||||
MESSAGE_WIRE_TYPE = 41
|
||||
|
Loading…
Reference in New Issue
Block a user