# HG changeset patch # User alfadur # Date 1559592905 -10800 # Node ID 6a8c294f49c92ad07519e4a2d6c8413406922746 # Parent acd50a72af59b8863dea7fb74648105bac3c191b fix hash comparison fix diff -r acd50a72af59 -r 6a8c294f49c9 rust/hedgewars-server/src/server/database.rs --- a/rust/hedgewars-server/src/server/database.rs Mon Jun 03 22:41:43 2019 +0300 +++ b/rust/hedgewars-server/src/server/database.rs Mon Jun 03 23:15:05 2019 +0300 @@ -69,7 +69,7 @@ let server_hash = get_hash(protocol, &password, &server_salt, &client_salt); password.replace_range(.., "🦔🦔🦔🦔🦔🦔🦔🦔"); - if password_hash == client_hash { + if password_hash == format!("{:x}", client_hash) { Ok(Some(AccountInfo { is_registered: true, is_admin: is_admin == 1, @@ -80,12 +80,7 @@ Ok(None) } } else { - Ok(Some(AccountInfo { - is_registered: false, - is_admin: false, - is_contributor: false, - server_hash: Sha1Digest::new([0; 20]), - })) + Ok(None) } } else { Err(DriverError::SetupError.into())