chore(net): rearrange defines and enums for clarity

This commit is contained in:
fallenoak committed 2025-09-26 22:41:40 -07:00
1 parent 2d3327d3ae
commit a85bd4809f
10 files changed
+91 -82

No files matched your search

+6 -5
View File
@@ -2,6 +2,7 @@
#include "net/connection/WowConnection.hpp"
#include "net/grunt/ClientResponse.hpp"
#include "net/grunt/Command.hpp"
#include "net/login/Types.hpp"
#include "net/srp/SRP6_Random.hpp"
#include <common/MD5.hpp>
#include <storm/Error.hpp>
@@ -114,13 +115,13 @@ int32_t Grunt::ClientLink::CmdAuthLogonChallenge(CDataStore& msg) {
uint8_t* salt;
uint8_t* versionChallenge;
if (!CanRead(msg, largeSafePrimeLen + SALT_LEN + VERSION_CHALLENGE_LEN)) {
if (!CanRead(msg, largeSafePrimeLen + SALT_LEN + LOGIN_VERSION_CHALLENGE_LEN)) {
return 0;
}
msg.GetDataInSitu(reinterpret_cast<void*&>(largeSafePrime), largeSafePrimeLen);
msg.GetDataInSitu(reinterpret_cast<void*&>(salt), SALT_LEN);
msg.GetDataInSitu(reinterpret_cast<void*&>(versionChallenge), VERSION_CHALLENGE_LEN);
msg.GetDataInSitu(reinterpret_cast<void*&>(versionChallenge), LOGIN_VERSION_CHALLENGE_LEN);
uint8_t logonFlags;
@@ -353,7 +354,7 @@ int32_t Grunt::ClientLink::CmdAuthReconnectChallenge(CDataStore& msg) {
// Reconnect challenge success (result == 0)
msg.GetDataInSitu(reinterpret_cast<void*&>(reconnectKey), RECONNECT_KEY_LEN);
msg.GetDataInSitu(reinterpret_cast<void*&>(versionChallenge), VERSION_CHALLENGE_LEN);
msg.GetDataInSitu(reinterpret_cast<void*&>(versionChallenge), LOGIN_VERSION_CHALLENGE_LEN);
if (!msg.IsValid()) {
return 1;
@@ -645,7 +646,7 @@ void Grunt::ClientLink::ProveVersion(const uint8_t* versionChecksum) {
SHA1_Init(&sha1);
SHA1_Update(&sha1, this->m_srpClient.clientPublicKey, sizeof(this->m_srpClient.clientPublicKey));
SHA1_Update(&sha1, versionChecksum, VERSION_CHECKSUM_LEN);
SHA1_Update(&sha1, versionChecksum, LOGIN_VERSION_CHECKSUM_LEN);
SHA1_Final(clientVersionProof, &sha1);
command.PutData(clientVersionProof, sizeof(clientVersionProof));
@@ -695,7 +696,7 @@ void Grunt::ClientLink::ProveVersion(const uint8_t* versionChecksum) {
SHA1_Init(&sha1);
SHA1_Update(&sha1, clientSalt, sizeof(clientSalt));
SHA1_Update(&sha1, versionChecksum, VERSION_CHECKSUM_LEN);
SHA1_Update(&sha1, versionChecksum, LOGIN_VERSION_CHECKSUM_LEN);
SHA1_Final(clientVersionProof, &sha1);
command.PutData(clientVersionProof, sizeof(clientVersionProof));
+3 -1
View File
@@ -2,10 +2,12 @@
#define NET_GRUNT_CLIENT_RESPONSE_HPP
#include "net/grunt/Grunt.hpp"
#include "net/Types.hpp"
#include "net/login/Types.hpp"
#include <cstdint>
class CDataStore;
class LoginResponse;
struct NETADDR;
class Grunt::ClientResponse {
public: