fix(cryptography): support php builds without argon2#2165
Draft
WarLikeLaux wants to merge 1 commit into
Draft
Conversation
Member
|
@brendt would we be fine with a breaking change that would use bcrypt by default? We can't automate config changes unfortunately, and this fallback implementation is not really ideal. As far as I know, Argon2 support is in most default PHP installations, so we can also just specify in the docs that it's required for Tempest to run by default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HashingAlgorithmtook its case values fromPASSWORD_ARGON2ID/PASSWORD_BCRYPT, butPASSWORD_ARGON2IDonly exists on PHP builds compiled with Argon2. Without it the enum can't load, which also kills the bcrypt path (BcryptConfigreferencesHashingAlgorithm::BCRYPT) and the defaulthashing.config.php(new ArgonConfig()) hits a fatal on boot before any bcrypt override applies. The enum now uses the literal strings behind those constants ('argon2id','2y') - the same valuespassword_hash()accepts andpassword_get_info()returns.The default config falls back to bcrypt only when Argon2 isn't available, so Argon2id stays the default on every build that supports it and the framework boots on the ones that don't.
Fixes #2147