feat(Core/Crypto): add support OpenSSL 3.0 (#13354)

This commit is contained in:
Winfidonarleyan
2022-11-23 21:12:20 +03:00
committed by GitHub
parent 4a2964e10a
commit a1a1528cb4
37 changed files with 1099 additions and 507 deletions

View File

@@ -17,10 +17,10 @@
#include "AddonMgr.h"
#include "DatabaseEnv.h"
#include "CryptoHash.h"
#include "Log.h"
#include "Timer.h"
#include <list>
#include <openssl/md5.h>
namespace AddonMgr
{
@@ -66,6 +66,7 @@ namespace AddonMgr
oldMSTime = getMSTime();
result = CharacterDatabase.Query("SELECT id, name, version, UNIX_TIMESTAMP(timestamp) FROM banned_addons");
if (result)
{
uint32 count2 = 0;
@@ -78,14 +79,10 @@ namespace AddonMgr
BannedAddon addon{};
addon.Id = fields[0].Get<uint32>() + offset;
addon.Timestamp = uint32(fields[3].Get<uint64>());
addon.NameMD5 = Acore::Crypto::MD5::GetDigestOf(fields[1].Get<std::string>());
addon.VersionMD5 = Acore::Crypto::MD5::GetDigestOf(fields[2].Get<std::string>());
std::string name = fields[1].Get<std::string>();
std::string version = fields[2].Get<std::string>();
MD5(reinterpret_cast<uint8 const*>(name.c_str()), name.length(), addon.NameMD5);
MD5(reinterpret_cast<uint8 const*>(version.c_str()), version.length(), addon.VersionMD5);
m_bannedAddons.push_back(addon);
m_bannedAddons.emplace_back(addon);
++count2;
} while (result->NextRow());