[lxc-devel] [lxc/master] Ensures OpenSSL compatibility with older versions of EVP API.

caioboffo on Github lxc-bot at linuxcontainers.org
Mon Sep 16 17:42:52 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 351 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190916/8a19cd32/attachment.bin>
-------------- next part --------------
From b138bfcfd16c96c27fe7a535b093c34278b1506f Mon Sep 17 00:00:00 2001
From: "Caio B. Silva" <caioboffo at gmail.com>
Date: Mon, 16 Sep 2019 14:22:33 -0300
Subject: [PATCH] Ensures OpenSSL compatibility with older versions of EVP API.

Signed-off-by: Caio B. Silva <caioboffo at gmail.com>
---
 src/lxc/utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/utils.c b/src/lxc/utils.c
index bf4a9c2cbd..1fe05d3b94 100644
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -344,11 +344,11 @@ static int do_sha1_hash(const char *buf, int buflen, unsigned char *md_value, in
 		return -1;
 	}
 
-	mdctx = EVP_MD_CTX_new();
+	mdctx = EVP_MD_CTX_create();
 	EVP_DigestInit_ex(mdctx, md, NULL);
 	EVP_DigestUpdate(mdctx, buf, buflen);
 	EVP_DigestFinal_ex(mdctx, md_value, md_len);
-	EVP_MD_CTX_free(mdctx);
+	EVP_MD_CTX_destroy(mdctx);
 
 	return 0;
 }


More information about the lxc-devel mailing list