Network: Change hash function for non-company passwords

Increase size of per-connection salts, simplify management
Cache per-connection hashes at server end
Send hashes as binary rather than bothering to stringify them
This commit is contained in:
Jonathan G Rennison
2023-06-12 22:41:09 +01:00
parent 79255c0294
commit c285413853
5 changed files with 97 additions and 27 deletions

View File

@@ -147,6 +147,7 @@ uint NetworkCalculateLag(const NetworkClientSocket *cs);
StringID GetNetworkErrorMsg(NetworkErrorCode err);
bool NetworkMakeClientNameUnique(std::string &new_name);
std::string GenerateCompanyPasswordHash(const std::string &password, const std::string &password_server_id, uint32 password_game_seed);
std::vector<uint8> GenerateGeneralPasswordHash(const std::string &password, const std::string &password_server_id, uint64 password_game_seed);
std::string NetworkGenerateRandomKeyString(uint bytes);
std::string_view ParseCompanyFromConnectionString(const std::string &connection_string, CompanyID *company_id);