trezor: handle passphrase on-device entry (for Model T)

This commit is contained in:
Roman Zeyde
2018-03-10 09:35:23 +02:00
parent 0c9fc33757
commit cbdc52c0a4

View File

@@ -52,8 +52,10 @@ class Trezor(interface.Device):
if self.ui is None:
return
def new_handler(_):
def new_handler(msg):
try:
if msg.on_device is True:
return self._defs.PassphraseAck()
if self.__class__.cached_passphrase_ack:
log.debug('re-using cached %s passphrase', self)
return self.__class__.cached_passphrase_ack