* Rename SARC4 to ARC4.
--HG-- branch : trunk
This commit is contained in:
@@ -19,14 +19,14 @@
|
||||
#include "ARC4.h"
|
||||
#include <openssl/sha.h>
|
||||
|
||||
SARC4::SARC4(uint8 len)
|
||||
ARC4::ARC4(uint8 len)
|
||||
{
|
||||
EVP_CIPHER_CTX_init(&m_ctx);
|
||||
EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
|
||||
EVP_CIPHER_CTX_set_key_length(&m_ctx, len);
|
||||
}
|
||||
|
||||
SARC4::SARC4(uint8 *seed, uint8 len)
|
||||
ARC4::ARC4(uint8 *seed, uint8 len)
|
||||
{
|
||||
EVP_CIPHER_CTX_init(&m_ctx);
|
||||
EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
|
||||
@@ -34,17 +34,17 @@ SARC4::SARC4(uint8 *seed, uint8 len)
|
||||
EVP_EncryptInit_ex(&m_ctx, NULL, NULL, seed, NULL);
|
||||
}
|
||||
|
||||
SARC4::~SARC4()
|
||||
ARC4::~ARC4()
|
||||
{
|
||||
EVP_CIPHER_CTX_cleanup(&m_ctx);
|
||||
}
|
||||
|
||||
void SARC4::Init(uint8 *seed)
|
||||
void ARC4::Init(uint8 *seed)
|
||||
{
|
||||
EVP_EncryptInit_ex(&m_ctx, NULL, NULL, seed, NULL);
|
||||
}
|
||||
|
||||
void SARC4::UpdateData(int len, uint8 *data)
|
||||
void ARC4::UpdateData(int len, uint8 *data)
|
||||
{
|
||||
int outlen = 0;
|
||||
EVP_EncryptUpdate(&m_ctx, data, &outlen, data, len);
|
||||
|
||||
@@ -22,15 +22,16 @@
|
||||
#include "Common.h"
|
||||
#include <openssl/evp.h>
|
||||
|
||||
class SARC4
|
||||
class ARC4
|
||||
{
|
||||
public:
|
||||
SARC4(uint8 len);
|
||||
SARC4(uint8 *seed, uint8 len);
|
||||
~SARC4();
|
||||
ARC4(uint8 len);
|
||||
ARC4(uint8 *seed, uint8 len);
|
||||
~ARC4();
|
||||
void Init(uint8 *seed);
|
||||
void UpdateData(int len, uint8 *data);
|
||||
private:
|
||||
EVP_CIPHER_CTX m_ctx;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -43,13 +43,13 @@ void AuthCrypt::Init(BigNumber *K)
|
||||
HmacHash clientDecryptHmac(SEED_KEY_SIZE, (uint8*)ServerDecryptionKey);
|
||||
uint8 *decryptHash = clientDecryptHmac.ComputeHash(K);
|
||||
|
||||
//SARC4 _serverDecrypt(encryptHash);
|
||||
//ARC4 _serverDecrypt(encryptHash);
|
||||
_clientDecrypt.Init(decryptHash);
|
||||
_serverEncrypt.Init(encryptHash);
|
||||
//SARC4 _clientEncrypt(decryptHash);
|
||||
//ARC4 _clientEncrypt(decryptHash);
|
||||
|
||||
// Drop first 1024 bytes, as WoW uses ARC4-drop1024.
|
||||
uint8 syncBuf[1024];
|
||||
|
||||
memset(syncBuf, 0, 1024);
|
||||
|
||||
_serverEncrypt.UpdateData(1024, syncBuf);
|
||||
|
||||
@@ -39,8 +39,8 @@ class AuthCrypt
|
||||
bool IsInitialized() { return _initialized; }
|
||||
|
||||
private:
|
||||
SARC4 _clientDecrypt;
|
||||
SARC4 _serverEncrypt;
|
||||
ARC4 _clientDecrypt;
|
||||
ARC4 _serverEncrypt;
|
||||
bool _initialized;
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user