mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-17 01:05:28 +00:00
fix: adapt the session key packets and the packet decoder to the 33 character key
SetSessionKey, SessionKeyResponse and NewSessionAlert carry the key as a 33 character string where the number was, which the auth, master and world servers now pass. The packet decoder blanks that string in a kept packet, and the packet tests write the string. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -351,14 +351,14 @@ TEST(PacketDecoderTests, NamesEveryService) {
|
||||
|
||||
TEST(PacketDecoderTests, SessionKeysBetweenServersAreBlanked) {
|
||||
MasterPackets::SetSessionKey key;
|
||||
key.sessionKey = 0xDEADBEEF;
|
||||
const std::string secret = "0123456789abcdef0123456789abcdef";
|
||||
key.sessionKey = LUString(secret);
|
||||
key.username = LUString("alice");
|
||||
RakNet::BitStream stream;
|
||||
key.WritePacket(stream);
|
||||
std::string bytes(reinterpret_cast<const char*>(stream.GetData()), stream.GetNumberOfBytesUsed());
|
||||
ASSERT_TRUE(PacketDecoder::Redact(bytes));
|
||||
const uint32_t secret = 0xDEADBEEF;
|
||||
EXPECT_EQ(bytes.find(std::string(reinterpret_cast<const char*>(&secret), 4)), std::string::npos);
|
||||
EXPECT_EQ(bytes.find(secret), std::string::npos);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
Reference in New Issue
Block a user