mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 00:32:45 +03:00
chore(net): clean up CmdAuthLogonChallenge
This commit is contained in:
parent
f5a0e009eb
commit
7e43643de8
@ -47,14 +47,14 @@ void Grunt::ClientLink::Call() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Grunt::ClientLink::CmdAuthLogonChallenge(CDataStore& msg) {
|
int32_t Grunt::ClientLink::CmdAuthLogonChallenge(CDataStore& msg) {
|
||||||
if (msg.Tell() > msg.Size() || msg.Size() - msg.Tell() < 2) {
|
if (!CanRead(msg, 2)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t v30;
|
uint8_t protocol;
|
||||||
msg.Get(v30);
|
msg.Get(protocol);
|
||||||
|
|
||||||
if (v30 != 0) {
|
if (protocol != 0) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,11 +78,7 @@ int32_t Grunt::ClientLink::CmdAuthLogonChallenge(CDataStore& msg) {
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.Tell() > msg.Size()) {
|
if (!CanRead(msg, 33)) {
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg.Size() - msg.Tell() < 33) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,10 +88,9 @@ int32_t Grunt::ClientLink::CmdAuthLogonChallenge(CDataStore& msg) {
|
|||||||
uint8_t generatorLen;
|
uint8_t generatorLen;
|
||||||
msg.Get(generatorLen);
|
msg.Get(generatorLen);
|
||||||
|
|
||||||
// TODO
|
if (!CanRead(msg, generatorLen + 1)) {
|
||||||
// if (!CanRead(msg, v31 + 1)) {
|
return 0;
|
||||||
// return 0;
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
uint8_t* generator;
|
uint8_t* generator;
|
||||||
msg.GetDataInSitu(reinterpret_cast<void*&>(generator), generatorLen);
|
msg.GetDataInSitu(reinterpret_cast<void*&>(generator), generatorLen);
|
||||||
@ -103,10 +98,9 @@ int32_t Grunt::ClientLink::CmdAuthLogonChallenge(CDataStore& msg) {
|
|||||||
uint8_t largeSafePrimeLen;
|
uint8_t largeSafePrimeLen;
|
||||||
msg.Get(largeSafePrimeLen);
|
msg.Get(largeSafePrimeLen);
|
||||||
|
|
||||||
// TODO
|
if (!CanRead(msg, largeSafePrimeLen + 48)) {
|
||||||
// if (!CanRead(msg, v32 + 48)) {
|
return 0;
|
||||||
// return 0;
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
uint8_t* largeSafePrime;
|
uint8_t* largeSafePrime;
|
||||||
msg.GetDataInSitu(reinterpret_cast<void*&>(largeSafePrime), largeSafePrimeLen);
|
msg.GetDataInSitu(reinterpret_cast<void*&>(largeSafePrime), largeSafePrimeLen);
|
||||||
@ -117,10 +111,9 @@ int32_t Grunt::ClientLink::CmdAuthLogonChallenge(CDataStore& msg) {
|
|||||||
uint8_t* versionChallenge;
|
uint8_t* versionChallenge;
|
||||||
msg.GetDataInSitu(reinterpret_cast<void*&>(versionChallenge), 16);
|
msg.GetDataInSitu(reinterpret_cast<void*&>(versionChallenge), 16);
|
||||||
|
|
||||||
// TODO
|
if (!CanRead(msg, 1)) {
|
||||||
// if (!CanRead(msg, 1)) {
|
return 0;
|
||||||
// return 0;
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
uint8_t logonFlags;
|
uint8_t logonFlags;
|
||||||
msg.Get(logonFlags);
|
msg.Get(logonFlags);
|
||||||
@ -138,10 +131,9 @@ int32_t Grunt::ClientLink::CmdAuthLogonChallenge(CDataStore& msg) {
|
|||||||
|
|
||||||
// PIN
|
// PIN
|
||||||
if (logonFlags & 0x1) {
|
if (logonFlags & 0x1) {
|
||||||
// TODO
|
if (!CanRead(msg, 20)) {
|
||||||
// if (!CanRead(msg, 20) {
|
return 0;
|
||||||
// return 0;
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
msg.Get(pinGridSeed);
|
msg.Get(pinGridSeed);
|
||||||
msg.GetDataInSitu(reinterpret_cast<void*&>(pinSalt), 16);
|
msg.GetDataInSitu(reinterpret_cast<void*&>(pinSalt), 16);
|
||||||
@ -169,10 +161,9 @@ int32_t Grunt::ClientLink::CmdAuthLogonChallenge(CDataStore& msg) {
|
|||||||
|
|
||||||
// TOKEN (authenticator)
|
// TOKEN (authenticator)
|
||||||
if (logonFlags & 0x4) {
|
if (logonFlags & 0x4) {
|
||||||
// TODO
|
if (!CanRead(msg, 1)) {
|
||||||
// if (!CanRead(msg, 1)) {
|
return 0;
|
||||||
// return 0;
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
msg.Get(tokenRequired);
|
msg.Get(tokenRequired);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user