Merge branch '3.3.5' into 4.3.4
Conflicts: sql/base/auth_database.sql sql/updates/world/2015_08_29_00_world.sql sql/updates/world/2015_08_29_01_world.sql sql/updates/world/2015_08_30_00_world.sql sql/updates/world/2015_08_31_01_world.sql sql/updates/world/2015_09_02_00_world.sql sql/updates/world/2015_09_02_01_world.sql sql/updates/world/2015_09_02_04_world.sql sql/updates/world/2015_09_03_00_world.sql sql/updates/world/2015_09_03_01_world.sql sql/updates/world/2015_09_03_02_world.sql sql/updates/world/2015_09_03_03_world.sql sql/updates/world/2015_09_03_04_world.sql sql/updates/world/2015_09_03_06_world.sql sql/updates/world/2015_09_03_07_world.sql sql/updates/world/2015_09_03_08_world.sql sql/updates/world/2015_09_03_09_world.sql sql/updates/world/2015_09_03_10_world.sql sql/updates/world/2015_09_03_11_world.sql sql/updates/world/2015_09_04_00_world.sql sql/updates/world/2015_09_04_01_world.sql sql/updates/world/2015_09_04_02_world.sql sql/updates/world/2015_09_04_03_world.sql sql/updates/world/2015_09_07_00_world.sql sql/updates/world/2015_09_07_01_world.sql sql/updates/world/2015_09_07_02_world.sql sql/updates/world/2015_09_07_03_world.sql sql/updates/world/2015_09_07_04_world.sql sql/updates/world/2015_09_07_05_world.sql sql/updates/world/2015_09_08_00_world.sql src/common/Collision/Management/MMapManager.cpp src/common/Cryptography/Authentication/AuthCrypt.cpp src/common/Cryptography/Authentication/AuthCrypt.h src/common/Cryptography/HMACSHA1.cpp src/common/Cryptography/HMACSHA1.h src/server/CMakeLists.txt src/server/collision/CMakeLists.txt src/server/game/CMakeLists.txt src/server/game/Entities/Object/ObjectGuid.h src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Player/Player.h src/server/game/Entities/Unit/Unit.cpp src/server/game/Globals/ObjectMgr.cpp src/server/game/Quests/QuestDef.cpp src/server/game/Spells/Auras/SpellAuraEffects.cpp src/server/game/Spells/Auras/SpellAuras.cpp src/server/game/World/World.cpp src/server/scripts/CMakeLists.txt src/server/scripts/Commands/cs_cheat.cpp src/server/scripts/Commands/cs_debug.cpp src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp src/server/scripts/EasternKingdoms/zone_hinterlands.cpp src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp src/server/scripts/Spells/spell_mage.cpp src/server/worldserver/CMakeLists.txt src/server/worldserver/Main.cpp
This commit is contained in:
commit
221f1405b6
252 files changed
+5466
-5950
No files matched your search
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "HmacHash.h"
|
||||
#include "BigNumber.h"
|
||||
#include "Common.h"
|
||||
|
||||
template<HashCreateFn HashCreator, uint32 DigestLength>
|
||||
HmacHash<HashCreator, DigestLength>::HmacHash(uint32 len, uint8 *seed)
|
||||
{
|
||||
HMAC_CTX_init(&_ctx);
|
||||
HMAC_Init_ex(&_ctx, seed, len, HashCreator(), NULL);
|
||||
memset(_digest, 0, DigestLength);
|
||||
}
|
||||
|
||||
template<HashCreateFn HashCreator, uint32 DigestLength>
|
||||
HmacHash<HashCreator, DigestLength>::~HmacHash()
|
||||
{
|
||||
HMAC_CTX_cleanup(&_ctx);
|
||||
}
|
||||
|
||||
template<HashCreateFn HashCreator, uint32 DigestLength>
|
||||
void HmacHash<HashCreator, DigestLength>::UpdateData(const std::string &str)
|
||||
{
|
||||
HMAC_Update(&_ctx, (uint8 const*)str.c_str(), str.length());
|
||||
}
|
||||
|
||||
template<HashCreateFn HashCreator, uint32 DigestLength>
|
||||
void HmacHash<HashCreator, DigestLength>::UpdateData(const uint8* data, size_t len)
|
||||
{
|
||||
HMAC_Update(&_ctx, data, len);
|
||||
}
|
||||
|
||||
template<HashCreateFn HashCreator, uint32 DigestLength>
|
||||
void HmacHash<HashCreator, DigestLength>::Finalize()
|
||||
{
|
||||
uint32 length = 0;
|
||||
HMAC_Final(&_ctx, _digest, &length);
|
||||
ASSERT(length == DigestLength);
|
||||
}
|
||||
|
||||
template<HashCreateFn HashCreator, uint32 DigestLength>
|
||||
uint8* HmacHash<HashCreator, DigestLength>::ComputeHash(BigNumber* bn)
|
||||
{
|
||||
HMAC_Update(&_ctx, bn->AsByteArray().get(), bn->GetNumBytes());
|
||||
Finalize();
|
||||
return _digest;
|
||||
}
|
||||
|
||||
template class HmacHash<EVP_sha1, SHA_DIGEST_LENGTH>;
|
||||
template class HmacHash<EVP_sha256, SHA256_DIGEST_LENGTH>;
|
||||
Reference in new issue
Block a user