-
Notifications
You must be signed in to change notification settings - Fork 3.2k
#21022 Switch to using bcrypt for hashing passwords #7333
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
Closed
Closed
Changes from 15 commits
Commits
Show all changes
114 commits
Select commit
Hold shift + click to select a range
fe1c16e
Begin switching the password hashing mechanism from phpass to bcrypt.
johnbillion 82d937f
Update the handling of user passwords, password reset keys, and user …
johnbillion f12e93d
Update the handling of the recovery mode key.
johnbillion 5a46809
Update the handling of post passwords.
johnbillion d4e4e47
Automatically rehash user passwords and application passwords after t…
johnbillion 638421d
Docs.
johnbillion 316cb41
Juggle this a bit.
johnbillion 76fa518
Trying to get these tests in order.
johnbillion d707939
More docs.
johnbillion 4a796b7
Retain validity of phpass hashed password reset keys.
johnbillion 64dfd57
Retain validity of a phpass hashed recovery mode key.
johnbillion e161994
Retain validity of phpass hashed user request keys.
johnbillion 548f937
More docs.
johnbillion fe9b053
Add tests for password rehashing when signing in with a username or e…
johnbillion 33cf000
Docs.
johnbillion d51cbc2
Ensure `wp_check_password()` remains compatible with changes to the d…
johnbillion 6b5441c
Simplify this logic.
johnbillion 89e0645
Add tests for Argon2 support.
johnbillion 085b73c
Always pass the return value of `wp_check_password()` through the `ch…
johnbillion 3e078a7
Reintroduce support for the `$wp_hasher` global if it's set.
johnbillion be636be
Test the tests.
johnbillion 4265787
Docs.
johnbillion fd6bcdd
Start splitting up and fixing these tests.
johnbillion 392e612
Coding standards.
johnbillion 9040193
Add a todo.
johnbillion bc99ca1
Add some more assertions to the application password auth tests.
johnbillion 58a89e2
Correct and add tests for the application password rehashing.
johnbillion 49871d0
Done.
johnbillion b42e57b
Coding standards.
johnbillion 2baeb19
Allow either the name or password to change in order to allow an appl…
johnbillion 95f6d94
Docs.
johnbillion f8974eb
PHP 7.2 compatibility.
johnbillion ff85df2
Docs.
johnbillion ebcdd26
Add a test to ensure the user's account password isn't touched when r…
johnbillion 140b9d4
Merge branch 'trunk' into 21022-bcrypt
johnbillion ea8c56c
One fewer regexes in the world.
johnbillion 2ef2077
Merge branch 'trunk' into 21022-bcrypt
johnbillion 3a951ef
Allow the password hashing options to be filtered.
johnbillion 53acf70
Docs.
johnbillion 5944d9a
Merge branch 'trunk' into 21022-bcrypt
johnbillion 820f48f
Cease hashing passwords as md5 during the upgrade routine and/or the …
johnbillion c07e618
More tests for empty values.
johnbillion 5d33621
More updates to the tests.
johnbillion 0063154
Add a test to verify that a password gets rehashed when the default c…
johnbillion 1aea250
This might as well go here.
johnbillion d6c7837
Add tests for post password handling.
johnbillion 8b1dbd2
Merge branch 'trunk' into 21022-bcrypt
johnbillion 5824f4c
Clear the cookie value before performing the assertions.
johnbillion 2502179
Implement pre-hashing with sha384 to retain entropy of passwords over…
johnbillion 2321412
Implement domain separation for the password to protect against passw…
johnbillion d86ef6d
Remove assertions that are unnecessarily specific to bcrypt.
johnbillion 09ddc5e
The default bcrypt cost was increased in PHP 8.4.
johnbillion a27411d
Merge branch 'trunk' into 21022-bcrypt-sha2
johnbillion e5f8d5c
Merge branch 'trunk' into 21022-bcrypt
johnbillion 9bb86a8
Merge branch '21022-bcrypt' into 21022-bcrypt-sha2
johnbillion 1cebd80
Switch to HMAC in place of manually prepending the domain separation …
johnbillion 537ee4a
Introduce the `wp_hash_password_algorithm` filter for controlling the…
johnbillion 8a99edd
Why.
johnbillion 68634f0
Vanilla bcrypt hashes should be rehashed to use pre-hashing.
johnbillion adf983f
Let's bring this more inline with the other tests.
johnbillion 754519b
No need to perform a prefix check here, just let `wp_check_password()…
johnbillion 35d1885
Merge branch 'trunk' into 21022-bcrypt-algo-filter
johnbillion 0c49b94
Docs.
johnbillion f85a6cb
Merge branch 'trunk' into 21022-bcrypt
johnbillion 413e81f
Switch to using a fast sha1 hash for password reset keys, user reques…
johnbillion 4880c6e
Switch from SHA-1 to SHA-256 in the security key HMACs.
johnbillion cb46077
Use a more fitting hash prefix.
johnbillion a9a1c17
Update some more tests.
johnbillion 8b4d40e
Introduce wrapper functions for hashing and checking a value with BLA…
johnbillion 9994922
Replace SHA-256 and SHA-1 with BLAKE2b when hashing of password reset…
johnbillion d80491d
Switch application passwords over to BLAKE2b instead of phpass.
johnbillion f222f64
Remove opportunistic rehashing of application passwords.
johnbillion c966123
The hash extension is now required due to the use of sha384.
johnbillion 7b3eb9a
Enforce an upper key length.
johnbillion e3fcdca
Ensure the salt satisfies the constraints for key length in Sodium.
johnbillion 1d1ab91
Add some type safety.
johnbillion a94d7ff
Merge branch 'trunk' into 21022-bcrypt
johnbillion 8e4652e
Merge branch 'trunk' into 21022-application-passwords
johnbillion 20eb361
Remove salting from the fast hashing function.
johnbillion 37e0cd7
Docs.
johnbillion 9a58b91
Tidying up.
johnbillion d62c5d3
Rename these functions.
johnbillion 5f1a8ee
Docs.
johnbillion 8931037
More docs.
johnbillion 141b031
Merge branch '21022-application-passwords' into 21022-bcrypt
johnbillion a5c105b
Merge branch 'trunk' into 21022-bcrypt
johnbillion 74f8ecf
More docs!
johnbillion 1d97c7d
This is no longer needed.
johnbillion 5e7e059
Merge branch 'trunk' into 21022-bcrypt
johnbillion 3635023
No need to duplicate this everywhere.
johnbillion 2686d46
Add tests for `wp_fast_hash()` and `wp_verify_fast_hash()` and correc…
johnbillion 1227f17
Ensure that the password fragment used in the auth cookie key always …
johnbillion 66f1bd8
More accurate naming and test coverage declaration.
johnbillion 946c93f
Retain current cookie hashing behaviour for vanilla bcrypt hashes too.
johnbillion afff6fe
Docs.
johnbillion 0cae584
Add tests for retaining validity of an auth cookie generated with a p…
johnbillion 0bdec8e
Fully reinstall WordPress between performance runs. This ensures ther…
johnbillion 9ee9ee2
Revert "Fully reinstall WordPress between performance runs. This ensu…
johnbillion b0f83d4
Reorder the performance tests so the base tests run first, followed b…
johnbillion 1c85aea
o_O
johnbillion 540d77b
Reinstate the initial build.
johnbillion bb1d062
It's Sunday.
johnbillion 0d06290
Merge branch 'trunk' into 21022-bcrypt
johnbillion c7079c1
Fix some path handling when installing the local environment from the…
johnbillion 59535cd
Merge branch 'trunk' into 21022-bcrypt
johnbillion 4d34c39
Merge branch 'trunk' into 21022-bcrypt
johnbillion 976c255
Mark some parameters as sensitive.
johnbillion 3e8a96e
Merge branch 'trunk' into 21022-bcrypt
johnbillion 935a322
Switch back to phpass for post passwords. We'll revisit this in a fol…
johnbillion 54b722d
Add a user ID argument and a filter to `password_needs_rehash()`.
johnbillion 21e352c
More docs.
johnbillion 7325ca9
More docs.
johnbillion 8bee410
Revert another test change.
johnbillion c95fe93
This is no longer implemented, but the other tests can remain.
johnbillion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.