diff --git a/core/src/apps/base.py b/core/src/apps/base.py index 1cc546a959..e026cf2ae8 100644 --- a/core/src/apps/base.py +++ b/core/src/apps/base.py @@ -242,6 +242,7 @@ if utils.USE_THP: new_session = create_new_session(channel) try: + await unlock_device() await derive_and_store_roots(new_session, message) except DataError as e: return Failure(code=FailureType.DataError, message=e.message) diff --git a/core/src/trezor/wire/thp/thp_main.py b/core/src/trezor/wire/thp/thp_main.py index a529a22367..c289dbf47b 100644 --- a/core/src/trezor/wire/thp/thp_main.py +++ b/core/src/trezor/wire/thp/thp_main.py @@ -145,7 +145,7 @@ def _try_allocate_new_buffer(payload_length: int) -> utils.BufferType: try: payload: utils.BufferType = bytearray(payload_length) except MemoryError: - payload = bytearray(PACKET_LENGTH) + payload = bytearray(PACKET_LENGTH) # TODO ??? raise ThpError("Message too large") return payload diff --git a/python/src/trezorlib/cli/__init__.py b/python/src/trezorlib/cli/__init__.py index 0b14778ed7..18253a06ec 100644 --- a/python/src/trezorlib/cli/__init__.py +++ b/python/src/trezorlib/cli/__init__.py @@ -265,6 +265,7 @@ def with_session( if management: session = obj.get_management_session() else: + # TODO try (sys.exit ve finally) session = obj.get_session( derive_cardano=derive_cardano, empty_passphrase=empty_passphrase,