You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/02/09 03:15:28 UTC

[GitHub] [trafficserver] maskit commented on a change in pull request #7447: Use OpenSSL EVP API instead of SHA1_Init/Update/Final (cache_promote)

maskit commented on a change in pull request #7447:
URL: https://github.com/apache/trafficserver/pull/7447#discussion_r572540396



##########
File path: plugins/cache_promote/lru_policy.h
##########
@@ -53,11 +55,12 @@ class LRUHash
   void
   init(char *data, int len)
   {
-    SHA_CTX sha;
+    EVP_MD_CTX *ctx = EVP_MD_CTX_new();

Review comment:
       EVP_Digest is basically just a wrapper and it uses heap too. If you worry about the heap allocation, we should keep the context object somewhere to reuse and that would require us to use these separated functions, I'm not sure if we can have a reusable context for this plugin though.
   
   For now I just added a line to set EVP_MD_CTX_FLAG_ONESHOT to minimize the difference from EVP_Digest, but I'm also ok with replacing the lines with EVP_Digest if you strongly think that is better.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org