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


##########
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:
   Should we set `ret_val.second` to a negative number to indicate an error? As 
it is, we are returning an empty string as the hash without any indication that 
something is wrong.



-- 
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