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

Fix #6594 Legacy Migration Incompatibility #8878

Draft
wants to merge 2 commits into
base: master
from

Conversation

@dkbast
Copy link

dkbast commented Jul 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"

dkbast added 2 commits Jul 24, 2020
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"
…ibility

Fix #6594 Legacy Migration Incompatibility
@pivotal-issuemaster
Copy link

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
Copy link

pivotal-issuemaster commented Jul 24, 2020

@dkbast Thank you for signing the Contributor License Agreement!

@dkbast dkbast marked this pull request as draft Jul 24, 2020
@rwinch
Copy link
Member

rwinch commented Aug 3, 2020

Can you expand on what you believe the problem is? This PR breaks the build.

@dkbast
Copy link
Author

dkbast commented Aug 4, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.