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:
parent
cc1d3f0a35
commit
1da6a12bb4
3 changed files with 58 additions and 134 deletions
|
@ -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()),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue