Skip to content

Commit 306d959

Browse files
authored
fix: Release removes password generation for accounts (#1738)
* Release removes password generation * Update MasterServer.cpp
1 parent e4c2eec commit 306d959

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dMasterServer/MasterServer.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ int main(int argc, char** argv) {
246246
// Regenerate hash based on new password
247247
char salt[BCRYPT_HASHSIZE];
248248
char hash[BCRYPT_HASHSIZE];
249-
assert(GenerateBCryptPassword(password, 12, salt, hash) == 0);
249+
int res = GenerateBCryptPassword(password, 12, salt, hash);
250+
assert(res == 0);
250251

251252
Database::Get()->UpdateAccountPassword(accountId->id, std::string(hash, BCRYPT_HASHSIZE));
252253

@@ -284,7 +285,8 @@ int main(int argc, char** argv) {
284285
//Generate new hash for bcrypt
285286
char salt[BCRYPT_HASHSIZE];
286287
char hash[BCRYPT_HASHSIZE];
287-
assert(GenerateBCryptPassword(password, 12, salt, hash) == 0);
288+
int res = GenerateBCryptPassword(password, 12, salt, hash);
289+
assert(res == 0);
288290

289291
//Create account
290292
try {
@@ -323,7 +325,8 @@ int main(int argc, char** argv) {
323325
char salt[BCRYPT_HASHSIZE];
324326
char hash[BCRYPT_HASHSIZE];
325327
const auto& cfgPassword = Game::config->GetValue("master_password");
326-
GenerateBCryptPassword(!cfgPassword.empty() ? cfgPassword : "3.25DARKFLAME1", 13, salt, hash);
328+
int res = GenerateBCryptPassword(!cfgPassword.empty() ? cfgPassword : "3.25DARKFLAME1", 13, salt, hash);
329+
assert(res == 0);
327330

328331
Game::server = new dServer(ourIP, ourPort, 0, maxClients, true, false, Game::logger, "", 0, ServerType::Master, Game::config, &Game::lastSignal, hash);
329332

0 commit comments

Comments
 (0)