From 249eb19fe108511c5f56e30944816ebb87617ec1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 7 May 2024 12:26:21 +0200 Subject: Core/Misc: Minor change to make_unique_ptr_with_deleter to make it accept only pointers (cherry picked from commit 83f4763b25891c9fe6c7f01b75cdf0f4ef66fc9a) --- src/common/Cryptography/RSA.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/common/Cryptography/RSA.cpp') diff --git a/src/common/Cryptography/RSA.cpp b/src/common/Cryptography/RSA.cpp index eb85b6e5750..cef03fdc1bb 100644 --- a/src/common/Cryptography/RSA.cpp +++ b/src/common/Cryptography/RSA.cpp @@ -429,7 +429,7 @@ bool RsaSignature::LoadKeyFromFile(std::string const& fileName) _key = nullptr; } - auto keyBIO = make_unique_ptr_with_deleter(BIO_new_file(fileName.c_str(), "r"), BIO_free); + auto keyBIO = make_unique_ptr_with_deleter(BIO_new_file(fileName.c_str(), "r"), &BIO_free); if (!keyBIO) return false; @@ -450,7 +450,7 @@ bool RsaSignature::LoadKeyFromString(std::string const& keyPem) auto keyBIO = make_unique_ptr_with_deleter(BIO_new_mem_buf( const_cast(keyPem.c_str()) /*api hack - this function assumes memory is readonly but lacks const modifier*/, - keyPem.length() + 1), BIO_free); + keyPem.length() + 1), &BIO_free); if (!keyBIO) return false; @@ -466,7 +466,7 @@ bool RsaSignature::Sign(uint8 const* message, std::size_t messageLength, DigestG std::unique_ptr digestGenerator = generator.GetGenerator(); #if OPENSSL_VERSION_NUMBER >= 0x30000000L - auto keyCtx = make_unique_ptr_with_deleter(EVP_PKEY_CTX_new_from_pkey(generator.GetLib(), _key, nullptr), EVP_PKEY_CTX_free); + auto keyCtx = make_unique_ptr_with_deleter(EVP_PKEY_CTX_new_from_pkey(generator.GetLib(), _key, nullptr), &EVP_PKEY_CTX_free); EVP_MD_CTX_set_pkey_ctx(_ctx, keyCtx.get()); std::unique_ptr params = generator.GetParams(); -- cgit v1.2.3