From 16c8b2621bdffb4155f57a571f21ae03efb3ee42 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Wed, 27 Nov 2024 00:29:33 +0700 Subject: [PATCH] Allow to disable salt for SteamIDs hashing >= reunion2018 (this is always required by default) --- reunion/dist/reunion.cfg | 3 ++- reunion/src/reunion_cfg.cpp | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/reunion/dist/reunion.cfg b/reunion/dist/reunion.cfg index 0f62817..8be0a65 100644 --- a/reunion/dist/reunion.cfg +++ b/reunion/dist/reunion.cfg @@ -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. diff --git a/reunion/src/reunion_cfg.cpp b/reunion/src/reunion_cfg.cpp index 974c65d..7143636 100644 --- a/reunion/src/reunion_cfg.cpp +++ b/reunion/src/reunion_cfg.cpp @@ -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; }