diff options
Diffstat (limited to 'src/common/Cryptography/Authentication')
-rw-r--r-- | src/common/Cryptography/Authentication/WorldPacketCrypt.cpp | 12 | ||||
-rw-r--r-- | src/common/Cryptography/Authentication/WorldPacketCrypt.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/common/Cryptography/Authentication/WorldPacketCrypt.cpp b/src/common/Cryptography/Authentication/WorldPacketCrypt.cpp index 723657048d5..926f77d757d 100644 --- a/src/common/Cryptography/Authentication/WorldPacketCrypt.cpp +++ b/src/common/Cryptography/Authentication/WorldPacketCrypt.cpp @@ -41,6 +41,18 @@ struct WorldPacketCryptIV std::array<uint8, 12> Value; }; +bool WorldPacketCrypt::PeekDecryptRecv(uint8* data, size_t length) +{ + if (_initialized) + { + WorldPacketCryptIV iv{ _clientCounter, 0x544E4C43 }; + if (!_clientDecrypt.ProcessNoIntegrityCheck(iv.Value, data, length)) + return false; + } + + return true; +} + bool WorldPacketCrypt::DecryptRecv(uint8* data, size_t length, Trinity::Crypto::AES::Tag& tag) { if (_initialized) diff --git a/src/common/Cryptography/Authentication/WorldPacketCrypt.h b/src/common/Cryptography/Authentication/WorldPacketCrypt.h index 5cd6e1282b8..600d0d1715e 100644 --- a/src/common/Cryptography/Authentication/WorldPacketCrypt.h +++ b/src/common/Cryptography/Authentication/WorldPacketCrypt.h @@ -27,6 +27,7 @@ public: WorldPacketCrypt(); void Init(Trinity::Crypto::AES::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); |