diff --git a/Cargo.lock b/Cargo.lock index 3ee79b2a..f5112d98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6291,14 +6291,13 @@ dependencies = [ [[package]] name = "rust-argon2" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5885493fdf0be6cdff808d1533ce878d21cfa49c7086fa00c66355cd9141bfc" +checksum = "1e71971821b3ae0e769e4a4328dbcb517607b434db7697e9aba17203ec14e46a" dependencies = [ "base64 0.21.5", "blake2b_simd", "constant_time_eq", - "crossbeam-utils 0.8.16", ] [[package]] diff --git a/auth/simple-auth-server/Cargo.toml b/auth/simple-auth-server/Cargo.toml index 27c11242..bd9b1166 100644 --- a/auth/simple-auth-server/Cargo.toml +++ b/auth/simple-auth-server/Cargo.toml @@ -16,7 +16,7 @@ env_logger.workspace = true log = "0.4" once_cell = "1" r2d2 = "0.8" -rust-argon2 = "1" +rust-argon2 = "2" serde_json.workspace = true serde.workspace = true sparkpost = "0.5" diff --git a/auth/simple-auth-server/src/utils.rs b/auth/simple-auth-server/src/utils.rs index d2bc9758..cbce02b6 100644 --- a/auth/simple-auth-server/src/utils.rs +++ b/auth/simple-auth-server/src/utils.rs @@ -1,4 +1,3 @@ -use argon2::{self, Config}; use once_cell::sync::Lazy; use crate::errors::ServiceError; @@ -10,9 +9,9 @@ const SALT: &[u8] = b"supersecuresalt"; // PLEASE NOTE THIS IS ONLY FOR DEMO PLEASE DO MORE RESEARCH FOR PRODUCTION USE pub fn hash_password(password: &str) -> Result { - let config = Config { + let config = argon2::Config { secret: SECRET_KEY.as_bytes(), - ..Default::default() + ..argon2::Config::rfc9106_low_mem() }; argon2::hash_encoded(password.as_bytes(), SALT, &config).map_err(|err| { dbg!(err);