mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-30 15:33:56 +00:00
Updated client kdf iterations to 100000 and fixed some lints
This commit is contained in:
parent
dda244edd8
commit
df8114f8be
7 changed files with 105 additions and 116 deletions
|
@ -263,7 +263,7 @@ impl EmailTokenData {
|
|||
}
|
||||
|
||||
pub fn add_attempt(&mut self) {
|
||||
self.attempts = self.attempts + 1;
|
||||
self.attempts += 1;
|
||||
}
|
||||
|
||||
pub fn to_json(&self) -> String {
|
||||
|
@ -281,7 +281,7 @@ impl EmailTokenData {
|
|||
|
||||
/// Takes an email address and obscures it by replacing it with asterisks except two characters.
|
||||
pub fn obscure_email(email: &str) -> String {
|
||||
let split: Vec<&str> = email.split("@").collect();
|
||||
let split: Vec<&str> = email.split('@').collect();
|
||||
|
||||
let mut name = split[0].to_string();
|
||||
let domain = &split[1];
|
||||
|
|
|
@ -46,7 +46,7 @@ enum UserStatus {
|
|||
/// Local methods
|
||||
impl User {
|
||||
pub const CLIENT_KDF_TYPE_DEFAULT: i32 = 0; // PBKDF2: 0
|
||||
pub const CLIENT_KDF_ITER_DEFAULT: i32 = 5_000;
|
||||
pub const CLIENT_KDF_ITER_DEFAULT: i32 = 100_000;
|
||||
|
||||
pub fn new(mail: String) -> Self {
|
||||
let now = Utc::now().naive_utc();
|
||||
|
|
|
@ -45,9 +45,9 @@ fn mailer() -> SmtpTransport {
|
|||
let auth_mechanism = serde_json::from_str::<SmtpAuthMechanism>(&auth_mechanism_json);
|
||||
match auth_mechanism {
|
||||
Ok(auth_mechanism) => smtp_client.authentication_mechanism(auth_mechanism),
|
||||
Err(_) => panic!("Failure to parse mechanism. Is it proper Json? Eg. `\"Plain\"` not `Plain`"),
|
||||
_ => panic!("Failure to parse mechanism. Is it proper Json? Eg. `\"Plain\"` not `Plain`"),
|
||||
}
|
||||
},
|
||||
}
|
||||
_ => smtp_client,
|
||||
};
|
||||
|
||||
|
@ -169,7 +169,6 @@ pub fn send_new_device_logged_in(address: &str, ip: &str, dt: &NaiveDateTime, de
|
|||
}
|
||||
|
||||
pub fn send_token(address: &str, token: &str) -> EmptyResult {
|
||||
|
||||
let (subject, body_html, body_text) = get_text(
|
||||
"email/twofactor_email",
|
||||
json!({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue