Upgrade scrypt to v0.11 (#15228)

This PR upgrades `scrypt` to v0.11.

There were some API changes that impacted our usage just in the tests.

Supersedes #15224.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-07-25 17:45:24 -04:00 committed by GitHub
parent cc1d3f0a35
commit 1da6a12bb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 58 additions and 134 deletions

View file

@ -402,15 +402,16 @@ mod test {
fn previous_hash_access_token(token: &str) -> Result<String> {
// Avoid slow hashing in debug mode.
let params = if cfg!(debug_assertions) {
scrypt::Params::new(1, 1, 1).unwrap()
scrypt::Params::new(1, 1, 1, scrypt::Params::RECOMMENDED_LEN).unwrap()
} else {
scrypt::Params::new(14, 8, 1).unwrap()
scrypt::Params::new(14, 8, 1, scrypt::Params::RECOMMENDED_LEN).unwrap()
};
Ok(Scrypt
.hash_password(
.hash_password_customized(
token.as_bytes(),
None,
None,
params,
&SaltString::generate(thread_rng()),
)