mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Hash the passwords client-side
This commit is contained in:
@ -8,6 +8,7 @@ use crate::{window::Event, Direction, GlobalState, PlayState, PlayStateResult};
|
||||
use client_init::{ClientInit, Error as InitError};
|
||||
use common::{clock::Clock, comp};
|
||||
use log::warn;
|
||||
use sha2::{Digest, Sha512};
|
||||
#[cfg(feature = "singleplayer")]
|
||||
use start_singleplayer::StartSingleplayerState;
|
||||
use std::time::Duration;
|
||||
@ -108,7 +109,16 @@ impl PlayState for MainMenuState {
|
||||
client_init = client_init.or(Some(ClientInit::new(
|
||||
(server_address, DEFAULT_PORT, false),
|
||||
player,
|
||||
password,
|
||||
{
|
||||
// TODO: Switch to Argon2
|
||||
let mut hasher = Sha512::new();
|
||||
hasher.input(password.clone());
|
||||
let mut out = String::new();
|
||||
for i in hasher.result().iter() {
|
||||
out.push_str(&format!("{:x}", i));
|
||||
}
|
||||
out
|
||||
},
|
||||
false,
|
||||
)));
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user