From 35f3f7aad9cd4e6eff6a1d3e9abc7c2e9ae178a1 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 5 Jan 2017 10:26:42 +0100 Subject: [PATCH] Merge #9475: Let autoconf detect presence of EVP_MD_CTX_new 0388afe Let autoconf detect presence of EVP_MD_CTX_new (Luke Dashjr) --- configure.ac | 7 +++++++ src/qt/paymentrequestplus.cpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 597a202448..40607a5535 100644 --- a/configure.ac +++ b/configure.ac @@ -836,6 +836,13 @@ else fi fi +save_CXXFLAGS="${CXXFLAGS}" +CXXFLAGS="${CXXFLAGS} ${CRYPTO_CFLAGS} ${SSL_CFLAGS}" +AC_CHECK_DECLS([EVP_MD_CTX_new],,,[AC_INCLUDES_DEFAULT +#include +]) +CXXFLAGS="${save_CXXFLAGS}" + dnl univalue check need_bundled_univalue=yes diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp index 39484f02e5..5230001445 100644 --- a/src/qt/paymentrequestplus.cpp +++ b/src/qt/paymentrequestplus.cpp @@ -159,7 +159,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c std::string data_to_verify; // Everything but the signature rcopy.SerializeToString(&data_to_verify); -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if HAVE_DECL_EVP_MD_CTX_NEW EVP_MD_CTX *ctx = EVP_MD_CTX_new(); if (!ctx) throw SSLVerifyError("Error allocating OpenSSL context."); #else @@ -177,7 +177,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c throw SSLVerifyError("Bad signature, invalid payment request."); } -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if HAVE_DECL_EVP_MD_CTX_NEW EVP_MD_CTX_free(ctx); #endif