Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Switch from MD5sum to SHA256 #195

Open
jace opened this issue Mar 6, 2017 · 0 comments
Open

Switch from MD5sum to SHA256 #195

jace opened this issue Mar 6, 2017 · 0 comments

Comments

@jace
Copy link
Member

jace commented Mar 6, 2017

Lastuser stores MD5sum of email, originally to facilitate Gravatar lookup, but as a result of that choice, also in other places like email verification and password reset links.

We should switch out from MD5sum to SHA256, but keep the field for Gravatar:

  1. Add SHA256 column to any model that uses MD5sum
  2. Populate the column and make it a unique constraint
  3. Remove unique constraint from MD5sum, but keep it indexed
  4. In all views that read MD5sum (email verify, reset, etc), change the condition to look up SHA256 first and MD5sum next—possibly by checking data length to decide which lookup to use. This is a transition that can be removed after a week when old links expire.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant