diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-10-01 21:03:44 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-10-03 00:38:15 +0200 |
commit | d2d3457b2fd0635e3a32a701bd0b2d17b0374b4a (patch) | |
tree | 74d8698c82179ef42bf7fe0b29006d3234a31652 /src/server/bnetserver/Server/SslContext.cpp | |
parent | e05461a0ed83ef500321383668f05bb4ba6dc6a7 (diff) |
Core/Utilities: Extend make_unique_ptr_with_deleter functionality to allow it to create deleters with compile time constant functions (reduces its size to just sizeof(void*))
(cherry picked from commit b13b5142f1009a71ff06786ac8c8db92891f566a)
Diffstat (limited to 'src/server/bnetserver/Server/SslContext.cpp')
-rw-r--r-- | src/server/bnetserver/Server/SslContext.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/bnetserver/Server/SslContext.cpp b/src/server/bnetserver/Server/SslContext.cpp index e9192475a62..7920238c16e 100644 --- a/src/server/bnetserver/Server/SslContext.cpp +++ b/src/server/bnetserver/Server/SslContext.cpp @@ -30,7 +30,7 @@ namespace { auto CreatePasswordUiMethodFromPemCallback(::pem_password_cb* callback) { - return Trinity::make_unique_ptr_with_deleter(UI_UTIL_wrap_read_pem_callback(callback, 0), &::UI_destroy_method); + return Trinity::make_unique_ptr_with_deleter<&::UI_destroy_method>(UI_UTIL_wrap_read_pem_callback(callback, 0)); } auto OpenOpenSSLStore(boost::filesystem::path const& storePath, UI_METHOD const* passwordCallback, void* passwordCallbackData) @@ -45,7 +45,7 @@ auto OpenOpenSSLStore(boost::filesystem::path const& storePath, UI_METHOD const* uri += genericPath; - return Trinity::make_unique_ptr_with_deleter(OSSL_STORE_open(uri.c_str(), passwordCallback, passwordCallbackData, nullptr, nullptr), &::OSSL_STORE_close); + return Trinity::make_unique_ptr_with_deleter<&::OSSL_STORE_close>(OSSL_STORE_open(uri.c_str(), passwordCallback, passwordCallbackData, nullptr, nullptr)); } boost::system::error_code GetLastOpenSSLError() @@ -136,7 +136,7 @@ bool Battlenet::SslContext::Initialize() unsigned char* utf8TextRaw = nullptr; if (int utf8Length = ASN1_STRING_to_UTF8(&utf8TextRaw, text); utf8Length >= 0) { - auto utf8Text = Trinity::make_unique_ptr_with_deleter(utf8TextRaw, [](unsigned char* ptr) { ::OPENSSL_free(ptr); }); + auto utf8Text = Trinity::make_unique_ptr_with_deleter<[](unsigned char* ptr) { ::OPENSSL_free(ptr); } >(utf8TextRaw); if (std::string_view(reinterpret_cast<char const*>(utf8Text.get()), utf8Length) == "*.*") return true; } |