From 0cffae90defdd65bb5089216a74d81ea5d3b5bbb Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Thu, 9 May 2024 10:50:45 +0200 Subject: [PATCH] use sha256 --- GWToolboxdll/Modules/Resources.cpp | 4 ++-- cmake/wolfssl.cmake | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/GWToolboxdll/Modules/Resources.cpp b/GWToolboxdll/Modules/Resources.cpp index e4b636baf..9bbe880cd 100644 --- a/GWToolboxdll/Modules/Resources.cpp +++ b/GWToolboxdll/Modules/Resources.cpp @@ -546,8 +546,8 @@ void Resources::Download(const std::string& url, AsyncLoadMbCallback callback, v const auto hash_name = [](const std::filesystem::path& file_name) -> std::filesystem::path { const auto str = file_name.string(); const auto bytes_to_hash = std::vector(str.begin(), str.end()); - auto hash = std::vector(WC_MD5_DIGEST_SIZE); - wc_Md5Hash(bytes_to_hash.data(), bytes_to_hash.size(), hash.data()); + auto hash = std::vector(WC_SHA256_DIGEST_SIZE); + wc_Sha256Hash(bytes_to_hash.data(), bytes_to_hash.size(), hash.data()); const auto hash_str = std::string(hash.begin(), hash.end()); const auto hash_file = std::filesystem::path(hash_str); return hash_file; diff --git a/cmake/wolfssl.cmake b/cmake/wolfssl.cmake index d7c6178db..0ff2504e7 100644 --- a/cmake/wolfssl.cmake +++ b/cmake/wolfssl.cmake @@ -9,6 +9,16 @@ target_compile_definitions(wolfssl INTERFACE ECC_TIMING_RESISTANT TFM_TIMING_RESISTANT WC_NO_RNG + OPENSSL_EXTRA + NO_OLD_TLS + NO_MD4 + NO_MD5 + NO_RSA + NO_RC4 + NO_PWDBASED + NO_AES_CBC + NO_DEV_URANDOM + WOLFSSL_SP_NO_3072 ) target_link_libraries(wolfssl INTERFACE "${wolfssl_FOLDER}/lib/wolfssl.lib")