diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 000000000..e5ce3fcf2 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,12 @@ +# +# NOTE! Don't add files that are generated in specific +# subdirectories here. Add them in the ".gitignore" file +# in that subdirectory instead. +# +# NOTE! Please use 'git-ls-files -i --exclude-standard' +# command after changing this file, to see if there are +# any tracked files which get ignored after the change. +# +# Doxygen generic files +# +bnetd diff --git a/src/shared/Auth/AuthCrypt.cpp b/src/shared/Auth/AuthCrypt.cpp index 960a5deef..9b1ad6348 100644 --- a/src/shared/Auth/AuthCrypt.cpp +++ b/src/shared/Auth/AuthCrypt.cpp @@ -17,7 +17,7 @@ */ #include "AuthCrypt.h" -#include "Hmac.h" +#include "HMACSHA1.h" #include "Log.h" #include "BigNumber.h" @@ -35,12 +35,12 @@ void AuthCrypt::Init(BigNumber *K) { uint8 ServerEncryptionKey[SEED_KEY_SIZE] = { 0xCC, 0x98, 0xAE, 0x04, 0xE8, 0x97, 0xEA, 0xCA, 0x12, 0xDD, 0xC0, 0x93, 0x42, 0x91, 0x53, 0x57 }; - HmacHash serverEncryptHmac(SEED_KEY_SIZE, (uint8*)ServerEncryptionKey); + HMACSHA1 serverEncryptHmac(SEED_KEY_SIZE, (uint8*)ServerEncryptionKey); uint8 *encryptHash = serverEncryptHmac.ComputeHash(K); uint8 ServerDecryptionKey[SEED_KEY_SIZE] = { 0xC2, 0xB3, 0x72, 0x3C, 0xC6, 0xAE, 0xD9, 0xB5, 0x34, 0x3C, 0x53, 0xEE, 0x2F, 0x43, 0x67, 0xCE }; - HmacHash clientDecryptHmac(SEED_KEY_SIZE, (uint8*)ServerDecryptionKey); + HMACSHA1 clientDecryptHmac(SEED_KEY_SIZE, (uint8*)ServerDecryptionKey); uint8 *decryptHash = clientDecryptHmac.ComputeHash(K); //SARC4 _serverDecrypt(encryptHash); diff --git a/src/shared/Auth/Hmac.cpp b/src/shared/Auth/HMACSHA1.cpp similarity index 80% rename from src/shared/Auth/Hmac.cpp rename to src/shared/Auth/HMACSHA1.cpp index ce5d1f100..1f78066c8 100644 --- a/src/shared/Auth/Hmac.cpp +++ b/src/shared/Auth/HMACSHA1.cpp @@ -16,43 +16,43 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Auth/Hmac.h" +#include "Auth/HMACSHA1.h" #include "BigNumber.h" -HmacHash::HmacHash(uint32 len, uint8 *seed) +HMACSHA1::HMACSHA1(uint32 len, uint8 *seed) { HMAC_CTX_init(&m_ctx); HMAC_Init_ex(&m_ctx, seed, len, EVP_sha1(), NULL); } -HmacHash::~HmacHash() +HMACSHA1::~HMACSHA1() { HMAC_CTX_cleanup(&m_ctx); } -void HmacHash::UpdateBigNumber(BigNumber *bn) +void HMACSHA1::UpdateBigNumber(BigNumber *bn) { UpdateData(bn->AsByteArray(), bn->GetNumBytes()); } -void HmacHash::UpdateData(const uint8 *data, int length) +void HMACSHA1::UpdateData(const uint8 *data, int length) { HMAC_Update(&m_ctx, data, length); } -void HmacHash::UpdateData(const std::string &str) +void HMACSHA1::UpdateData(const std::string &str) { UpdateData((uint8 const*)str.c_str(), str.length()); } -void HmacHash::Finalize() +void HMACSHA1::Finalize() { uint32 length = 0; HMAC_Final(&m_ctx, (uint8*)m_digest, &length); ASSERT(length == SHA_DIGEST_LENGTH); } -uint8 *HmacHash::ComputeHash(BigNumber *bn) +uint8 *HMACSHA1::ComputeHash(BigNumber *bn) { HMAC_Update(&m_ctx, bn->AsByteArray(), bn->GetNumBytes()); Finalize(); diff --git a/src/shared/Auth/Hmac.h b/src/shared/Auth/HMACSHA1.h similarity index 91% rename from src/shared/Auth/Hmac.h rename to src/shared/Auth/HMACSHA1.h index 761b98366..233d81c2d 100644 --- a/src/shared/Auth/Hmac.h +++ b/src/shared/Auth/HMACSHA1.h @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _AUTH_HMAC_H -#define _AUTH_HMAC_H +#ifndef _AUTH_HMACSHA1_H +#define _AUTH_HMACSHA1_H #include "Common.h" #include @@ -27,11 +27,11 @@ class BigNumber; #define SEED_KEY_SIZE 16 -class HmacHash +class HMACSHA1 { public: - HmacHash(uint32 len, uint8 *seed); - ~HmacHash(); + HMACSHA1(uint32 len, uint8 *seed); + ~HMACSHA1(); void UpdateBigNumber(BigNumber *bn); void UpdateData(const uint8 *data, int length); void UpdateData(const std::string &str); diff --git a/src/shared/Auth/Makefile.am b/src/shared/Auth/Makefile.am index 869c1a180..365a71966 100644 --- a/src/shared/Auth/Makefile.am +++ b/src/shared/Auth/Makefile.am @@ -31,8 +31,8 @@ libmangosauth_a_SOURCES = \ AuthCrypt.h \ BigNumber.cpp \ BigNumber.h \ - Hmac.cpp \ - Hmac.h \ + HMACSHA1.cpp \ + HMACSHA1.h \ SARC4.cpp \ SARC4.h \ Sha1.cpp \ diff --git a/win/VC100/shared.vcxproj b/win/VC100/shared.vcxproj index 56aa97f27..c67029dd2 100644 --- a/win/VC100/shared.vcxproj +++ b/win/VC100/shared.vcxproj @@ -432,7 +432,7 @@ - + @@ -468,7 +468,7 @@ - + diff --git a/win/VC80/shared.vcproj b/win/VC80/shared.vcproj index e629d95a5..f23732b84 100644 --- a/win/VC80/shared.vcproj +++ b/win/VC80/shared.vcproj @@ -717,11 +717,11 @@ >