mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2026-11-16 02:51:08 +03:00
feat(net): finish handling logon proof
This commit is contained in:
3 files changed
+47
-1
No files matched your search
@@ -174,3 +174,16 @@ cleanup:
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t SRP6_Client::VerifyServerProof(const uint8_t* serverProof, uint32_t serverProofLen) {
|
||||
if (serverProofLen != 20) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
// Calculate expected server proof
|
||||
uint8_t localServerProof[SHA1_DIGEST_SIZE];
|
||||
SHA1_Final(localServerProof, &this->ctx);
|
||||
|
||||
// Compare expected server proof with given server proof
|
||||
return memcmp(localServerProof, serverProof, sizeof(localServerProof));
|
||||
}
|
||||
@@ -18,6 +18,7 @@ class SRP6_Client {
|
||||
// Member functions
|
||||
int32_t BeginAuthentication(const char* accountName, const char* password);
|
||||
int32_t CalculateProof(const uint8_t* largeSafePrime, uint32_t largeSafePrimeLen, const uint8_t* generator, uint32_t generatorLen, const uint8_t* salt, uint32_t saltLen, const uint8_t* publicKey, uint32_t publicKeyLen, SRP6_Random& random);
|
||||
int32_t VerifyServerProof(const uint8_t* serverProof, uint32_t serverProofLen);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user