@@ -664,6 +664,7 @@ def get_pinlocked_handler(
664664
665665 async def wrapper (ctx : wire .Context , msg : wire .Msg ) -> protobuf .MessageType :
666666 await unlock_device (ctx )
667+ storage .cache .start_session ()
667668 return await orig_handler (ctx , msg )
668669
669670 return wrapper
@@ -696,13 +697,8 @@ async def handle_GetPassphraseState(
696697 from trezor .messages import PassphraseState
697698 from apps .common import passphrase , paths
698699
699- # Check if client supports attach pin
700- (
701- hasattr (msg , "allow_create_attach_pin" )
702- and msg .allow_create_attach_pin is not None
703- )
704700 if not device_is_unlocked ():
705- await unlock_device (ctx , pin_use_type = 2 )
701+ await unlock_device (ctx , pin_use_type = PinType . USER_AND_PASSPHRASE_PIN )
706702 session_id = storage .cache .start_session ()
707703
708704 from trezor .lvglui .scrs import fingerprints
@@ -759,13 +755,15 @@ async def handle_UnLockDevice(
759755) -> UnLockDeviceResponse :
760756 """Handle UnLockDevice message to unlock the device if needed."""
761757 if not config .is_unlocked ():
762- await unlock_device (ctx , pin_use_type = 2 )
758+ await unlock_device (ctx , pin_use_type = PinType .USER_AND_PASSPHRASE_PIN )
759+ storage .cache .start_session ()
763760
764761 # Get current device state after unlock attempt
765762 from apps .common import passphrase
766763
767764 unlocked = config .is_unlocked ()
768765 unlocked_attach_pin = passphrase .is_passphrase_pin_enabled () if unlocked else False
766+
769767 passphrase_protection = (
770768 storage .device .is_passphrase_enabled () if unlocked else False
771769 )
0 commit comments