diff --git a/core/src/apps/monero/live_refresh.py b/core/src/apps/monero/live_refresh.py index b192de52b..ae353ea24 100644 --- a/core/src/apps/monero/live_refresh.py +++ b/core/src/apps/monero/live_refresh.py @@ -1,6 +1,6 @@ import gc -from storage.cache import get_passphrase_fprint +import storage.cache from trezor import log from trezor.messages import MessageType from trezor.messages.MoneroLiveRefreshFinalAck import MoneroLiveRefreshFinalAck @@ -49,10 +49,10 @@ async def _init_step( ctx, misc.validate_full_path, keychain, msg.address_n, CURVE ) - passphrase_fprint = get_passphrase_fprint() - if live_refresh_token() != passphrase_fprint: + fingerprint = storage.cache.get_session_id()[:4] + if live_refresh_token() != fingerprint: await confirms.require_confirm_live_refresh(ctx) - live_refresh_token(passphrase_fprint) + live_refresh_token(fingerprint) s.creds = misc.get_creds(keychain, msg.address_n, msg.network_type) diff --git a/core/src/storage/cache.py b/core/src/storage/cache.py index 42cf02dbb..0fac8e5df 100644 --- a/core/src/storage/cache.py +++ b/core/src/storage/cache.py @@ -8,7 +8,7 @@ _cached_seed_without_passphrase = None # type: Optional[bytes] # Needed for SL _cached_session_id = None # type: Optional[bytes] -def get_session_id() -> Optional[bytes]: +def get_session_id() -> bytes: global _cached_session_id if not _cached_session_id: _cached_session_id = random.bytes(32)