Repository navigation
fix(auth): reset isLegacy flag when admin edits account password - #107
Open
martinmarsian wants to merge 1 commit into
Open
martinmarsian wants to merge 1 commit into
martinmarsian wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When an admin changes a user's password via the Edit Account UI (
wired.account.edit), the server stores the new password as a SHA-256 hash — but previously failed to reset theis_legacyflag. Accounts migrated from Wired 2.5 carryis_legacy = true, which tells the connecting client to use SHA-1 for the key-exchange derivation. With a SHA-256 hash stored butis_legacystill set, the server and client derive different values forserverPassword1Data, causing ECDSA verification to fail with "Password mismatch during key exchange" — even after the password was successfully changed by the admin.The fix adds
account.isLegacy = falseinreceiveAccountEditUserwhenever a non-empty password field is present in the edit message, mirroring the behaviour already present inreceiveAccountChangePassword.Changed file
Sources/wired3/Core/ServerController+Admin.swift— one line added insidereceiveAccountEditUser:Test plan
is_legacy = 1in the DB (or migrate one from Wired 2.5)is_legacyis now0in the DB after the edit🤖 Generated with Claude Code