mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2024-12-04 22:14:51 +01:00
clear kdf memory and parallelism with pbkdf2
when changing back from argon2id to PBKDF2 the unused parameters should be set to 0. also fix small bug in _register
This commit is contained in:
parent
0daaa9b175
commit
39a5f2dbe8
1 changed files with 5 additions and 2 deletions
|
@ -169,8 +169,8 @@ pub async fn _register(data: JsonUpcase<RegisterData>, mut conn: DbConn) -> Json
|
||||||
user.client_kdf_iter = client_kdf_iter;
|
user.client_kdf_iter = client_kdf_iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
user.client_kdf_parallelism = data.KdfMemory;
|
user.client_kdf_memory = data.KdfMemory;
|
||||||
user.client_kdf_memory = data.KdfParallelism;
|
user.client_kdf_parallelism = data.KdfParallelism;
|
||||||
|
|
||||||
user.set_password(&data.MasterPasswordHash, Some(data.Key), true, None);
|
user.set_password(&data.MasterPasswordHash, Some(data.Key), true, None);
|
||||||
user.password_hint = password_hint;
|
user.password_hint = password_hint;
|
||||||
|
@ -389,6 +389,9 @@ async fn post_kdf(data: JsonUpcase<ChangeKdfData>, headers: Headers, mut conn: D
|
||||||
} else {
|
} else {
|
||||||
err!("Argon2 parallelism parameter is required.")
|
err!("Argon2 parallelism parameter is required.")
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
user.client_kdf_memory = None;
|
||||||
|
user.client_kdf_parallelism = None;
|
||||||
}
|
}
|
||||||
user.client_kdf_iter = data.KdfIterations;
|
user.client_kdf_iter = data.KdfIterations;
|
||||||
user.client_kdf_type = data.Kdf;
|
user.client_kdf_type = data.Kdf;
|
||||||
|
|
Loading…
Reference in a new issue