Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions core/src/apps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ def get_pinlocked_handler(

async def wrapper(ctx: wire.Context, msg: wire.Msg) -> protobuf.MessageType:
await unlock_device(ctx)
storage.cache.start_session()
return await orig_handler(ctx, msg)

return wrapper
Expand Down Expand Up @@ -696,11 +697,6 @@ async def handle_GetPassphraseState(
from trezor.messages import PassphraseState
from apps.common import passphrase, paths

# Check if client supports attach pin
(
hasattr(msg, "allow_create_attach_pin")
and msg.allow_create_attach_pin is not None
)
if not device_is_unlocked():
await unlock_device(ctx, pin_use_type=2)
session_id = storage.cache.start_session()
Expand Down Expand Up @@ -760,12 +756,14 @@ async def handle_UnLockDevice(
"""Handle UnLockDevice message to unlock the device if needed."""
if not config.is_unlocked():
await unlock_device(ctx, pin_use_type=2)
storage.cache.start_session()

# Get current device state after unlock attempt
from apps.common import passphrase

unlocked = config.is_unlocked()
unlocked_attach_pin = passphrase.is_passphrase_pin_enabled() if unlocked else False

passphrase_protection = (
storage.device.is_passphrase_enabled() if unlocked else False
)
Expand Down
1 change: 1 addition & 0 deletions core/src/apps/homescreen/lockscreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async def lockscreen() -> None:
# to an unlocked state.
try:
await unlock_device()
storage.cache.start_session()
except wire.PinCancelled:
pass

Expand Down
6 changes: 6 additions & 0 deletions core/src/apps/webauthn/fido2.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,9 @@ async def verify_user(keepalive_callback: KeepaliveCallback) -> bool:
trezor.pin.keepalive_callback = keepalive_callback

await unlock_device()
import storage.cache

storage.cache.start_session()
return True
except Exception:
return False
Expand Down Expand Up @@ -806,6 +809,9 @@ async def confirm_dialog(self) -> bool:

try:
await unlock_device()
import storage.cache

storage.cache.start_session()
return True
except Exception:
return False
Expand Down
7 changes: 7 additions & 0 deletions core/src/trezor/uart.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ async def handle_fingerprint():
if __debug__:
print(f"fingerprint unlock result {res}")
await base.unlock_device()
import storage.cache

storage.cache.start_session()

# await loop.sleep(2000)
return
else:
Expand Down Expand Up @@ -331,6 +335,9 @@ async def _deal_ble_pair(value):
if not base.device_is_unlocked():
try:
await base.unlock_device()
import storage.cache

storage.cache.start_session()
except Exception:
await safe_reloop()
workflow.spawn(utils.internal_reloop())
Expand Down
Loading