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/common/Cryptography/Ed25519.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/common/Cryptography/Ed25519.cpp')
-rw-r--r-- | src/common/Cryptography/Ed25519.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/Cryptography/Ed25519.cpp b/src/common/Cryptography/Ed25519.cpp index 6f286c74b3e..febd8237c57 100644 --- a/src/common/Cryptography/Ed25519.cpp +++ b/src/common/Cryptography/Ed25519.cpp @@ -68,7 +68,7 @@ bool Ed25519::LoadFromFile(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_free>(BIO_new_file(fileName.c_str(), "r")); if (!keyBIO) return false; @@ -87,9 +87,9 @@ bool Ed25519::LoadFromString(std::string const& keyPem) _key = nullptr; } - auto keyBIO = make_unique_ptr_with_deleter(BIO_new_mem_buf( + auto keyBIO = make_unique_ptr_with_deleter<&BIO_free>(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), &BIO_free); + keyPem.length() + 1)); if (!keyBIO) return false; |