95 } |
95 } |
96 #[cfg(feature = "official-server")] |
96 #[cfg(feature = "official-server")] |
97 HWProtocolMessage::Password(hash, salt) => { |
97 HWProtocolMessage::Password(hash, salt) => { |
98 let client = &anteroom.clients[client_id]; |
98 let client = &anteroom.clients[client_id]; |
99 |
99 |
100 if let (Some(protocol), Some(password)) = (client.protocol_number, client.web_password.as_ref()) { |
100 if let (Some(protocol), Some(password)) = |
|
101 (client.protocol_number, client.web_password.as_ref()) |
|
102 { |
101 let client_hash = get_hash(protocol.get(), &password, &salt, &client.server_salt); |
103 let client_hash = get_hash(protocol.get(), &password, &salt, &client.server_salt); |
102 let server_hash = get_hash(protocol.get(), &password, &client.server_salt, &salt); |
104 let server_hash = get_hash(protocol.get(), &password, &client.server_salt, &salt); |
103 if client_hash == server_hash { |
105 if client_hash == server_hash { |
104 response.add(ServerAuth(format!("{:x}", server_hash)).send_self()); |
106 response.add(ServerAuth(format!("{:x}", server_hash)).send_self()); |
105 LoginResult::Complete |
107 LoginResult::Complete |