From 3fd8df2c3cd464b78605c42638315d12f454e255 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Sat, 5 Sep 2020 15:00:33 -0400 Subject: [PATCH] trim password and hash strings --- src/pass.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pass.rs b/src/pass.rs index 9eba9ca..e458f98 100644 --- a/src/pass.rs +++ b/src/pass.rs @@ -17,7 +17,7 @@ use std::process::exit; use bcrypt::{DEFAULT_COST, BcryptResult, hash, verify}; pub fn is_correct_password(given_password : String, hashed_password : String) -> BcryptResult { - verify(given_password, hashed_password.as_str()) + verify(given_password.trim(), hashed_password.trim()) } pub fn init_password (password_file_name : &str, password_opt : Option<&str>) -> String {