From ea79f5de1d7a7c4bd50a82028d0f8a27c31f3d3d Mon Sep 17 00:00:00 2001 From: fallenoak Date: Fri, 24 Mar 2023 16:54:38 -0500 Subject: [PATCH] feat(net): handle encryption on message sends --- src/net/connection/WowConnection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/net/connection/WowConnection.cpp b/src/net/connection/WowConnection.cpp index 5d6d0fa..85a9c50 100644 --- a/src/net/connection/WowConnection.cpp +++ b/src/net/connection/WowConnection.cpp @@ -738,7 +738,8 @@ WC_SEND_RESULT WowConnection::Send(CDataStore* msg, int32_t a3) { auto sn = this->NewSendNode(data, msg->Size(), false); if (this->m_encrypt) { - // TODO encryption + auto bufSize = std::min(sn->size, sn->size + this->uint375 - sn->datasize); + SARC4ProcessBuffer(sn->data, bufSize, &this->m_sendKey, &this->m_sendKey); } this->m_sendList.LinkToTail(sn); @@ -782,7 +783,8 @@ WC_SEND_RESULT WowConnection::Send(CDataStore* msg, int32_t a3) { } if (this->m_encrypt) { - // TODO encryption + auto bufSize = std::min(sn->size, sn->size + this->uint375 - sn->datasize); + SARC4ProcessBuffer(sn->data, bufSize, &this->m_sendKey, &this->m_sendKey); } uint32_t written;