QSsl: use QT_CONFIG(feature) instead of hardcoded constant

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 <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Timur Pocheptsov 2017-11-06 12:22:18 +01:00
parent 14218b880a
commit 16b76456be
2 changed files with 6 additions and 4 deletions

View File

@ -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)

View File

@ -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 <openssl/bn.h>.
#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);