Allow to disable salt for SteamIDs hashing >= reunion2018 (this is always required by default)

This commit is contained in:
s1lentq 2024-11-27 00:29:33 +07:00
parent ed4d145219
commit 16c8b2621b
2 changed files with 11 additions and 3 deletions

View File

@ -94,7 +94,8 @@ AuthVersion = 3
# AuthVersion < 3: If string is empty, hashing is not applied
# AuthVersion >= 3: If string is empty, init will be failed
# Recommended length is more than 31 chars
SteamIdHashSalt =
# Specify 0 to explicitly disable hashing (not recommended)
SteamIdHashSalt =
# SC2009_RevCompatMode (0 / 1)
# Enable fix to make steamids generated for SC2009 compatible with revEmu. Can't be disabled with AuthVersion >= 3.

View File

@ -319,8 +319,15 @@ bool CReunionConfig::parseCfgParam()
if (m_AuthVersion == av_dproto)
m_bEnableGenPrefix2 = false;
if (m_AuthVersion >= av_reunion2018) {
if (m_SteamIdHashSaltLen < 16) {
if (m_AuthVersion >= av_reunion2018)
{
// check logical negation value to disable salt hashing
bool bSteamIdNoHashSalt = (m_SteamIdHashSalt[0] == '0'
|| !Q_stricmp(m_SteamIdHashSalt, "no")
|| !Q_stricmp(m_SteamIdHashSalt, "false"));
if (!bSteamIdNoHashSalt && m_SteamIdHashSaltLen < 16)
{
LCPrintf(true, "SteamIdHashSalt is not set or too short\n");
return false;
}