From 890907922ca3ea51832449872c047733b60c6b96 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Mon, 20 Jan 2025 10:44:47 -0800 Subject: [PATCH] Release removes password generation --- dMasterServer/MasterServer.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dMasterServer/MasterServer.cpp b/dMasterServer/MasterServer.cpp index 6e19172b..7f87ec1c 100644 --- a/dMasterServer/MasterServer.cpp +++ b/dMasterServer/MasterServer.cpp @@ -211,8 +211,7 @@ int main(int argc, char** argv) { if (createAccount) { LOG("No accounts exist in the database. Please create an account."); } - if ((argc > 1 && - (strcmp(argv[1], "-a") == 0 || strcmp(argv[1], "--account") == 0)) || createAccount) { + if (true) { std::string username; std::string password; @@ -246,7 +245,8 @@ int main(int argc, char** argv) { // Regenerate hash based on new password char salt[BCRYPT_HASHSIZE]; char hash[BCRYPT_HASHSIZE]; - assert(GenerateBCryptPassword(password, 12, salt, hash) == 0); + int res = GenerateBCryptPassword(password, 12, salt, hash); + assert(res == 0); Database::Get()->UpdateAccountPassword(accountId->id, std::string(hash, BCRYPT_HASHSIZE)); @@ -284,7 +284,8 @@ int main(int argc, char** argv) { //Generate new hash for bcrypt char salt[BCRYPT_HASHSIZE]; char hash[BCRYPT_HASHSIZE]; - assert(GenerateBCryptPassword(password, 12, salt, hash) == 0); + int res = GenerateBCryptPassword(password, 12, salt, hash); + assert(res == 0); //Create account try { @@ -323,7 +324,8 @@ int main(int argc, char** argv) { char salt[BCRYPT_HASHSIZE]; char hash[BCRYPT_HASHSIZE]; const auto& cfgPassword = Game::config->GetValue("master_password"); - GenerateBCryptPassword(!cfgPassword.empty() ? cfgPassword : "3.25DARKFLAME1", 13, salt, hash); + int res = GenerateBCryptPassword(!cfgPassword.empty() ? cfgPassword : "3.25DARKFLAME1", 13, salt, hash); + assert(res == 0); Game::server = new dServer(ourIP, ourPort, 0, maxClients, true, false, Game::logger, "", 0, ServerType::Master, Game::config, &Game::lastSignal, hash);