diff --git a/reunion/dist/reunion.cfg b/reunion/dist/reunion.cfg index 88feed4..1072f03 100644 --- a/reunion/dist/reunion.cfg +++ b/reunion/dist/reunion.cfg @@ -85,8 +85,9 @@ cid_SXEI = 1 # Authorization protocols version. All steamdid's of non-steams players will be changed in common with this value. # 1: DProto (deprecated) # 2: Reunion 2015-2018 -# 3: Reunion new (recommended) -AuthVersion = 3 +# 3: Reunion 2018-2024 +# 4: Reunion new (recommended) +AuthVersion = 4 # SteamIdHashSalt (string) # Salt string for SteamIDs hashing. Irreversibly changes SteamIDs. Prevents SteamID stealing. diff --git a/reunion/src/reunion_authorizers.cpp b/reunion/src/reunion_authorizers.cpp index 557740a..a035a35 100644 --- a/reunion/src/reunion_authorizers.cpp +++ b/reunion/src/reunion_authorizers.cpp @@ -48,14 +48,23 @@ static uint32_t revHash(const char* str, int n = -1) return hash; } -// deprecated auth version reunion2015 has a truncated ticket buffer size_t Reunion_AuthKeyMaxLen(authdata_t* authdata) { - const uint32_t MAX_RAWAUTHDATA_TRUNCATED = 16; - uint32_t authKeyMaxLen = (g_ReunionConfig->getAuthVersion() == av_reunion2015) - ? min(authdata->authKeyLen, MAX_RAWAUTHDATA_TRUNCATED) : authdata->authKeyLen; + // deprecated auth version reunion2015/reunion2018 has a truncated ticket buffer + const uint32_t MAX_RAWAUTHDATA_2015_TRUNCATED = 16; + const uint32_t MAX_RAWAUTHDATA_2018_TRUNCATED = 31; - return authKeyMaxLen; + switch (g_ReunionConfig->getAuthVersion()) + { + case av_reunion2015: + return min(authdata->authKeyLen, MAX_RAWAUTHDATA_2015_TRUNCATED); + case av_reunion2018: + return min(authdata->authKeyLen, MAX_RAWAUTHDATA_2018_TRUNCATED); + default: + break; + } + + return authdata->authKeyLen; } void RevEmuFinishAuthorization(authdata_t* authdata, const char* authStr, size_t authKeyMaxLen, bool stripSpecialChars) diff --git a/reunion/src/reunion_cfg.cpp b/reunion/src/reunion_cfg.cpp index ad50d36..3b6257a 100644 --- a/reunion/src/reunion_cfg.cpp +++ b/reunion/src/reunion_cfg.cpp @@ -271,7 +271,7 @@ bool CReunionConfig::parseCfgParam() REU_CFG_PARSE_INT("LoggingMode", m_LogMode, int, rl_none, (rl_console|rl_logfile)) - REU_CFG_PARSE_INT("AuthVersion", m_AuthVersion, auth_version, av_dproto, av_reunion2018) + REU_CFG_PARSE_INT("AuthVersion", m_AuthVersion, auth_version, av_dproto, av_reunion2024) REU_CFG_PARSE_INT("ServerInfoAnswerType", m_ServerAnswerType, server_answer_type, sat_source, sat_hybrid) REU_CFG_PARSE_BOOL("SC2009_RevCompatMode", m_bSC2009RevEmuCompat) diff --git a/reunion/src/reunion_player.cpp b/reunion/src/reunion_player.cpp index cafe83d..f4802a8 100644 --- a/reunion/src/reunion_player.cpp +++ b/reunion/src/reunion_player.cpp @@ -52,7 +52,7 @@ void CReunionPlayer::authenticated(int proto, client_id_kind idkind, client_auth const client_id_gen_opts_t* idByIpGenOpts = g_ReunionConfig->getIdByIpGenOpts(); // use auth key type prefixes - bool akPrefixes = g_ReunionConfig->getAuthVersion() == av_reunion2018; + bool akPrefixes = g_ReunionConfig->getAuthVersion() >= av_reunion2018; switch (m_IdKind) { case CI_REAL_STEAM: diff --git a/reunion/src/reunion_shared.h b/reunion/src/reunion_shared.h index d9a41f5..1fe1c42 100644 --- a/reunion/src/reunion_shared.h +++ b/reunion/src/reunion_shared.h @@ -70,7 +70,8 @@ enum reuinon_log_mode { enum auth_version { av_dproto = 1, av_reunion2015 = 2, - av_reunion2018 = 3 + av_reunion2018 = 3, + av_reunion2024 = 4 }; enum server_answer_type {