scrypt: free the MD reference correctly.
authorPauli <paul.dale@oracle.com>
Wed, 29 Jan 2020 23:04:14 +0000 (09:04 +1000)
committerPauli <paul.dale@oracle.com>
Fri, 31 Jan 2020 07:52:05 +0000 (17:52 +1000)
The code was calling EVP_MD_meth_free which is incorrect.  It should call
EVP_MD_free.  It happened to work but by luck rather than design.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10973)

providers/implementations/kdfs/scrypt.c

index 425db1af6f2907e7c1b3669332f7248b6ee74eac..ea859b91507ee414e0ba7bb69f8c7f9767687eef 100644 (file)
@@ -75,7 +75,7 @@ static void kdf_scrypt_free(void *vctx)
     KDF_SCRYPT *ctx = (KDF_SCRYPT *)vctx;
 
     if (ctx != NULL) {
-        EVP_MD_meth_free(ctx->sha256);
+        EVP_MD_free(ctx->sha256);
         kdf_scrypt_reset(ctx);
         OPENSSL_free(ctx);
     }