Skip to content

Commit 7014506

Browse files
committed
Merge #9475: Let autoconf detect presence of EVP_MD_CTX_new
0388afe Let autoconf detect presence of EVP_MD_CTX_new (Luke Dashjr)
2 parents 7dac1e5 + 0388afe commit 7014506

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,13 @@ else
835835
fi
836836
fi
837837

838+
save_CXXFLAGS="${CXXFLAGS}"
839+
CXXFLAGS="${CXXFLAGS} ${CRYPTO_CFLAGS} ${SSL_CFLAGS}"
840+
AC_CHECK_DECLS([EVP_MD_CTX_new],,,[AC_INCLUDES_DEFAULT
841+
#include <openssl/x509_vfy.h>
842+
])
843+
CXXFLAGS="${save_CXXFLAGS}"
844+
838845
dnl univalue check
839846

840847
need_bundled_univalue=yes

src/qt/paymentrequestplus.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
159159
std::string data_to_verify; // Everything but the signature
160160
rcopy.SerializeToString(&data_to_verify);
161161

162-
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
162+
#if HAVE_DECL_EVP_MD_CTX_NEW
163163
EVP_MD_CTX *ctx = EVP_MD_CTX_new();
164164
if (!ctx) throw SSLVerifyError("Error allocating OpenSSL context.");
165165
#else
@@ -174,7 +174,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
174174
!EVP_VerifyFinal(ctx, (const unsigned char*)paymentRequest.signature().data(), (unsigned int)paymentRequest.signature().size(), pubkey)) {
175175
throw SSLVerifyError("Bad signature, invalid payment request.");
176176
}
177-
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
177+
#if HAVE_DECL_EVP_MD_CTX_NEW
178178
EVP_MD_CTX_free(ctx);
179179
#endif
180180

0 commit comments

Comments
 (0)