@@ -37,17 +37,27 @@ int g_NumClientAuthorizers = 0;
37
37
const char *g_RevEmuCryptKey = " _YOU_SERIOUSLY_NEED_TO_GET_LAID_" ;
38
38
const uint32_t g_SteamEmuHashKey = 0xC9710266 ;
39
39
40
- static uint32_t revHash (const char * str)
40
+ static uint32_t revHash (const char * str, int n = - 1 )
41
41
{
42
42
uint32_t hash = 0x4E67C6A7 ;
43
43
44
- for (int cc = *str; cc; cc = *++str) {
44
+ for (int cc = *str; cc && n != 0 ; cc = *++str, --n ) {
45
45
hash ^= (hash >> 2 ) + cc + 32 * hash;
46
46
}
47
47
48
48
return hash;
49
49
}
50
50
51
+ // deprecated auth version reunion2015 has a truncated ticket buffer
52
+ size_t Reunion_AuthKeyMaxLen (authdata_t * authdata)
53
+ {
54
+ const uint32_t MAX_RAWAUTHDATA_TRUNCATED = 16 ;
55
+ uint32_t authKeyMaxLen = (g_ReunionConfig->getAuthVersion () == av_reunion2015)
56
+ ? min (authdata->authKeyLen , MAX_RAWAUTHDATA_TRUNCATED) : authdata->authKeyLen ;
57
+
58
+ return authKeyMaxLen;
59
+ }
60
+
51
61
void RevEmuFinishAuthorization (authdata_t * authdata, const char * authStr, size_t authKeyMaxLen, bool stripSpecialChars)
52
62
{
53
63
uint32_t volumeId;
@@ -86,7 +96,7 @@ void RevEmuFinishAuthorization(authdata_t* authdata, const char* authStr, size_t
86
96
memcpy (authdata->authKey , authStr, authdata->authKeyLen );
87
97
authdata->authKey [authdata->authKeyLen ] = ' \0 ' ;
88
98
89
- authdata->steamId = revHash (authdata->authKey ) << 1 ;
99
+ authdata->steamId = revHash (authdata->authKey , Reunion_AuthKeyMaxLen (authdata) ) << 1 ;
90
100
91
101
if (authStr == (char *)&volumeId)
92
102
LCPrintf (false , " RevEmu auth key: '%u' steamid: %u\n " , (uint32_t )authStr, authdata->steamId );
0 commit comments