Skip to content

Commit 11b9762

Browse files
committed
Fix build error
1 parent c35ef61 commit 11b9762

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Shared/mods/deathmatch/logic/luadefs/CLuaCryptDefs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ std::variant<std::string, bool> CLuaCryptDefs::Hash(lua_State* const luaVM, Hash
6262
switch (hashFunction)
6363
{
6464
case HashFunctionType::MD5:
65-
return SharedUtil::Hash<CryptoPP::MD5>(strSourceData).ToLower();
65+
return SharedUtil::Hash<CryptoPP::Weak::MD5>(strSourceData).ToLower();
6666

6767
case HashFunctionType::SHA1:
6868
return SharedUtil::Hash<CryptoPP::SHA1>(strSourceData).ToLower();
@@ -106,7 +106,7 @@ std::variant<std::string, bool> CLuaCryptDefs::Hash(lua_State* const luaVM, Hash
106106
switch (hmacAlgorithm)
107107
{
108108
case HmacAlgorithm::MD5:
109-
return SharedUtil::Hmac<CryptoPP::MD5>(strSourceData, key).ToLower();
109+
return SharedUtil::Hmac<CryptoPP::Weak::MD5>(strSourceData, key).ToLower();
110110

111111
case HmacAlgorithm::SHA1:
112112
return SharedUtil::Hmac<CryptoPP::SHA1>(strSourceData, key).ToLower();

Shared/mods/deathmatch/logic/luadefs/CLuaFileDefs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ std::optional<std::string> CLuaFileDefs::fileGetHash(lua_State* const luaVM, CSc
918918
switch (hashFunction)
919919
{
920920
case HashFunctionType::MD5:
921-
result = ComputeScriptFileHash<CryptoPP::MD5>(scriptFile);
921+
result = ComputeScriptFileHash<CryptoPP::Weak::MD5>(scriptFile);
922922
break;
923923
case HashFunctionType::SHA1:
924924
result = ComputeScriptFileHash<CryptoPP::SHA1>(scriptFile);
@@ -955,7 +955,7 @@ std::optional<std::string> CLuaFileDefs::fileGetHash(lua_State* const luaVM, CSc
955955
switch (hmacAlgorithm)
956956
{
957957
case HmacAlgorithm::MD5:
958-
result = ComputeScriptFileHash<CryptoPP::HMAC<CryptoPP::MD5>>(scriptFile, key);
958+
result = ComputeScriptFileHash<CryptoPP::HMAC<CryptoPP::Weak::MD5>>(scriptFile, key);
959959
break;
960960
case HmacAlgorithm::SHA1:
961961
result = ComputeScriptFileHash<CryptoPP::HMAC<CryptoPP::SHA1>>(scriptFile, key);

Shared/sdk/SharedUtil.Tests.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ void SharedUtil_Hash_Tests()
789789
switch (algorithm)
790790
{
791791
case HmacAlgorithm::MD5:
792-
hmacResult = SharedUtil::Hmac<CryptoPP::MD5>(data, key);
792+
hmacResult = SharedUtil::Hmac<CryptoPP::Weak::MD5>(data, key);
793793
break;
794794
case HmacAlgorithm::SHA1:
795795
hmacResult = SharedUtil::Hmac<CryptoPP::SHA1>(data, key);

vendor/cryptopp/md5.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#ifndef CRYPTOPP_MD5_H
22
#define CRYPTOPP_MD5_H
3+
#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
34

45
#include "iterhash.h"
56

@@ -10,7 +11,7 @@ namespace Weak1 {
1011
/// \brief MD5 message digest
1112
/// \sa <a href="http://www.cryptolounge.org/wiki/MD5">MD5</a>
1213
/// \since Crypto++ 1.0
13-
class MD5 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 16, MD5>
14+
class Weak::MD5 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 16, MD5>
1415
{
1516
public:
1617
static void InitState(HashWordType *state);

0 commit comments

Comments
 (0)