From e790015147cf293078f2327a434ab081c0198dbc Mon Sep 17 00:00:00 2001 From: Rich Nistuk Date: Thu, 6 Sep 2018 16:39:21 -0700 Subject: [PATCH] fixing the openssl issue --- utils/crypto.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/crypto.cpp b/utils/crypto.cpp index e6963720..189f3e56 100644 --- a/utils/crypto.cpp +++ b/utils/crypto.cpp @@ -131,7 +131,9 @@ namespace RSA_verify_signature(const RSA* rsa, const std::vector& signature, const std::string& uuid, bool& is_authentic) { std::unique_ptr> public_key{EVP_PKEY_new(), EVP_PKEY_free}; -#ifdef __APPLE__ + // Versions of OpenSSL greater than 1.1 use new and free instead of create and destroy. + // TODO: This #if should be replaced with a better cmake OpenSSL functionality that enforces a minimum OpenSSL version. +#if (OPENSSL_VERSION_NUMBER < 0x1010000fL) std::unique_ptr> RSA_verification_context{EVP_MD_CTX_create(), EVP_MD_CTX_destroy}; #else std::unique_ptr> RSA_verification_context{EVP_MD_CTX_new(), EVP_MD_CTX_free};