You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7463a34
Browse filesBrowse the repository at this point in the historyBrowse files
* Fix non-atomic device-key write in ClearStoredTokens
ClearStoredTokens in DeviceIdentityStore used File.WriteAllBytes to
rewrite device-key-ed25519.json. A crash/power-loss mid-write could leave
a torn file, causing LoadExisting to silently regenerate a new keypair
and rotate the device identity.
Fix: Add DeviceIdentity.TryClearAllDeviceTokens that strips all token
fields using raw JSON filtering and writes atomically via temp-file +
File.Move (same pattern as AtomicWriteKeyFile). ClearStoredTokens now
delegates to it.
Also add AtomicWriteKeyFileRaw for the ConnectionPage rollback-restore
path that previously used File.WriteAllText directly.
Fixes#888
Co-authored-by: Copilot <[email protected]>
* Handle non-object identity JSON during token clear
Guard TryClearAllDeviceTokens before enumerating JSON object properties so valid-but-non-object JSON remains a best-effort no-op instead of throwing through ClearStoredTokens.
Co-authored-by: Copilot <[email protected]>
* Preserve best-effort token clear behavior
Keep DeviceIdentityStore.ClearStoredTokens as a best-effort operation by logging unexpected failures from the shared atomic token-clear helper instead of allowing them to escape connection cleanup flows.
Co-authored-by: Copilot <[email protected]>
---------
Co-authored-by: Christine Yan <[email protected]>
Co-authored-by: Copilot <[email protected]>
0 commit comments