aboutsummaryrefslogtreecommitdiff
path: root/src/shared/Auth/AuthCrypt.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-17 15:35:07 -0700
committermaximius <none@none>2009-10-17 15:35:07 -0700
commit26b5e033ffde3d161382fc9addbfa99738379641 (patch)
treea344f369ca32945f787a02dee35c3dbe342bed7e /src/shared/Auth/AuthCrypt.cpp
parentf21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff)
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk
Diffstat (limited to 'src/shared/Auth/AuthCrypt.cpp')
-rw-r--r--src/shared/Auth/AuthCrypt.cpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/shared/Auth/AuthCrypt.cpp b/src/shared/Auth/AuthCrypt.cpp
index e8126ad9f73..56d70d4c14e 100644
--- a/src/shared/Auth/AuthCrypt.cpp
+++ b/src/shared/Auth/AuthCrypt.cpp
@@ -17,65 +17,48 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#include "AuthCrypt.h"
#include "Hmac.h"
#include "Log.h"
#include "BigNumber.h"
-
AuthCrypt::AuthCrypt()
{
_initialized = false;
}
-
AuthCrypt::~AuthCrypt()
{
-
}
-
void AuthCrypt::Init(BigNumber *K)
{
uint8 ServerEncryptionKey[SEED_KEY_SIZE] = { 0x22, 0xBE, 0xE5, 0xCF, 0xBB, 0x07, 0x64, 0xD9, 0x00, 0x45, 0x1B, 0xD0, 0x24, 0xB8, 0xD5, 0x45 };
HmacHash serverEncryptHmac(SEED_KEY_SIZE, (uint8*)ServerEncryptionKey);
uint8 *encryptHash = serverEncryptHmac.ComputeHash(K);
-
uint8 ServerDecryptionKey[SEED_KEY_SIZE] = { 0xF4, 0x66, 0x31, 0x59, 0xFC, 0x83, 0x6E, 0x31, 0x31, 0x02, 0x51, 0xD5, 0x44, 0x31, 0x67, 0x98 };
HmacHash clientDecryptHmac(SEED_KEY_SIZE, (uint8*)ServerDecryptionKey);
uint8 *decryptHash = clientDecryptHmac.ComputeHash(K);
-
//SARC4 _serverDecrypt(encryptHash);
_clientDecrypt.Init(decryptHash);
_serverEncrypt.Init(encryptHash);
//SARC4 _clientEncrypt(decryptHash);
-
uint8 syncBuf[1024];
-
memset(syncBuf, 0, 1024);
-
_serverEncrypt.UpdateData(1024, syncBuf);
//_clientEncrypt.UpdateData(1024, syncBuf);
-
memset(syncBuf, 0, 1024);
-
//_serverDecrypt.UpdateData(1024, syncBuf);
_clientDecrypt.UpdateData(1024, syncBuf);
-
_initialized = true;
}
-
void AuthCrypt::DecryptRecv(uint8 *data, size_t len)
{
if (!_initialized)
return;
-
_clientDecrypt.UpdateData(len, data);
}
-
void AuthCrypt::EncryptSend(uint8 *data, size_t len)
{
if (!_initialized)
return;
-
_serverEncrypt.UpdateData(len, data);
}