mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 07:28:10 +00:00
core: don't erase passphrase on ClearSession
This commit is contained in:
parent
4358318806
commit
4097f254d5
@ -56,9 +56,7 @@ def set_passphrase(passphrase):
|
||||
_cached_passphrase_fprint = _compute_state(b"FPRINT", passphrase or "")[:4]
|
||||
|
||||
|
||||
def clear(skip_passphrase: bool = False):
|
||||
def clear(keep_passphrase: bool = False):
|
||||
set_seed(None)
|
||||
if skip_passphrase:
|
||||
set_passphrase("")
|
||||
else:
|
||||
if not keep_passphrase:
|
||||
set_passphrase(None)
|
||||
|
@ -32,7 +32,9 @@ def get_features():
|
||||
|
||||
async def handle_Initialize(ctx, msg):
|
||||
if msg.state is None or msg.state != cache.get_state(prev_state=bytes(msg.state)):
|
||||
cache.clear(msg.skip_passphrase)
|
||||
cache.clear()
|
||||
if msg.skip_passphrase:
|
||||
cache.set_passphrase("")
|
||||
return get_features()
|
||||
|
||||
|
||||
@ -45,7 +47,7 @@ async def handle_Cancel(ctx, msg):
|
||||
|
||||
|
||||
async def handle_ClearSession(ctx, msg):
|
||||
cache.clear()
|
||||
cache.clear(keep_passphrase=True)
|
||||
return Success(message="Session cleared")
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user