diff options
| author | tobtoht <tob@featherwallet.org> | 2025-03-24 02:48:59 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2025-03-24 02:48:59 +0000 |
| commit | a510409cd3c1c95848d6ab592fc91cd49c63ceae (patch) | |
| tree | 75e6336c649b0aa0caca9eb778c6c5648c9a9629 /tests/unit_tests/http.cpp | |
| parent | f118605e670d6496d486ef7ef085e5a967a0d76e (diff) | |
| parent | 33e7943dfd5caf735f8996f05f2ea873b5c5046a (diff) | |
| download | monzero-core-a510409cd3c1c95848d6ab592fc91cd49c63ceae.tar.gz monzero-core-a510409cd3c1c95848d6ab592fc91cd49c63ceae.tar.xz monzero-core-a510409cd3c1c95848d6ab592fc91cd49c63ceae.zip | |
Merge pull request #9837
33e7943df epee: Drop unused in-tree MD5 (Bastian Germann)
fe1a10d70 Replace in-tree MD5 with OpenSSL (Bastian Germann)
Diffstat (limited to 'tests/unit_tests/http.cpp')
| -rw-r--r-- | tests/unit_tests/http.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/unit_tests/http.cpp b/tests/unit_tests/http.cpp index 60afe788e..f8eb0127b 100644 --- a/tests/unit_tests/http.cpp +++ b/tests/unit_tests/http.cpp @@ -53,12 +53,12 @@ #include <boost/spirit/include/qi_string.hpp> #include <cstdint> #include <iterator> +#include <openssl/evp.h> #include <string> #include <unordered_map> #include <utility> #include <vector> -#include "md5_l.h" #include "string_tools.h" #include "crypto/crypto.h" @@ -201,16 +201,16 @@ auth_responses parse_response(const http::http_response_info& response) std::string md5_hex(const std::string& in) { - md5::MD5_CTX ctx{}; - md5::MD5Init(std::addressof(ctx)); - md5::MD5Update( - std::addressof(ctx), + std::unique_ptr<EVP_MD_CTX, decltype(&EVP_MD_CTX_free)> ctx(EVP_MD_CTX_new(), &EVP_MD_CTX_free); + EVP_DigestInit(ctx.get(), EVP_md5()); + EVP_DigestUpdate( + ctx.get(), reinterpret_cast<const std::uint8_t*>(in.data()), in.size() ); std::array<std::uint8_t, 16> digest{{}}; - md5::MD5Final(digest.data(), std::addressof(ctx)); + EVP_DigestFinal(ctx.get(), digest.data(), NULL); return epee::string_tools::pod_to_hex(digest); } |
