summaryrefslogtreecommitdiffstats
path: root/utils.hpp
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-09-06 13:15:34 -0500
committerAdriana Kobylak <anoo@us.ibm.com>2018-09-11 10:26:46 -0500
commit5ed9b2d7b6b4bd21d2a1200537e881e485d13cc9 (patch)
treec459ed3cb51c97136010e8396db1f9612f3ab489 /utils.hpp
parentfa34e02315bd1397180daaa3377bcb38d7f30d7a (diff)
downloadphosphor-bmc-code-mgmt-5ed9b2d7b6b4bd21d2a1200537e881e485d13cc9.tar.gz
phosphor-bmc-code-mgmt-5ed9b2d7b6b4bd21d2a1200537e881e485d13cc9.zip
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#3136 Tested: Verified the signature verification was successful. Change-Id: I2297243fdd652055fe9ea88f26eb2dcf473d24e6 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'utils.hpp')
-rw-r--r--utils.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/utils.hpp b/utils.hpp
new file mode 100644
index 0000000..90569bf
--- /dev/null
+++ b/utils.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+// With OpenSSL 1.1.0, some functions were deprecated. Need to abstract them
+// to make the code backward compatible with older OpenSSL veresions.
+// Reference: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+
+#include <openssl/evp.h>
+
+extern "C" {
+EVP_MD_CTX* EVP_MD_CTX_new(void);
+void EVP_MD_CTX_free(EVP_MD_CTX* ctx);
+}
+
+#endif // OPENSSL_VERSION_NUMBER < 0x10100000L
OpenPOWER on IntegriCloud