mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Engine: reject connection is session ID hashing failed
If hashing failed, the other checks will fail regardless, return out early.
This commit is contained in:
parent
4ce38ba725
commit
a1e4500b98
@ -173,6 +173,9 @@ bool CClient::Authenticate(const char* const playerName, char* const reasonBuf,
|
|||||||
uint8_t oobHash[32]; // hash of data collected from out of band packet
|
uint8_t oobHash[32]; // hash of data collected from out of band packet
|
||||||
const int shRet = mbedtls_sha256((const uint8_t*)newId, idLen, oobHash, NULL);
|
const int shRet = mbedtls_sha256((const uint8_t*)newId, idLen, oobHash, NULL);
|
||||||
|
|
||||||
|
if (shRet != NULL)
|
||||||
|
ERROR_AND_RETURN("Session ID hashing failed");
|
||||||
|
|
||||||
if (memcmp(oobHash, sessionHash, sizeof(sessionHash)) != 0)
|
if (memcmp(oobHash, sessionHash, sizeof(sessionHash)) != 0)
|
||||||
ERROR_AND_RETURN("Token is not authorized for the connecting client");
|
ERROR_AND_RETURN("Token is not authorized for the connecting client");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user