[openssl] master update

Matt Caswell matt at openssl.org
Thu Jan 13 12:05:20 UTC 2022


The branch master has been updated
       via  8086b267fb3395c53cd5fc29eea68ba4826b333d (commit)
      from  3d4d5305c292f5db62b4abf732f6682b2ada6f44 (commit)


- Log -----------------------------------------------------------------
commit 8086b267fb3395c53cd5fc29eea68ba4826b333d
Author: Matt Caswell <matt at openssl.org>
Date:   Tue Jan 11 17:13:39 2022 +0000

    Clear md_data only when necessary
    
    PR #17255 fixed a bug in EVP_DigestInit_ex(). While backporting the PR
    to 1.1.1 (see #17472) I spotted an error in the original patch. This fixes
    it.
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17473)

-----------------------------------------------------------------------

Summary of changes:
 crypto/evp/digest.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c
index cdcb60092e..d4685e6489 100644
--- a/crypto/evp/digest.c
+++ b/crypto/evp/digest.c
@@ -33,9 +33,10 @@ static void cleanup_old_md_data(EVP_MD_CTX *ctx, int force)
             ctx->digest->cleanup(ctx);
         if (ctx->md_data != NULL && ctx->digest->ctx_size > 0
                 && (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE)
-                    || force))
+                    || force)) {
             OPENSSL_clear_free(ctx->md_data, ctx->digest->ctx_size);
-        ctx->md_data = NULL;
+            ctx->md_data = NULL;
+        }
     }
 }
 


More information about the openssl-commits mailing list