1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

trezorctl: Allow entering passphrase by environment variable PASSPHRASE.

This commit is contained in:
slush 2018-01-29 18:04:48 +01:00
parent 5b3e992521
commit ab42e93718

View File

@ -278,6 +278,11 @@ class TextUIMixin(object):
return proto.PinMatrixAck(pin=pin)
def callback_PassphraseRequest(self, msg):
if os.getenv("PASSPHRASE") is not None:
passphrase = Mnemonic.normalize_string(os.getenv("PASSPHRASE"))
log("Passphrase required. Using '%s'" % passphrase)
return proto.PassphraseAck(passphrase=passphrase)
log("Passphrase required: ")
passphrase = getpass.getpass('')
log("Confirm your Passphrase: ")