Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encrypt transition #189

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

cazfi
Copy link
Contributor

@cazfi cazfi commented Mar 20, 2022

Patch or patches to start transition from the old password encryption to the new one, required by upcoming database engine update.

First commit implements authentication part (authentication of each account by the method matching how password is currently stored) + creation of the new accounts (always) with the new encryption. At least this one is needed.

The second commit adds migration of existing accounts to the above. When user gets successfully authenticated by the old method (i.e. when user of an existing account logins for the first time since this commit has been applied), the plain-text password used is encrypted with the new method, and updated to the database.

I've tested these with persistent (one first populated without these commits & ENCRYPT change already in the master branch) database living on ubuntu-18.04 virtual machine. Both pre-existing and new accounts created after applying the commits authenticate correctly. Database fields seem to update in a sane way ('auth' table gets the new column, indicating whether account has already migrated or not, when freeciv-web is first updated, information on the table is changing as expected when accounts are created and authenticated).
What still needs to be tested is that this really resolves the issue for which it exist - to allow updating the database engine (as part of OS update) with all the migrated accounts still working.

These leave it open what happens when the account migration period ends - what old information we still keep after we lose the ability to do further migrations.

cazfi added 2 commits March 20, 2022 12:09
- Store information whether account has been migrated or not
- Authenticate user either with the old or new system depending on
  whether they have been marked already migrated
- Create new accounts as already migrated ones

This first part does NOT implement migration of existing accounts.

Signed-off-by: Marko Lindqvist <[email protected]>
Accounts are migrated when they login the first time during
the transition period. Plain-text passwords that the client
sends for authentication are also encrypted with the new method,
and the password encrypted with the old method are replaced
by those.

Signed-off-by: Marko Lindqvist <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant