Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix #6594 Legacy Migration Incompatibility #8878
Conversation
Changes the behaviour of extractSalt to match the documentation (and the expected behaviour).
Before:
prefixEncodedPassword = "{this_is_the_salt}hash"
extractSalt(prefixEncodedPassword) == "{this_is_the_salt}"
Now:
prefixEncodedPassword = "{this_is_the_salt}hash"
extractSalt(prefixEncodedPassword) == "this_is_the_salt"
pivotal-issuemaster
commented
Jul 24, 2020
|
@dkbast Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
pivotal-issuemaster
commented
Jul 24, 2020
|
@dkbast Thank you for signing the Contributor License Agreement! |
|
Can you expand on what you believe the problem is? This PR breaks the build. |
When working with legacy code it is common to have the salt and hash in separate columns of the database. The salt used to decode is randomly generated and does not include the forced curly brackets which the MessageDigestPasswordEncoder enforces. The expected behaviour would be to pass a string like "{salt}hash" and have the MessageDigestPasswordEncoder use "salt" as the salt and not "{salt}" since the hash was generated with "salt". This is the same problem encountered in #6594 The questioning the issue is: what is the point in having a backwards compatible algorithm if it cannot be applied to old data. I marked this as draft since I decided to rewrite the class in my project and didn't get around finding a general solution. |
dkbast commentedJul 24, 2020
Changes the behaviour of extractSalt to match the documentation (and the expected behaviour). Closes #6594
Before:
prefixEncodedPassword = "{this_is_the_salt}hash"
extractSalt(prefixEncodedPassword) == "{this_is_the_salt}"
Now:
prefixEncodedPassword = "{this_is_the_salt}hash"
extractSalt(prefixEncodedPassword) == "this_is_the_salt"