fix: generate session keys from the system entropy source

The key came from the shared game random engine, which is seeded from
the start time. It now comes from std::random_device through a small
helper. The key stays a 32 bit number, so the packets do not change.

The master and world servers no longer write the key or its hash to
the log.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-10 12:54:33 -06:00
parent 0a0e37e96f
commit e8479cd6e5
7 changed files with 59 additions and 3 deletions

View File

@@ -308,7 +308,7 @@ void AuthPackets::SendLoginResponse(dServer* server, const SystemAddress& sysAdd
GeneralUtils::TryParse<uint16_t>(Game::config->GetValue("version_minor")).value_or(ClientVersion::minor);
// The user key
uint32_t sessionKey = GeneralUtils::GenerateRandomNumber<uint32_t>();
uint32_t sessionKey = GeneralUtils::GenerateUnpredictableNumber<uint32_t>();
std::string userHash = std::to_string(sessionKey);
userHash = md5(userHash);
loginResponse.userKey = LUWString(userHash);