Mercurial > crates > nonstick
changeset 168:6642e89d29a2
more closely follow real password change flow
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Tue, 15 Jul 2025 00:56:01 -0400 |
parents | 0cabe7b94a4f |
children | 77470e45e397 |
files | testharness/src/lib.rs |
diffstat | 1 files changed, 3 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/testharness/src/lib.rs Tue Jul 15 00:39:08 2025 -0400 +++ b/testharness/src/lib.rs Tue Jul 15 00:56:01 2025 -0400 @@ -91,21 +91,13 @@ if handle.old_authtok(None)?.as_bytes() != b"old token!" { return Err(ErrorCode::AuthenticationError); } + Ok(()) + } + AuthtokAction::Update => { let password = handle.authtok(None)?; if password.as_bytes() != b"acceptable" { return Err(ErrorCode::PermissionDenied); } - handle.set_module_data("checked_pass", password) - } - AuthtokAction::Update => { - let password = handle.authtok(None)?; - let checked: &OsString = handle - .get_module_data("checked_pass") - .ok_or(ErrorCode::SystemError)?; - if password != *checked { - error!(handle, "password mismatch? {password:?} {checked:?}"); - return Err(ErrorCode::AuthenticationError); - } Ok(()) } }