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
1 changed files with 5 additions and 0 deletions

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: ")