@@ -25,10 +25,16 @@ WorldPacketCrypt::WorldPacketCrypt() : _initialized(false)
2525
2626void WorldPacketCrypt::Init (SessionKey const & K)
2727{
28- uint8 ServerEncryptionKey[] = { 0xCC , 0x98 , 0xAE , 0x04 , 0xE8 , 0x97 , 0xEA , 0xCA , 0x12 , 0xDD , 0xC0 , 0x93 , 0x42 , 0x91 , 0x53 , 0x57 };
29- _serverEncrypt.Init (Trinity::Crypto::HMAC_SHA1::GetDigestOf (ServerEncryptionKey, K));
30- uint8 ServerDecryptionKey[] = { 0xC2 , 0xB3 , 0x72 , 0x3C , 0xC6 , 0xAE , 0xD9 , 0xB5 , 0x34 , 0x3C , 0x53 , 0xEE , 0x2F , 0x43 , 0x67 , 0xCE };
31- _clientDecrypt.Init (Trinity::Crypto::HMAC_SHA1::GetDigestOf (ServerDecryptionKey, K));
28+ static constexpr std::array<uint8, 16 > ServerEncryptionKey = { 0xCC , 0x98 , 0xAE , 0x04 , 0xE8 , 0x97 , 0xEA , 0xCA , 0x12 , 0xDD , 0xC0 , 0x93 , 0x42 , 0x91 , 0x53 , 0x57 };
29+ static constexpr std::array<uint8, 16 > ServerDecryptionKey = { 0xC2 , 0xB3 , 0x72 , 0x3C , 0xC6 , 0xAE , 0xD9 , 0xB5 , 0x34 , 0x3C , 0x53 , 0xEE , 0x2F , 0x43 , 0x67 , 0xCE };
30+
31+ Init (K, ServerEncryptionKey, ServerDecryptionKey);
32+ }
33+
34+ void WorldPacketCrypt::Init (SessionKey const & K, std::span<uint8 const , 16 > serverKey, std::span<uint8 const , 16 > clientKey)
35+ {
36+ _serverEncrypt.Init (Trinity::Crypto::HMAC_SHA1::GetDigestOf (serverKey, K));
37+ _clientDecrypt.Init (Trinity::Crypto::HMAC_SHA1::GetDigestOf (clientKey, K));
3238
3339 // Drop first 1024 bytes, as WoW uses ARC4-drop1024.
3440 std::array<uint8, 1024 > syncBuf;
0 commit comments