From 130d3eb0ae171eee0a7292c408b12bf3ccf73d2f Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 26 Dec 2017 01:37:02 +0100 Subject: Core/Crypto: Add const_cast hack to fix linux build with openssl --- src/common/Cryptography/RSA.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/common/Cryptography/RSA.cpp') diff --git a/src/common/Cryptography/RSA.cpp b/src/common/Cryptography/RSA.cpp index db880b642eb..c40907a56a1 100644 --- a/src/common/Cryptography/RSA.cpp +++ b/src/common/Cryptography/RSA.cpp @@ -77,7 +77,9 @@ bool Trinity::Crypto::RSA::LoadFromFile(std::string const& fileName, KeyTag) template bool Trinity::Crypto::RSA::LoadFromString(std::string const& keyPem, KeyTag) { - std::unique_ptr keyBIO(BIO_new_mem_buf(keyPem.c_str(), keyPem.length() + 1)); + std::unique_ptr keyBIO(BIO_new_mem_buf( + const_cast(keyPem.c_str()) /*api hack - this function assumes memory is readonly but lacks const modifier*/, + keyPem.length() + 1)); if (!keyBIO) return false; -- cgit v1.2.3