fix hash comparison fix
authoralfadur
Mon, 03 Jun 2019 23:15:05 +0300
changeset 15110 6a8c294f49c9
parent 15109 acd50a72af59
child 15111 1e45db229f9f
fix hash comparison fix
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())