2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-28 15:45:46 +03:00

Don't generate different challenge on port change (#804)

This commit is contained in:
theAsmodai 2021-01-28 01:43:02 +03:00 committed by GitHub
parent aaf56989f9
commit dc75d828ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1813,8 +1813,7 @@ int g_oldest_challenge = 0;
typedef struct challenge_buf_s typedef struct challenge_buf_s
{ {
uint32_t ip; uint32_t ip;
uint16_t port; uint32_t salt[15];
uint32_t salt[14];
} challenge_buf_t; } challenge_buf_t;
challenge_buf_t g_raw_challenge_buf; challenge_buf_t g_raw_challenge_buf;
@ -2529,7 +2528,6 @@ int EXT_FUNC SV_GetChallenge(const netadr_t& adr)
#ifdef REHLDS_FIXES #ifdef REHLDS_FIXES
uint8_t digest[16]; uint8_t digest[16];
g_raw_challenge_buf.ip = *(uint32_t*)adr.ip; g_raw_challenge_buf.ip = *(uint32_t*)adr.ip;
g_raw_challenge_buf.port = adr.port;
MD5Context_t ctx; MD5Context_t ctx;
MD5Init(&ctx); MD5Init(&ctx);
MD5Update(&ctx, (uint8_t *)&g_raw_challenge_buf, sizeof(g_raw_challenge_buf)); MD5Update(&ctx, (uint8_t *)&g_raw_challenge_buf, sizeof(g_raw_challenge_buf));