1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-01 03:48:18 +00:00

fix(trezorlib): re-allow usage of passphrases on codec sessions

[no changelog]
This commit is contained in:
M1nd3r 2024-11-28 18:21:14 +01:00
parent 89d9c1f816
commit 25559cc245

View File

@ -154,9 +154,16 @@ class SessionV1(Session):
resp: messages.Features = self.call_raw(
messages.Initialize(session_id=session_id, derive_cardano=derive_cardano)
)
if isinstance(self.passphrase, str):
self.passphrase_callback = _send_passphrase
self._id = resp.session_id
def _send_passphrase(session: Session, resp: t.Any) -> None:
assert isinstance(session.passphrase, str)
return session.call(messages.PassphraseAck(passphrase=session.passphrase))
def _callback_button(session: Session, msg: t.Any) -> t.Any:
print("Please confirm action on your Trezor device.") # TODO how to handle UI?
return session.call(messages.ButtonAck())