-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(argon2): respect max value for hashingThreads #45027
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
base: master
Are you sure you want to change the base?
Conversation
| if (\defined('PASSWORD_ARGON2_PROVIDER')) { | ||
| // password_hash fails, when the minimum values are undershot or maximum overshot | ||
| // In this case, apply minimum/maximum. | ||
| if (PASSWORD_ARGON2_PROVIDER === 'sodium') { |
Check failure
Code scanning / Psalm
TypeDoesNotContainType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obviously a false positive
$ php -r 'var_dump(PASSWORD_ARGON2_PROVIDER);'
string(6) "sodium"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add it to baseline or add a comment to suppress it?
Signed-off-by: Remi Collet <[email protected]>
abef80a to
2be8c3f
Compare
Summary
When argon2 password hashing is provided bu sodium extension, threads is not supported, so value > 1 raise an exception
See https://github.com/php/php-src/blob/PHP-8.1.28/ext/sodium/sodium_pwhash.c#L65
Threads are only supported by standard extension (libargon2) and soon by openssl extension (with OpenSSL 3.2 and PHP 8.4)
Checklist