From 9b718459d12a944c5b857f4d64c0a5dba3fbdc00 Mon Sep 17 00:00:00 2001 From: blankie Date: Fri, 8 Dec 2023 22:44:56 +1100 Subject: [PATCH] Fix compilation on OpenSSL 1.1.0 --- openssl_wrapper.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openssl_wrapper.cpp b/openssl_wrapper.cpp index 99352ca..2b063f5 100644 --- a/openssl_wrapper.cpp +++ b/openssl_wrapper.cpp @@ -1,4 +1,3 @@ -#include #include #include @@ -22,8 +21,7 @@ std::array hmac_sha3_256(const std::vector& key, const std::vect char hmac[32]; unsigned int md_len; - std::unique_ptr md(EVP_MD_fetch(nullptr, "SHA3-256", nullptr), EVP_MD_free); - if (HMAC(md.get(), key.data(), static_cast(key.size()), reinterpret_cast(data.data()), data.size(), reinterpret_cast(hmac), &md_len)) { + if (HMAC(EVP_sha3_256(), key.data(), static_cast(key.size()), reinterpret_cast(data.data()), data.size(), reinterpret_cast(hmac), &md_len)) { if (md_len != 32) { throw std::runtime_error("hmac_sha3_256(): HMAC() returned an unexpected size"); }