vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit adaefc8628423dd7aebb39e76ce35ee00ce618c5
parent c6c45c4c49be81a86240b7a4462b7d502be4257d
Author: sirux88 <sirux88@gmail.com>
Date:   Wed, 25 Jan 2023 08:09:26 +0100

fixes for current upstream main

Diffstat:
Msrc/api/core/organizations.rs | 2+-
Msrc/db/models/user.rs | 21---------------------
2 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs @@ -2583,7 +2583,7 @@ async fn put_reset_password( let reset_request = data.into_inner().data; - user.set_password_and_key(reset_request.NewMasterPasswordHash.as_str(), reset_request.Key.as_str(), None); + user.set_password(reset_request.NewMasterPasswordHash.as_str(), Some(reset_request.Key), true, None); user.save(&mut conn).await?; nt.send_user_update(UpdateType::LogOut, &user).await; diff --git a/src/db/models/user.rs b/src/db/models/user.rs @@ -178,27 +178,6 @@ impl User { self.security_stamp = crate::util::get_uuid(); } - /// Set the password hash generated - /// And resets the security_stamp. Based upon the allow_next_route the security_stamp will be different. - /// - /// # Arguments - /// - /// * `new_password_hash` - A str which contains a hashed version of the users master password. - /// * `new_key` - A String which contains the new aKey value of the users master password. - /// * `allow_next_route` - A Option<Vec<String>> with the function names of the next allowed (rocket) routes. - /// These routes are able to use the previous stamp id for the next 2 minutes. - /// After these 2 minutes this stamp will expire. - /// - pub fn set_password_and_key( - &mut self, - new_password_hash: &str, - new_key: &str, - allow_next_route: Option<Vec<String>>, - ) { - self.set_password(new_password_hash, allow_next_route); - self.akey = String::from(new_key); - } - /// Set the stamp_exception to only allow a subsequent request matching a specific route using the current security-stamp. /// /// # Arguments