mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-16 12:42:30 +00:00
feat(net): finish handling logon proof
This commit is contained in:
parent
098d8cd82f
commit
613b2724e2
3 changed files with 47 additions and 1 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue