From ab42e93718e2c60ad526ed23ac8f6744553c748e Mon Sep 17 00:00:00 2001 From: slush Date: Mon, 29 Jan 2018 18:04:48 +0100 Subject: [PATCH] trezorctl: Allow entering passphrase by environment variable PASSPHRASE. --- trezorlib/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/trezorlib/client.py b/trezorlib/client.py index 950d8f9..1a9c05e 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -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: ")