core: don't erase passphrase on ClearSession

pull/152/head
Pavol Rusnak 5 years ago
parent 4358318806
commit 4097f254d5
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -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…
Cancel
Save