예제 #1
0
    def callback_PassphraseRequest(self, msg):
        if self.passphrase is not None:
            return proto.PassphraseAck(passphrase=str(self.passphrase))

        if self.readpassphrasefromstdin:
            # read passphrase from stdin
            try:
                passphrase = getpass.getpass(u"Please enter passphrase: ")
                passphrase = encoding.normalize_nfc(passphrase)
            except KeyboardInterrupt:
                sys.stderr.write(
                    u"\nKeyboard interrupt: passphrase not read. Aborting.\n")
                sys.exit(3)
            except Exception as e:
                sys.stderr.write(
                    u"Critical error: Passphrase not read. Aborting. (%s)" % e)
                sys.exit(3)
        else:
            dialog = TrezorPassphraseDialog()
            if not dialog.exec_():
                sys.exit(3)
            else:
                passphrase = dialog.passphrase()

        return proto.PassphraseAck(passphrase=passphrase)
예제 #2
0
 def callback_PassphraseRequest(self, msg):
     if self.passphrase is not None:
         return messages_pb2.PassphraseAck(passphrase=self.passphrase)
     dialog = TrezorPassphraseDialog()
     if not dialog.exec_():
         sys.exit(3)
     else:
         passphrase = dialog.passphraseEdit.text()
         passphrase = unicode(passphrase)
     return messages_pb2.PassphraseAck(passphrase=passphrase)
 def callback_PassphraseRequest(self, msg):
     passphrase = self.ask_for_pass_fun(msg)
     if passphrase is None:
         raise HardwareWalletCancelException('Cancelled')
     else:
         passphrase = unicodedata.normalize('NFKD', passphrase)
     return trezor_proto.PassphraseAck(passphrase=passphrase)
예제 #4
0
 def callback_PassphraseRequest(self, msg):
     passphrase = self.ask_for_pass_fun(msg)
     if not passphrase:
         raise HardwareWalletCancelException('Cancelled')
     return trezor_proto.PassphraseAck(passphrase=passphrase)