From 16b76456be8d00ca70715286906b7c482a158dc4 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 6 Nov 2017 12:22:18 +0100 Subject: QSsl: use QT_CONFIG(feature) instead of hardcoded constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test OPENSSL_VERSION_NUMBER >= 0x1010000000L was introduced before 1.1 support. Now a couple of conditional inclusions can be converted into QT_CONFIG(opensslv11). Task-number: QTBUG-64275 Change-Id: I627e6b06f334deac70c827e463ecbfad879dfc24 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Edward Welbourne --- src/network/ssl/qsslsocket_openssl_symbols.cpp | 2 +- src/network/ssl/qsslsocket_openssl_symbols_p.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 3a236a1300..1b73135935 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -1017,7 +1017,7 @@ bool q_resolveOpenSslSymbols() RESOLVEFUNC(EC_GROUP_get_degree) #endif RESOLVEFUNC(BN_num_bits) -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if QT_CONFIG(opensslv11) RESOLVEFUNC(BN_is_word) #endif RESOLVEFUNC(BN_mod_word) diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h index 796bf2d4f5..4cad0231cd 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols_p.h +++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h @@ -232,9 +232,10 @@ BIO *q_BIO_new_mem_buf(void *a, int b); int q_BIO_read(BIO *a, void *b, int c); Q_AUTOTEST_EXPORT int q_BIO_write(BIO *a, const void *b, int c); int q_BN_num_bits(const BIGNUM *a); -#if OPENSSL_VERSION_NUMBER >= 0x10100000L + +#if QT_CONFIG(opensslv11) int q_BN_is_word(BIGNUM *a, BN_ULONG w); -#else +#else // opensslv11 // BN_is_word is implemented purely as a // macro in OpenSSL < 1.1. It doesn't // call any functions. @@ -245,7 +246,8 @@ int q_BN_is_word(BIGNUM *a, BN_ULONG w); // // Users are required to include . #define q_BN_is_word BN_is_word -#endif // OPENSSL_VERSION_NUMBER >= 0x10100000L +#endif // !opensslv11 + BN_ULONG q_BN_mod_word(const BIGNUM *a, BN_ULONG w); #ifndef OPENSSL_NO_EC const EC_GROUP* q_EC_KEY_get0_group(const EC_KEY* k); -- cgit v1.2.3