mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Core/Crypto: Add const_cast hack to fix linux build with openssl
This commit is contained in:
@@ -77,7 +77,9 @@ bool Trinity::Crypto::RSA::LoadFromFile(std::string const& fileName, KeyTag)
|
||||
template <typename KeyTag>
|
||||
bool Trinity::Crypto::RSA::LoadFromString(std::string const& keyPem, KeyTag)
|
||||
{
|
||||
std::unique_ptr<BIO, BIODeleter> keyBIO(BIO_new_mem_buf(keyPem.c_str(), keyPem.length() + 1));
|
||||
std::unique_ptr<BIO, BIODeleter> keyBIO(BIO_new_mem_buf(
|
||||
const_cast<char*>(keyPem.c_str()) /*api hack - this function assumes memory is readonly but lacks const modifier*/,
|
||||
keyPem.length() + 1));
|
||||
if (!keyBIO)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Trinity
|
||||
{
|
||||
namespace Crypto
|
||||
{
|
||||
class RSA
|
||||
class TC_COMMON_API RSA
|
||||
{
|
||||
public:
|
||||
struct NoPadding : std::integral_constant<int32, RSA_NO_PADDING> {};
|
||||
|
||||
Reference in New Issue
Block a user