diff options
| author | Ovahlord <dreadkiller@gmx.de> | 2025-04-05 12:12:58 +0200 |
|---|---|---|
| committer | Ovahlord <dreadkiller@gmx.de> | 2025-04-05 12:12:58 +0200 |
| commit | 8903b7d751f1af7e8044d53ba733697e8411d2b0 (patch) | |
| tree | f5451112d8064cd014b62e644a55fdce324283a7 /src/common/Cryptography/Authentication | |
| parent | 1f7643db035c5ee1afcde359baebe38cbb59ad04 (diff) | |
Core: cherry picked several packet changes from 11.0.7 which are also needed for 4.4.2
Diffstat (limited to 'src/common/Cryptography/Authentication')
| -rw-r--r-- | src/common/Cryptography/Authentication/WorldPacketCrypt.cpp | 4 | ||||
| -rw-r--r-- | src/common/Cryptography/Authentication/WorldPacketCrypt.h | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/common/Cryptography/Authentication/WorldPacketCrypt.cpp b/src/common/Cryptography/Authentication/WorldPacketCrypt.cpp index 926f77d757d..498588c71f0 100644 --- a/src/common/Cryptography/Authentication/WorldPacketCrypt.cpp +++ b/src/common/Cryptography/Authentication/WorldPacketCrypt.cpp @@ -19,11 +19,11 @@ #include <array> #include <cstring> -WorldPacketCrypt::WorldPacketCrypt() : _clientDecrypt(false), _serverEncrypt(true), _clientCounter(0), _serverCounter(0), _initialized(false) +WorldPacketCrypt::WorldPacketCrypt() : _clientDecrypt(false, 256), _serverEncrypt(true, 256), _clientCounter(0), _serverCounter(0), _initialized(false) { } -void WorldPacketCrypt::Init(Trinity::Crypto::AES::Key const& key) +void WorldPacketCrypt::Init(Key const& key) { _clientDecrypt.Init(key); _serverEncrypt.Init(key); diff --git a/src/common/Cryptography/Authentication/WorldPacketCrypt.h b/src/common/Cryptography/Authentication/WorldPacketCrypt.h index 1936ff5ca5f..c36e2b9c93c 100644 --- a/src/common/Cryptography/Authentication/WorldPacketCrypt.h +++ b/src/common/Cryptography/Authentication/WorldPacketCrypt.h @@ -23,9 +23,11 @@ class TC_COMMON_API WorldPacketCrypt { public: + using Key = std::array<uint8, 32>; + WorldPacketCrypt(); - void Init(Trinity::Crypto::AES::Key const& key); + void Init(Key const& key); bool PeekDecryptRecv(uint8* data, size_t length); bool DecryptRecv(uint8* data, size_t length, Trinity::Crypto::AES::Tag& tag); bool EncryptSend(uint8* data, size_t length, Trinity::Crypto::AES::Tag& tag); |
