Use cryptographic RNG to generate the shard connection serial key

This commit is contained in:
2022-07-24 00:29:19 +02:00
parent 741bfb675b
commit ca0d608a87
3 changed files with 56 additions and 1 deletions

View File

@@ -477,7 +477,7 @@ void CNLoginServer::characterSelect(CNSocket* sock, CNPacketData* data) {
if (lm->plr.iID == 0)
return invalidCharacter(sock);
resp.iEnterSerialKey = Rand::rand(); // TODO: cryptographic RNG
resp.iEnterSerialKey = Rand::cryptoRand();
// transfer ownership of connection data to CNShared
CNShared::storeLoginMetadata(resp.iEnterSerialKey, lm);