handle_hash empty password
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
127ab57d62
commit
9ef4f4c1de
@ -1991,7 +1991,7 @@ pub async fn handle_hash(
|
|||||||
lc: Arc<RwLock<LoginConfigHandler>>,
|
lc: Arc<RwLock<LoginConfigHandler>>,
|
||||||
password_preset: &str,
|
password_preset: &str,
|
||||||
hash: Hash,
|
hash: Hash,
|
||||||
_interface: &impl Interface,
|
interface: &impl Interface,
|
||||||
peer: &mut Stream,
|
peer: &mut Stream,
|
||||||
) {
|
) {
|
||||||
lc.write().unwrap().hash = hash.clone();
|
lc.write().unwrap().hash = hash.clone();
|
||||||
@ -2015,22 +2015,21 @@ pub async fn handle_hash(
|
|||||||
if password.is_empty() {
|
if password.is_empty() {
|
||||||
password = lc.read().unwrap().config.password.clone();
|
password = lc.read().unwrap().config.password.clone();
|
||||||
}
|
}
|
||||||
if password.is_empty() {
|
let password = if password.is_empty() {
|
||||||
// login without password, the remote side can click accept
|
// login without password, the remote side can click accept
|
||||||
send_login(lc.clone(), "".to_owned(), "".to_owned(), Vec::new(), peer).await;
|
interface.msgbox("input-password", "Password Required", "", "");
|
||||||
|
Vec::new()
|
||||||
} else {
|
} else {
|
||||||
let mut hasher = Sha256::new();
|
let mut hasher = Sha256::new();
|
||||||
hasher.update(&password);
|
hasher.update(&password);
|
||||||
hasher.update(&hash.challenge);
|
hasher.update(&hash.challenge);
|
||||||
send_login(
|
hasher.finalize()[..].into()
|
||||||
lc.clone(),
|
};
|
||||||
"".to_owned(),
|
|
||||||
"".to_owned(),
|
let os_username = lc.read().unwrap().get_option("os-username");
|
||||||
hasher.finalize()[..].into(),
|
let os_password = lc.read().unwrap().get_option("os-password");
|
||||||
peer,
|
|
||||||
)
|
send_login(lc.clone(), os_username, os_password, password, peer).await;
|
||||||
.await;
|
|
||||||
}
|
|
||||||
lc.write().unwrap().hash = hash;
|
lc.write().unwrap().hash = hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user