image_verify: Add support for OpenSSL 1.1.0
With OpenSSL 1.1.0, some of the functions were renamed, for
example EVP_MD_CTX_create() and EVP_MD_CTX_destroy() were
renamed to EVP_MD_CTX_new() and EVP_MD_CTX_free().
Reference: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes
Abstract them to support old and new APIs.
Resolves openbmc/openbmc#3137
Tested: Verified the signature verification was successful.
Change-Id: If8b3f185666c3db59567c4ee3bdfa168c501d3da
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/image_verify.cpp b/image_verify.cpp
index 388f489..475fbda 100644
--- a/image_verify.cpp
+++ b/image_verify.cpp
@@ -217,7 +217,7 @@
EVP_PKEY_assign_RSA(pKeyPtr.get(), publicRSA);
// Initializes a digest context.
- EVP_MD_CTX_Ptr rsaVerifyCtx(EVP_MD_CTX_create(), ::EVP_MD_CTX_destroy);
+ EVP_MD_CTX_Ptr rsaVerifyCtx(EVP_MD_CTX_new(), ::EVP_MD_CTX_free);
// Adds all digest algorithms to the internal table
OpenSSL_add_all_digests();