summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-09-03 11:50:30 +0100
committerTomas Mraz <tmraz@fedoraproject.org>2020-09-10 11:35:42 +0200
commit3101ab603cd82cdbc81de0902b2b4718e8f1279b (patch)
tree02647b1a149bc52bd9973534eac593dc0744fe74 /include
parentb830e0042972a237c6677c071f1fcde5c1afbea7 (diff)
Fix an EVP_MD_CTX leak
If we initialise an EVP_MD_CTX with a legacy MD, and then reuse the same EVP_MD_CTX with a provided MD then we end up leaking the md_data. We need to ensure we free the md_data if we change to a provided MD. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12779)
Diffstat (limited to 'include')
-rw-r--r--include/crypto/evp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/crypto/evp.h b/include/crypto/evp.h
index 9d9b0a7298..bdff97f639 100644
--- a/include/crypto/evp.h
+++ b/include/crypto/evp.h
@@ -808,3 +808,5 @@ int evp_pkey_ctx_use_cached_data(EVP_PKEY_CTX *ctx);
void evp_method_store_flush(OPENSSL_CTX *libctx);
int evp_set_default_properties_int(OPENSSL_CTX *libctx, const char *propq,
int loadconfig);
+
+void evp_md_ctx_clear_digest(EVP_MD_CTX *ctx, int force);