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(argond2id):reordering parameters order during serialization to ma… #13

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

Benjamin-htr
Copy link
Contributor

@Benjamin-htr Benjamin-htr commented Sep 16, 2024

…tch phc standard

🔗 Linked issue

#12

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Resolves #12

Reordeing parameters order of argon2id hash during serialization process to match this line of phc standard :
"The parameters shall appear in the m,t,p,keyid,data order."
https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md

and to resolve compatibility issue with other tools described on the above issue

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Tests

All tests passed
image

@RomainLanz RomainLanz self-assigned this Sep 16, 2024
@RomainLanz
Copy link
Member

Hey @Benjamin-htr! 👋🏻

Just to clarify — are you saying our package doesn't recognize other hashes, or that the other tool can't read our hash?

Since the parameters are handled as an object, their order shouldn't matter.

@Benjamin-htr
Copy link
Contributor Author

Other tools are not able to validate adonisjs/hash generated hashs because of the parameters order

@thetutlage
Copy link
Member

Just to make sure we are not breaking old hashes. Can you please add a test that has assertions on a pre-computed hash with wrong and the right order.

@thetutlage thetutlage merged commit b90de8d into adonisjs:9.x Sep 17, 2024
5 checks passed
@thetutlage
Copy link
Member

Thanks 👍

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.

Parameters order of argon2id are not "standard" and cause password not match with other tools
3 participants