lordgamez commented on code in PR #1949:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1949#discussion_r2016460012


##########
extensions/standard-processors/processors/HashContent.h:
##########
@@ -51,10 +51,15 @@ namespace { // NOLINT
     ret_val.second = 0;
     std::array<std::byte, HASH_BUFFER_SIZE> buffer{};
     EVP_MD_CTX *context = EVP_MD_CTX_new();
-    const auto guard = gsl::finally([&context]() {
+    EVP_MD *md5 = EVP_MD_fetch(nullptr, "MD5", "-fips");
+    const auto guard = gsl::finally([&context, &md5]() {
+      EVP_MD_free(md5);
       EVP_MD_CTX_free(context);
     });
-    EVP_DigestInit_ex(context, EVP_md5(), nullptr);
+    if (!md5) {
+      return ret_val;

Review Comment:
   I think currently it's the same case for other error cases as well like when 
`session.read` fails, it also returns an empty string for the hash for all 
hashing algorithms. We can revise the error handling for the hashing overall to 
indicate the error better, but I think that's out of the scope of this PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to