Kevin Kofler dc6c77
diff -ur qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslcertificate.cpp qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslcertificate.cpp
Kevin Kofler dc6c77
--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslcertificate.cpp	2015-05-07 16:14:44.000000000 +0200
Kevin Kofler 56ab7a
+++ qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslcertificate.cpp	2018-01-05 17:44:16.997588265 +0100
Kevin Kofler dc6c77
@@ -259,10 +259,10 @@
Kevin Kofler d749d0
 QByteArray QSslCertificate::version() const
Kevin Kofler d749d0
 {
Kevin Kofler d749d0
     QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));
Kevin Kofler d749d0
-    if (d->versionString.isEmpty() && d->x509)
Kevin Kofler d749d0
+    if (d->versionString.isEmpty() && d->x509) {
Kevin Kofler d749d0
         d->versionString =
Kevin Kofler d749d0
-            QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1);
Kevin Kofler d749d0
-
Kevin Kofler d749d0
+	    QByteArray::number(qlonglong(q_X509_get_version(d->x509)) + 1);
Kevin Kofler d749d0
+    }
Kevin Kofler d749d0
     return d->versionString;
Kevin Kofler d749d0
 }
Kevin Kofler d749d0
 
Kevin Kofler dc6c77
@@ -276,7 +276,7 @@
Kevin Kofler d749d0
 {
Kevin Kofler d749d0
     QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));
Kevin Kofler d749d0
     if (d->serialNumberString.isEmpty() && d->x509) {
Kevin Kofler d749d0
-        ASN1_INTEGER *serialNumber = d->x509->cert_info->serialNumber;
Kevin Kofler d749d0
+        ASN1_INTEGER *serialNumber = q_X509_get_serialNumber(d->x509);
Kevin Kofler d749d0
         // if we cannot convert to a long, just output the hexadecimal number
Kevin Kofler d749d0
         if (serialNumber->length > 4) {
Kevin Kofler d749d0
             QByteArray hexString;
Kevin Kofler dc6c77
@@ -489,24 +489,33 @@
Kevin Kofler d749d0
     QSslKey key;
Kevin Kofler d749d0
 
Kevin Kofler d749d0
     key.d->type = QSsl::PublicKey;
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     X509_PUBKEY *xkey = d->x509->cert_info->key;
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    X509_PUBKEY *xkey = q_X509_get_X509_PUBKEY(d->x509);
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     EVP_PKEY *pkey = q_X509_PUBKEY_get(xkey);
Kevin Kofler d749d0
     Q_ASSERT(pkey);
Kevin Kofler d749d0
 
Kevin Kofler d749d0
-    if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_RSA) {
Kevin Kofler d749d0
+    int key_id;
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
+    key_id = q_EVP_PKEY_type(pkey->type);
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    key_id = q_EVP_PKEY_base_id(pkey);
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
+    if (key_id == EVP_PKEY_RSA) {
Kevin Kofler d749d0
         key.d->rsa = q_EVP_PKEY_get1_RSA(pkey);
Kevin Kofler d749d0
         key.d->algorithm = QSsl::Rsa;
Kevin Kofler d749d0
         key.d->isNull = false;
Kevin Kofler d749d0
-    } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA) {
Kevin Kofler d749d0
+    } else if (key_id == EVP_PKEY_DSA) {
Kevin Kofler d749d0
         key.d->dsa = q_EVP_PKEY_get1_DSA(pkey);
Kevin Kofler d749d0
         key.d->algorithm = QSsl::Dsa;
Kevin Kofler d749d0
         key.d->isNull = false;
Kevin Kofler d749d0
-    } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DH) {
Kevin Kofler d749d0
+    } else if (key_id == EVP_PKEY_DH) {
Kevin Kofler d749d0
         // DH unsupported
Kevin Kofler d749d0
     } else {
Kevin Kofler d749d0
         // error?
Kevin Kofler d749d0
     }
Kevin Kofler d749d0
-
Kevin Kofler d749d0
     q_EVP_PKEY_free(pkey);
Kevin Kofler d749d0
     return key;
Kevin Kofler d749d0
 }
Kevin Kofler 56ab7a
@@ -687,7 +696,11 @@
Kevin Kofler 56ab7a
         unsigned char *data = 0;
Kevin Kofler 56ab7a
         int size = q_ASN1_STRING_to_UTF8(&data, q_X509_NAME_ENTRY_get_data(e));
Kevin Kofler 56ab7a
         info[QString::fromUtf8(obj)] = QString::fromUtf8((char*)data, size);
Kevin Kofler 56ab7a
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler 56ab7a
         q_CRYPTO_free(data);
Kevin Kofler 56ab7a
+#else
Kevin Kofler 56ab7a
+        q_CRYPTO_free(data, __FILE__, __LINE__);
Kevin Kofler 56ab7a
+#endif
Kevin Kofler 56ab7a
     }
Kevin Kofler 56ab7a
     return info;
Kevin Kofler 56ab7a
 }
Kevin Kofler dc6c77
diff -ur qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslkey.cpp qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslkey.cpp
Kevin Kofler dc6c77
--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslkey.cpp	2015-05-07 16:14:44.000000000 +0200
Kevin Kofler 56ab7a
+++ qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslkey.cpp	2018-01-05 18:00:27.453937599 +0100
Kevin Kofler dc6c77
@@ -321,8 +321,19 @@
Kevin Kofler d749d0
 {
Kevin Kofler d749d0
     if (d->isNull)
Kevin Kofler d749d0
         return -1;
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     return (d->algorithm == QSsl::Rsa)
Kevin Kofler d749d0
            ? q_BN_num_bits(d->rsa->n) : q_BN_num_bits(d->dsa->p);
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    if (d->algorithm == QSsl::Rsa) {
Kevin Kofler d749d0
+        return q_RSA_bits(d->rsa);
Kevin Kofler 56ab7a
+    } else {
Kevin Kofler 56ab7a
+        const BIGNUM *p = (const BIGNUM *) NULL;
Kevin Kofler 56ab7a
+        q_DSA_get0_pqg(d->dsa, &p, (const BIGNUM **) NULL, (const BIGNUM **) NULL);
Kevin Kofler 56ab7a
+        return q_BN_num_bits(p);
Kevin Kofler d749d0
+    }
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
+
Kevin Kofler d749d0
 }
Kevin Kofler d749d0
 
Kevin Kofler d749d0
 /*!
Kevin Kofler dc6c77
diff -ur qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl.cpp qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslsocket_openssl.cpp
Kevin Kofler dc6c77
--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl.cpp	2015-05-07 16:14:44.000000000 +0200
Kevin Kofler dc6c77
+++ qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslsocket_openssl.cpp	2018-01-05 12:06:06.336990956 +0100
Kevin Kofler dc6c77
@@ -93,6 +93,7 @@
Kevin Kofler d749d0
 bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
Kevin Kofler d749d0
 bool QSslSocketPrivate::s_loadRootCertsOnDemand = false;
Kevin Kofler d749d0
 
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
 /* \internal
Kevin Kofler d749d0
 
Kevin Kofler d749d0
     From OpenSSL's thread(3) manual page:
Kevin Kofler dc6c77
@@ -174,6 +175,8 @@
Kevin Kofler d749d0
 }
Kevin Kofler d749d0
 } // extern "C"
Kevin Kofler d749d0
 
Kevin Kofler d749d0
+#endif //OPENSSL_VERSION_NUMBER >= 0x10100000L
Kevin Kofler d749d0
+
Kevin Kofler d749d0
 QSslSocketBackendPrivate::QSslSocketBackendPrivate()
Kevin Kofler d749d0
     : ssl(0),
Kevin Kofler d749d0
       ctx(0),
Kevin Kofler dc6c77
@@ -222,9 +225,12 @@
Kevin Kofler d749d0
             ciph.d->encryptionMethod = descriptionList.at(4).mid(4);
Kevin Kofler d749d0
         ciph.d->exportable = (descriptionList.size() > 6 && descriptionList.at(6) == QLatin1String("export"));
Kevin Kofler d749d0
 
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
         ciph.d->bits = cipher->strength_bits;
Kevin Kofler d749d0
         ciph.d->supportedBits = cipher->alg_bits;
Kevin Kofler d749d0
-
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+	ciph.d->bits = q_SSL_CIPHER_get_bits(cipher, &ciph.d->supportedBits);
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     }
Kevin Kofler d749d0
     return ciph;
Kevin Kofler d749d0
 }
Kevin Kofler dc6c77
@@ -363,7 +369,7 @@
Kevin Kofler d749d0
         //
Kevin Kofler d749d0
         // See also: QSslContext::fromConfiguration()
Kevin Kofler d749d0
         if (caCertificate.expiryDate() >= QDateTime::currentDateTime()) {
Kevin Kofler d749d0
-            q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle());
Kevin Kofler d749d0
+	  q_X509_STORE_add_cert(q_SSL_CTX_get_cert_store(ctx), (X509 *)caCertificate.handle());
Kevin Kofler d749d0
         }
Kevin Kofler d749d0
     }
Kevin Kofler d749d0
 
Kevin Kofler dc6c77
@@ -500,8 +506,10 @@
Kevin Kofler d749d0
 */
Kevin Kofler d749d0
 void QSslSocketPrivate::deinitialize()
Kevin Kofler d749d0
 {
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     q_CRYPTO_set_id_callback(0);
Kevin Kofler d749d0
     q_CRYPTO_set_locking_callback(0);
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
 }
Kevin Kofler d749d0
 
Kevin Kofler d749d0
 /*!
Kevin Kofler dc6c77
@@ -522,13 +530,17 @@
Kevin Kofler d749d0
         return false;
Kevin Kofler d749d0
 
Kevin Kofler d749d0
     // Check if the library itself needs to be initialized.
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     QMutexLocker locker(openssl_locks()->initLock());
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     if (!s_libraryLoaded) {
Kevin Kofler d749d0
         s_libraryLoaded = true;
Kevin Kofler d749d0
 
Kevin Kofler d749d0
         // Initialize OpenSSL.
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
         q_CRYPTO_set_id_callback(id_function);
Kevin Kofler d749d0
         q_CRYPTO_set_locking_callback(locking_function);
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
         if (q_SSL_library_init() != 1)
Kevin Kofler d749d0
             return false;
Kevin Kofler d749d0
         q_SSL_load_error_strings();
Kevin Kofler dc6c77
@@ -567,7 +579,9 @@
Kevin Kofler d749d0
 
Kevin Kofler d749d0
 void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
Kevin Kofler d749d0
 {
Kevin Kofler d749d0
-    QMutexLocker locker(openssl_locks()->initLock());
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
+  QMutexLocker locker(openssl_locks()->initLock());
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     if (s_loadedCiphersAndCerts)
Kevin Kofler d749d0
         return;
Kevin Kofler d749d0
     s_loadedCiphersAndCerts = true;
Kevin Kofler dc6c77
@@ -659,13 +673,18 @@
Kevin Kofler d749d0
     STACK_OF(SSL_CIPHER) *supportedCiphers = q_SSL_get_ciphers(mySsl);
Kevin Kofler d749d0
     for (int i = 0; i < q_sk_SSL_CIPHER_num(supportedCiphers); ++i) {
Kevin Kofler d749d0
         if (SSL_CIPHER *cipher = q_sk_SSL_CIPHER_value(supportedCiphers, i)) {
Kevin Kofler d749d0
-            if (cipher->valid) {
Kevin Kofler d749d0
+
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
+	  if (cipher->valid) {
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
                 QSslCipher ciph = QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(cipher);
Kevin Kofler d749d0
                 if (!ciph.isNull()) {
Kevin Kofler d749d0
                     if (!ciph.name().toLower().startsWith(QLatin1String("adh")))
Kevin Kofler d749d0
                         ciphers << ciph;
Kevin Kofler d749d0
                 }
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
             }
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
         }
Kevin Kofler d749d0
     }
Kevin Kofler d749d0
 
Kevin Kofler dc6c77
diff -ur qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_p.h qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslsocket_openssl_p.h
Kevin Kofler dc6c77
--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_p.h	2015-05-07 16:14:44.000000000 +0200
Kevin Kofler dc6c77
+++ qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslsocket_openssl_p.h	2018-01-05 12:06:06.337990940 +0100
Kevin Kofler dc6c77
@@ -84,6 +84,10 @@
Kevin Kofler dc6c77
 #include <openssl/tls1.h>
Kevin Kofler d749d0
 #endif
Kevin Kofler d749d0
 
Kevin Kofler dc6c77
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
Kevin Kofler dc6c77
+#define OPENSSL_NO_SSL2
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
+
Kevin Kofler dc6c77
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
Kevin Kofler dc6c77
 typedef _STACK STACK;
Kevin Kofler d749d0
 #endif
Kevin Kofler dc6c77
diff -ur qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_symbols.cpp qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslsocket_openssl_symbols.cpp
Kevin Kofler dc6c77
--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_symbols.cpp	2015-05-07 16:14:44.000000000 +0200
Kevin Kofler 56ab7a
+++ qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslsocket_openssl_symbols.cpp	2018-01-05 17:59:10.636973932 +0100
Kevin Kofler 56ab7a
@@ -111,16 +111,30 @@
Kevin Kofler 56ab7a
 DEFINEFUNC2(int, ASN1_STRING_to_UTF8, unsigned char **a, a, ASN1_STRING *b, b, return 0, return);
Kevin Kofler 56ab7a
 DEFINEFUNC4(long, BIO_ctrl, BIO *a, a, int b, b, long c, c, void *d, d, return -1, return)
Kevin Kofler 56ab7a
 DEFINEFUNC(int, BIO_free, BIO *a, a, return 0, return)
Kevin Kofler 56ab7a
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler 56ab7a
 DEFINEFUNC(BIO *, BIO_new, BIO_METHOD *a, a, return 0, return)
Kevin Kofler 56ab7a
+#else
Kevin Kofler 56ab7a
+DEFINEFUNC(BIO *, BIO_new, const BIO_METHOD *a, a, return 0, return)
Kevin Kofler 56ab7a
+#endif
Kevin Kofler 56ab7a
 DEFINEFUNC2(BIO *, BIO_new_mem_buf, void *a, a, int b, b, return 0, return)
Kevin Kofler 56ab7a
 DEFINEFUNC3(int, BIO_read, BIO *a, a, void *b, b, int c, c, return -1, return)
Kevin Kofler 56ab7a
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
 DEFINEFUNC(BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return)
Kevin Kofler 56ab7a
+#else
Kevin Kofler 56ab7a
+DEFINEFUNC(const BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return)
Kevin Kofler 56ab7a
+#endif
Kevin Kofler d749d0
 DEFINEFUNC3(int, BIO_write, BIO *a, a, const void *b, b, int c, c, return -1, return)
Kevin Kofler d749d0
 DEFINEFUNC(int, BN_num_bits, const BIGNUM *a, a, return 0, return)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
 DEFINEFUNC(int, CRYPTO_num_locks, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
 DEFINEFUNC(void, CRYPTO_set_locking_callback, void (*a)(int, int, const char *, int), a, return, DUMMYARG)
Kevin Kofler d749d0
 DEFINEFUNC(void, CRYPTO_set_id_callback, unsigned long (*a)(), a, return, DUMMYARG)
Kevin Kofler d749d0
+#endif
Kevin Kofler 56ab7a
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
 DEFINEFUNC(void, CRYPTO_free, void *a, a, return, DUMMYARG)
Kevin Kofler 56ab7a
+#else
Kevin Kofler 56ab7a
+DEFINEFUNC3(void, CRYPTO_free, void *a, a, const char *b, b, int c, c, return, DUMMYARG)
Kevin Kofler 56ab7a
+#endif
Kevin Kofler d749d0
 DEFINEFUNC(void, DSA_free, DSA *a, a, return, DUMMYARG)
Kevin Kofler d749d0
 #if  OPENSSL_VERSION_NUMBER < 0x00908000L
Kevin Kofler 56ab7a
 DEFINEFUNC3(X509 *, d2i_X509, X509 **a, a, unsigned char **b, b, long c, c, return 0, return)
Kevin Kofler 56ab7a
@@ -157,6 +171,7 @@
Kevin Kofler d749d0
 DEFINEFUNC2(void, RAND_seed, const void *a, a, int b, b, return, DUMMYARG)
Kevin Kofler d749d0
 DEFINEFUNC(int, RAND_status, void, DUMMYARG, return -1, return)
Kevin Kofler d749d0
 DEFINEFUNC(void, RSA_free, RSA *a, a, return, DUMMYARG)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
 DEFINEFUNC(int, sk_num, STACK *a, a, return -1, return)
Kevin Kofler d749d0
 DEFINEFUNC2(void, sk_pop_free, STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
Kevin Kofler d749d0
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
Kevin Kofler 56ab7a
@@ -166,6 +181,12 @@
Kevin Kofler d749d0
 DEFINEFUNC(void, sk_free, STACK *a, a, return, DUMMYARG)
Kevin Kofler d749d0
 DEFINEFUNC2(char *, sk_value, STACK *a, a, int b, b, return 0, return)
Kevin Kofler d749d0
 #endif
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+DEFINEFUNC(int, OPENSSL_sk_num, STACK *a, a, return -1, return)
Kevin Kofler d749d0
+DEFINEFUNC2(void, OPENSSL_sk_pop_free, STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
Kevin Kofler d749d0
+DEFINEFUNC(void, OPENSSL_sk_free, _STACK *a, a, return, DUMMYARG)
Kevin Kofler d749d0
+DEFINEFUNC2(void *, OPENSSL_sk_value, STACK *a, a, int b, b, return 0, return)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
 DEFINEFUNC(int, SSL_accept, SSL *a, a, return -1, return)
Kevin Kofler d749d0
 DEFINEFUNC(int, SSL_clear, SSL *a, a, return -1, return)
Kevin Kofler d749d0
 DEFINEFUNC3(char *, SSL_CIPHER_description, SSL_CIPHER *a, a, char *b, b, int c, c, return 0, return)
Kevin Kofler 56ab7a
@@ -213,8 +234,12 @@
Kevin Kofler d749d0
 #else
Kevin Kofler d749d0
 DEFINEFUNC(long, SSL_get_verify_result, SSL *a, a, return -1, return)
Kevin Kofler d749d0
 #endif
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
 DEFINEFUNC(int, SSL_library_init, void, DUMMYARG, return -1, return)
Kevin Kofler d749d0
 DEFINEFUNC(void, SSL_load_error_strings, void, DUMMYARG, return, DUMMYARG)
Kevin Kofler d749d0
+#else
Kevin Kofler 56ab7a
+DEFINEFUNC2(int, OPENSSL_init_ssl, uint64_t opts, opts, const OPENSSL_INIT_SETTINGS *settings, settings, return -1, return)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
 DEFINEFUNC(SSL *, SSL_new, SSL_CTX *a, a, return 0, return)
Kevin Kofler d749d0
 #if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
Kevin Kofler d749d0
 DEFINEFUNC4(long, SSL_ctrl, SSL *a, a, int cmd, cmd, long larg, larg, void *parg, parg, return -1, return)
Kevin Kofler 56ab7a
@@ -229,13 +254,21 @@
Kevin Kofler dc6c77
 DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
 #endif
Kevin Kofler dc6c77
 DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
 DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+DEFINEFUNC(const SSL_METHOD *, TLS_client_method, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
 DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
 #ifndef OPENSSL_NO_SSL2
Kevin Kofler d749d0
 DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
 #endif
Kevin Kofler dc6c77
 DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
 DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+DEFINEFUNC(const SSL_METHOD *, TLS_server_method, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
 DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
 #else
Kevin Kofler d749d0
 DEFINEFUNC(SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler 56ab7a
@@ -274,7 +307,11 @@
Kevin Kofler d749d0
 DEFINEFUNC(int, X509_STORE_CTX_get_error, X509_STORE_CTX *a, a, return -1, return)
Kevin Kofler d749d0
 DEFINEFUNC(int, X509_STORE_CTX_get_error_depth, X509_STORE_CTX *a, a, return -1, return)
Kevin Kofler d749d0
 DEFINEFUNC(X509 *, X509_STORE_CTX_get_current_cert, X509_STORE_CTX *a, a, return 0, return)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
 DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get_chain, X509_STORE_CTX *a, a, return 0, return)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get0_chain, X509_STORE_CTX *a, a, return 0, return)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
 DEFINEFUNC(X509_STORE_CTX *, X509_STORE_CTX_new, DUMMYARG, DUMMYARG, return 0, return)
Kevin Kofler d749d0
 #ifdef SSLEAY_MACROS
Kevin Kofler d749d0
 DEFINEFUNC2(int, i2d_DSAPrivateKey, const DSA *a, a, unsigned char **b, b, return -1, return)
Kevin Kofler 56ab7a
@@ -282,10 +319,34 @@
Kevin Kofler d749d0
 DEFINEFUNC3(RSA *, d2i_RSAPrivateKey, RSA **a, a, unsigned char **b, b, long c, c, return 0, return)
Kevin Kofler d749d0
 DEFINEFUNC3(DSA *, d2i_DSAPrivateKey, DSA **a, a, unsigned char **b, b, long c, c, return 0, return)
Kevin Kofler d749d0
 #endif
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
 DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMMYARG)
Kevin Kofler d749d0
 DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG)
Kevin Kofler d749d0
+#else
Kevin Kofler 56ab7a
+DEFINEFUNC2(int, OPENSSL_init_crypto, uint64_t opts, opts, const OPENSSL_INIT_SETTINGS *settings, settings, return -1, return)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
 DEFINEFUNC3(int, SSL_CTX_load_verify_locations, SSL_CTX *ctx, ctx, const char *CAfile, CAfile, const char *CApath, CApath, return 0, return)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
 DEFINEFUNC(long, SSLeay, void, DUMMYARG, return 0, return)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+DEFINEFUNC(unsigned long, OpenSSL_version_num, void, DUMMYARG, return 0, return)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
+DEFINEFUNC(X509_STORE *, SSL_CTX_get_cert_store, const SSL_CTX *ctx, ctx, return 0, return)
Kevin Kofler d749d0
+
Kevin Kofler d749d0
+DEFINEFUNC(ASN1_INTEGER *, X509_get_serialNumber, X509 *x, x, return 0, return)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
Kevin Kofler d749d0
+DEFINEFUNC(int, EVP_PKEY_id, const EVP_PKEY *pkey, pkey, return 0, return)
Kevin Kofler d749d0
+DEFINEFUNC(int, EVP_PKEY_base_id, const EVP_PKEY *pkey, pkey, return 0, return)
Kevin Kofler d749d0
+DEFINEFUNC2(int, SSL_CIPHER_get_bits, const SSL_CIPHER *cipher, cipher, int *alg_bits, alg_bits, return 0, return)
Kevin Kofler d749d0
+DEFINEFUNC2(long, SSL_CTX_set_options, SSL_CTX *ctx, ctx, long options, options, return 0, return)
Kevin Kofler d749d0
+DEFINEFUNC(long, X509_get_version, X509 *x, x, return 0, return)
Kevin Kofler d749d0
+DEFINEFUNC(X509_PUBKEY *, X509_get_X509_PUBKEY, X509 *x, x, return 0, return)
Kevin Kofler d749d0
+DEFINEFUNC(int, RSA_bits,  const RSA *rsa, rsa, return 0, return)
Kevin Kofler d749d0
+DEFINEFUNC(int, DSA_security_bits, const DSA *dsa, dsa, return 0, return)
Kevin Kofler d749d0
+DEFINEFUNC(ASN1_TIME *, X509_getm_notAfter, X509 *x, x, return 0, return)
Kevin Kofler d749d0
+DEFINEFUNC(ASN1_TIME *, X509_getm_notBefore, X509 *x, x, return 0, return)
Kevin Kofler 56ab7a
+DEFINEFUNC4(void, DSA_get0_pqg, const DSA *d, d, const BIGNUM **p, p, const BIGNUM **q, q, const BIGNUM **g, g, return, return)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
 
Kevin Kofler d749d0
 #ifdef Q_OS_SYMBIAN
Kevin Kofler d749d0
 #define RESOLVEFUNC(func, ordinal, lib) \
Kevin Kofler 56ab7a
@@ -580,7 +641,11 @@
Kevin Kofler d749d0
     static volatile bool symbolsResolved = false;
Kevin Kofler d749d0
     static volatile bool triedToResolveSymbols = false;
Kevin Kofler d749d0
 #ifndef QT_NO_THREAD
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_SSL_library_init));
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_OPENSSL_init_ssl));
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
 #endif
Kevin Kofler d749d0
     if (symbolsResolved)
Kevin Kofler d749d0
         return true;
Kevin Kofler 56ab7a
@@ -614,9 +679,11 @@
Kevin Kofler d749d0
     RESOLVEFUNC(BIO_write, 269, libs.second )
Kevin Kofler d749d0
     RESOLVEFUNC(BN_num_bits, 387, libs.second )
Kevin Kofler d749d0
     RESOLVEFUNC(CRYPTO_free, 469, libs.second )
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     RESOLVEFUNC(CRYPTO_num_locks, 500, libs.second )
Kevin Kofler d749d0
     RESOLVEFUNC(CRYPTO_set_id_callback, 513, libs.second )
Kevin Kofler d749d0
     RESOLVEFUNC(CRYPTO_set_locking_callback, 516, libs.second )
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     RESOLVEFUNC(DSA_free, 594, libs.second )
Kevin Kofler d749d0
     RESOLVEFUNC(ERR_error_string, 744, libs.second )
Kevin Kofler d749d0
     RESOLVEFUNC(ERR_get_error, 749, libs.second )
Kevin Kofler 56ab7a
@@ -674,8 +741,10 @@
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_get_peer_cert_chain, 117, libs.first )
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_get_peer_certificate, 118, libs.first )
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_get_verify_result, 132, libs.first )
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_library_init, 137, libs.first )
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_load_error_strings, 139, libs.first )
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_new, 140, libs.first )
Kevin Kofler d749d0
 #if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_ctrl, 95, libs.first )
Kevin Kofler 56ab7a
@@ -747,9 +816,11 @@
Kevin Kofler d749d0
     RESOLVEFUNC(BIO_write)
Kevin Kofler d749d0
     RESOLVEFUNC(BN_num_bits)
Kevin Kofler d749d0
     RESOLVEFUNC(CRYPTO_free)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     RESOLVEFUNC(CRYPTO_num_locks)
Kevin Kofler d749d0
     RESOLVEFUNC(CRYPTO_set_id_callback)
Kevin Kofler d749d0
     RESOLVEFUNC(CRYPTO_set_locking_callback)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     RESOLVEFUNC(DSA_free)
Kevin Kofler d749d0
     RESOLVEFUNC(ERR_error_string)
Kevin Kofler d749d0
     RESOLVEFUNC(ERR_get_error)
Kevin Kofler 56ab7a
@@ -779,10 +850,17 @@
Kevin Kofler d749d0
     RESOLVEFUNC(RAND_seed)
Kevin Kofler d749d0
     RESOLVEFUNC(RAND_status)
Kevin Kofler d749d0
     RESOLVEFUNC(RSA_free)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     RESOLVEFUNC(sk_free)
Kevin Kofler d749d0
     RESOLVEFUNC(sk_num)
Kevin Kofler d749d0
     RESOLVEFUNC(sk_pop_free)
Kevin Kofler d749d0
     RESOLVEFUNC(sk_value)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    RESOLVEFUNC(OPENSSL_sk_free)
Kevin Kofler d749d0
+    RESOLVEFUNC(OPENSSL_sk_num)
Kevin Kofler d749d0
+    RESOLVEFUNC(OPENSSL_sk_pop_free)
Kevin Kofler d749d0
+    RESOLVEFUNC(OPENSSL_sk_value)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_CIPHER_description)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_CTX_check_private_key)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_CTX_ctrl)
Kevin Kofler 56ab7a
@@ -797,6 +875,7 @@
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_CTX_use_PrivateKey)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_CTX_use_RSAPrivateKey)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_CTX_use_PrivateKey_file)
Kevin Kofler d749d0
+    RESOLVEFUNC(SSL_CTX_get_cert_store)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_accept)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_clear)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_connect)
Kevin Kofler 56ab7a
@@ -807,8 +886,12 @@
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_get_peer_cert_chain)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_get_peer_certificate)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_get_verify_result)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_library_init)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_load_error_strings)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    RESOLVEFUNC(OPENSSL_init_ssl)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_new)
Kevin Kofler d749d0
 #if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_ctrl)
Kevin Kofler 56ab7a
@@ -819,17 +902,47 @@
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_set_connect_state)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_shutdown)
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_write)
Kevin Kofler d749d0
+
Kevin Kofler d749d0
+    RESOLVEFUNC(X509_get_serialNumber)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
Kevin Kofler d749d0
+    RESOLVEFUNC(SSL_CTX_ctrl)
Kevin Kofler d749d0
+    RESOLVEFUNC(EVP_PKEY_id)
Kevin Kofler d749d0
+    RESOLVEFUNC(EVP_PKEY_base_id)
Kevin Kofler d749d0
+    RESOLVEFUNC(SSL_CIPHER_get_bits)
Kevin Kofler d749d0
+    RESOLVEFUNC(SSL_CTX_set_options)
Kevin Kofler d749d0
+    RESOLVEFUNC(X509_get_version)
Kevin Kofler d749d0
+    RESOLVEFUNC(X509_get_X509_PUBKEY)
Kevin Kofler d749d0
+    RESOLVEFUNC(RSA_bits)
Kevin Kofler d749d0
+    RESOLVEFUNC(DSA_security_bits)
Kevin Kofler d749d0
+    RESOLVEFUNC(DSA_get0_pqg)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
+    RESOLVEFUNC(X509_get_notAfter)
Kevin Kofler d749d0
+    RESOLVEFUNC(X509_get_notBefore)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    RESOLVEFUNC(X509_getm_notAfter)
Kevin Kofler d749d0
+    RESOLVEFUNC(X509_getm_notBefore)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
+
Kevin Kofler d749d0
 #ifndef OPENSSL_NO_SSL2
Kevin Kofler d749d0
     RESOLVEFUNC(SSLv2_client_method)
Kevin Kofler d749d0
 #endif
Kevin Kofler d749d0
     RESOLVEFUNC(SSLv3_client_method)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     RESOLVEFUNC(SSLv23_client_method)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    RESOLVEFUNC(TLS_client_method)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     RESOLVEFUNC(TLSv1_client_method)
Kevin Kofler d749d0
 #ifndef OPENSSL_NO_SSL2
Kevin Kofler d749d0
     RESOLVEFUNC(SSLv2_server_method)
Kevin Kofler d749d0
 #endif
Kevin Kofler dc6c77
     RESOLVEFUNC(SSLv3_server_method)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     RESOLVEFUNC(SSLv23_server_method)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    RESOLVEFUNC(TLS_server_method)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     RESOLVEFUNC(TLSv1_server_method)
Kevin Kofler d749d0
     RESOLVEFUNC(X509_NAME_entry_count)
Kevin Kofler d749d0
     RESOLVEFUNC(X509_NAME_get_entry)
Kevin Kofler 56ab7a
@@ -846,7 +959,11 @@
Kevin Kofler d749d0
     RESOLVEFUNC(X509_STORE_CTX_get_error)
Kevin Kofler d749d0
     RESOLVEFUNC(X509_STORE_CTX_get_error_depth)
Kevin Kofler d749d0
     RESOLVEFUNC(X509_STORE_CTX_get_current_cert)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     RESOLVEFUNC(X509_STORE_CTX_get_chain)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    RESOLVEFUNC(X509_STORE_CTX_get0_chain)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     RESOLVEFUNC(X509_cmp)
Kevin Kofler d749d0
 #ifndef SSLEAY_MACROS
Kevin Kofler d749d0
     RESOLVEFUNC(X509_dup)
Kevin Kofler 56ab7a
@@ -867,10 +984,18 @@
Kevin Kofler d749d0
     RESOLVEFUNC(d2i_DSAPrivateKey)
Kevin Kofler d749d0
     RESOLVEFUNC(d2i_RSAPrivateKey)
Kevin Kofler d749d0
 #endif
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf)
Kevin Kofler d749d0
     RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    RESOLVEFUNC(OPENSSL_init_crypto)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
     RESOLVEFUNC(SSL_CTX_load_verify_locations)
Kevin Kofler d749d0
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler d749d0
     RESOLVEFUNC(SSLeay)
Kevin Kofler d749d0
+#else
Kevin Kofler d749d0
+    RESOLVEFUNC(OpenSSL_version_num)
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
 #endif // Q_OS_SYMBIAN
Kevin Kofler d749d0
     symbolsResolved = true;
Kevin Kofler d749d0
     delete libs.first;
Kevin Kofler dc6c77
diff -ur qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_symbols_p.h qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslsocket_openssl_symbols_p.h
Kevin Kofler dc6c77
--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_symbols_p.h	2015-05-07 16:14:44.000000000 +0200
Kevin Kofler 56ab7a
+++ qt-everywhere-opensource-src-4.8.7-openssl-1.1/src/network/ssl/qsslsocket_openssl_symbols_p.h	2018-01-05 17:59:42.041550255 +0100
Kevin Kofler 56ab7a
@@ -207,16 +207,31 @@
Kevin Kofler 56ab7a
 int q_ASN1_STRING_to_UTF8(unsigned char **a, ASN1_STRING *b);
Kevin Kofler 56ab7a
 long q_BIO_ctrl(BIO *a, int b, long c, void *d);
Kevin Kofler 56ab7a
 int q_BIO_free(BIO *a);
Kevin Kofler 56ab7a
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler 56ab7a
 BIO *q_BIO_new(BIO_METHOD *a);
Kevin Kofler 56ab7a
+#else
Kevin Kofler 56ab7a
+BIO *q_BIO_new(const BIO_METHOD *a);
Kevin Kofler 56ab7a
+#endif
Kevin Kofler 56ab7a
 BIO *q_BIO_new_mem_buf(void *a, int b);
Kevin Kofler 56ab7a
 int q_BIO_read(BIO *a, void *b, int c);
Kevin Kofler 56ab7a
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler dc6c77
 BIO_METHOD *q_BIO_s_mem();
Kevin Kofler 56ab7a
+#else
Kevin Kofler 56ab7a
+const BIO_METHOD *q_BIO_s_mem();
Kevin Kofler 56ab7a
+#endif
Kevin Kofler dc6c77
 int q_BIO_write(BIO *a, const void *b, int c);
Kevin Kofler dc6c77
 int q_BN_num_bits(const BIGNUM *a);
Kevin Kofler dc6c77
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler dc6c77
 int q_CRYPTO_num_locks();
Kevin Kofler dc6c77
 void q_CRYPTO_set_locking_callback(void (*a)(int, int, const char *, int));
Kevin Kofler dc6c77
 void q_CRYPTO_set_id_callback(unsigned long (*a)());
Kevin Kofler 56ab7a
 void q_CRYPTO_free(void *a);
Kevin Kofler dc6c77
+#else
Kevin Kofler dc6c77
+#define q_CRYPTO_num_locks() 1
Kevin Kofler dc6c77
+#define q_CRYPTO_set_locking_callback(a)
Kevin Kofler dc6c77
+#define q_CRYPTO_set_id_callback(a)
Kevin Kofler 56ab7a
+void q_CRYPTO_free(void *a, const char *b, int c);
Kevin Kofler dc6c77
+#endif
Kevin Kofler dc6c77
 void q_DSA_free(DSA *a);
Kevin Kofler dc6c77
 #if OPENSSL_VERSION_NUMBER >= 0x00908000L
Kevin Kofler 56ab7a
 // 0.9.8 broke SC and BC by changing this function's signature.
Kevin Kofler 56ab7a
@@ -258,6 +273,7 @@
Kevin Kofler dc6c77
 void q_RAND_seed(const void *a, int b);
Kevin Kofler dc6c77
 int q_RAND_status();
Kevin Kofler dc6c77
 void q_RSA_free(RSA *a);
Kevin Kofler dc6c77
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler dc6c77
 int q_sk_num(STACK *a);
Kevin Kofler dc6c77
 void q_sk_pop_free(STACK *a, void (*b)(void *));
Kevin Kofler dc6c77
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
Kevin Kofler 56ab7a
@@ -267,6 +283,16 @@
Kevin Kofler dc6c77
 void q_sk_free(STACK *a);
Kevin Kofler dc6c77
 char * q_sk_value(STACK *a, int b);
Kevin Kofler dc6c77
 #endif
Kevin Kofler dc6c77
+#else
Kevin Kofler dc6c77
+int q_OPENSSL_sk_num(STACK *a);
Kevin Kofler dc6c77
+void q_OPENSSL_sk_pop_free(STACK *a, void (*b)(void *));
Kevin Kofler dc6c77
+void q_OPENSSL_sk_free(_STACK *a);
Kevin Kofler dc6c77
+void * q_OPENSSL_sk_value(STACK *a, int b);
Kevin Kofler dc6c77
+#define q_sk_num q_OPENSSL_sk_num
Kevin Kofler dc6c77
+#define q_sk_pop_free q_OPENSSL_sk_pop_free
Kevin Kofler dc6c77
+#define q_sk_free q_OPENSSL_sk_free
Kevin Kofler dc6c77
+#define q_sk_value q_OPENSSL_sk_value
Kevin Kofler dc6c77
+#endif
Kevin Kofler dc6c77
 int q_SSL_accept(SSL *a);
Kevin Kofler dc6c77
 int q_SSL_clear(SSL *a);
Kevin Kofler dc6c77
 char *q_SSL_CIPHER_description(SSL_CIPHER *a, char *b, int c);
Kevin Kofler 56ab7a
@@ -314,8 +340,14 @@
Kevin Kofler dc6c77
 #else
Kevin Kofler dc6c77
 long q_SSL_get_verify_result(SSL *a);
Kevin Kofler d749d0
 #endif
Kevin Kofler dc6c77
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler dc6c77
 int q_SSL_library_init();
Kevin Kofler dc6c77
 void q_SSL_load_error_strings();
Kevin Kofler dc6c77
+#else
Kevin Kofler 56ab7a
+int q_OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
Kevin Kofler 56ab7a
+#define q_SSL_library_init() q_OPENSSL_init_ssl(0, (const OPENSSL_INIT_SETTINGS *) NULL)
Kevin Kofler 56ab7a
+#define q_SSL_load_error_strings() q_OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, (const OPENSSL_INIT_SETTINGS *) NULL)
Kevin Kofler dc6c77
+#endif
Kevin Kofler dc6c77
 SSL *q_SSL_new(SSL_CTX *a);
Kevin Kofler dc6c77
 #if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
Kevin Kofler dc6c77
 long q_SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg);
Kevin Kofler 56ab7a
@@ -328,11 +360,21 @@
Kevin Kofler dc6c77
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
Kevin Kofler dc6c77
 const SSL_METHOD *q_SSLv2_client_method();
Kevin Kofler dc6c77
 const SSL_METHOD *q_SSLv3_client_method();
Kevin Kofler dc6c77
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler dc6c77
 const SSL_METHOD *q_SSLv23_client_method();
Kevin Kofler dc6c77
+#else
Kevin Kofler dc6c77
+const SSL_METHOD *q_TLS_client_method();
Kevin Kofler dc6c77
+#define q_SSLv23_client_method q_TLS_client_method
Kevin Kofler dc6c77
+#endif
Kevin Kofler dc6c77
 const SSL_METHOD *q_TLSv1_client_method();
Kevin Kofler dc6c77
 const SSL_METHOD *q_SSLv2_server_method();
Kevin Kofler dc6c77
 const SSL_METHOD *q_SSLv3_server_method();
Kevin Kofler dc6c77
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler dc6c77
 const SSL_METHOD *q_SSLv23_server_method();
Kevin Kofler dc6c77
+#else
Kevin Kofler dc6c77
+const SSL_METHOD *q_TLS_server_method();
Kevin Kofler dc6c77
+#define q_SSLv23_server_method q_TLS_server_method
Kevin Kofler dc6c77
+#endif
Kevin Kofler dc6c77
 const SSL_METHOD *q_TLSv1_server_method();
Kevin Kofler dc6c77
 #else
Kevin Kofler dc6c77
 SSL_METHOD *q_SSLv2_client_method();
Kevin Kofler 56ab7a
@@ -377,7 +419,12 @@
Kevin Kofler dc6c77
 int q_X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
Kevin Kofler dc6c77
 int q_X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);
Kevin Kofler dc6c77
 X509 *q_X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx);
Kevin Kofler dc6c77
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler dc6c77
 STACK_OF(X509) *q_X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);
Kevin Kofler dc6c77
+#else
Kevin Kofler dc6c77
+STACK_OF(X509) *q_X509_STORE_CTX_get0_chain(X509_STORE_CTX *ctx);
Kevin Kofler dc6c77
+#define q_X509_STORE_CTX_get_chain q_X509_STORE_CTX_get0_chain
Kevin Kofler dc6c77
+#endif
Kevin Kofler d749d0
 
Kevin Kofler dc6c77
 #define q_BIO_get_mem_data(b, pp) (int)q_BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
Kevin Kofler dc6c77
 #define q_BIO_pending(b) (int)q_BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
Kevin Kofler 56ab7a
@@ -399,7 +446,25 @@
Kevin Kofler dc6c77
 		PEM_ASN1_write_bio((int (*)(void*, unsigned char**))q_i2d_DSAPrivateKey,PEM_STRING_DSA,\
Kevin Kofler dc6c77
 			bp,(char *)x,enc,kstr,klen,cb,u)
Kevin Kofler dc6c77
 #endif
Kevin Kofler dc6c77
+
Kevin Kofler dc6c77
+X509_STORE * q_SSL_CTX_get_cert_store(const SSL_CTX *ctx);
Kevin Kofler dc6c77
+ASN1_INTEGER * q_X509_get_serialNumber(X509 *x);
Kevin Kofler dc6c77
+
Kevin Kofler dc6c77
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler dc6c77
 #define q_SSL_CTX_set_options(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
Kevin Kofler dc6c77
+#define q_X509_get_version(x) X509_get_version(x)
Kevin Kofler dc6c77
+#else
Kevin Kofler dc6c77
+int q_EVP_PKEY_id(const EVP_PKEY *pkey);
Kevin Kofler dc6c77
+int q_EVP_PKEY_base_id(const EVP_PKEY *pkey);
Kevin Kofler dc6c77
+int q_SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *alg_bits);
Kevin Kofler dc6c77
+long q_SSL_CTX_set_options(SSL_CTX *ctx, long options);
Kevin Kofler dc6c77
+long q_X509_get_version(X509 *x);
Kevin Kofler dc6c77
+X509_PUBKEY * q_X509_get_X509_PUBKEY(X509 *x);
Kevin Kofler dc6c77
+int q_RSA_bits(const RSA *rsa);
Kevin Kofler dc6c77
+int q_DSA_security_bits(const DSA *dsa);
Kevin Kofler 56ab7a
+void q_DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
Kevin Kofler d749d0
+#endif
Kevin Kofler d749d0
+
Kevin Kofler dc6c77
 #define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_sk_num)(st)
Kevin Kofler dc6c77
 #define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_sk_value)(st, i)
Kevin Kofler dc6c77
 #define q_sk_GENERAL_NAME_num(st) q_SKM_sk_num(GENERAL_NAME, (st))
Kevin Kofler 56ab7a
@@ -410,8 +475,17 @@
Kevin Kofler dc6c77
 #define q_sk_SSL_CIPHER_value(st, i) q_SKM_sk_value(SSL_CIPHER, (st), (i))
Kevin Kofler dc6c77
 #define q_SSL_CTX_add_extra_chain_cert(ctx,x509) \
Kevin Kofler dc6c77
         q_SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
Kevin Kofler dc6c77
+
Kevin Kofler dc6c77
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler dc6c77
 #define q_X509_get_notAfter(x) X509_get_notAfter(x)
Kevin Kofler dc6c77
 #define q_X509_get_notBefore(x) X509_get_notBefore(x)
Kevin Kofler dc6c77
+#else
Kevin Kofler dc6c77
+ASN1_TIME *q_X509_getm_notAfter(X509 *x);
Kevin Kofler dc6c77
+ASN1_TIME *q_X509_getm_notBefore(X509 *x);
Kevin Kofler dc6c77
+#define q_X509_get_notAfter(x) q_X509_getm_notAfter(x)
Kevin Kofler dc6c77
+#define q_X509_get_notBefore(x) q_X509_getm_notBefore(x)
Kevin Kofler dc6c77
+#endif
Kevin Kofler dc6c77
+
Kevin Kofler dc6c77
 #define q_EVP_PKEY_assign_RSA(pkey,rsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\
Kevin Kofler dc6c77
 					(char *)(rsa))
Kevin Kofler dc6c77
 #define q_EVP_PKEY_assign_DSA(pkey,dsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
Kevin Kofler 56ab7a
@@ -421,10 +495,21 @@
Kevin Kofler dc6c77
 #else
Kevin Kofler dc6c77
 #define q_OpenSSL_add_all_algorithms() q_OPENSSL_add_all_algorithms_noconf()
Kevin Kofler d749d0
 #endif
Kevin Kofler dc6c77
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler dc6c77
 void q_OPENSSL_add_all_algorithms_noconf();
Kevin Kofler dc6c77
 void q_OPENSSL_add_all_algorithms_conf();
Kevin Kofler dc6c77
+#else
Kevin Kofler 56ab7a
+int q_OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
Kevin Kofler 56ab7a
+#define q_OPENSSL_add_all_algorithms_conf() q_OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS | OPENSSL_INIT_ADD_ALL_DIGESTS | OPENSSL_INIT_LOAD_CONFIG, (const OPENSSL_INIT_SETTINGS *) NULL)
Kevin Kofler 56ab7a
+#  define q_OPENSSL_add_all_algorithms_noconf() q_OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS | OPENSSL_INIT_ADD_ALL_DIGESTS, (const OPENSSL_INIT_SETTINGS *) NULL)
Kevin Kofler dc6c77
+#endif
Kevin Kofler dc6c77
 int q_SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath);
Kevin Kofler dc6c77
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
Kevin Kofler dc6c77
 long q_SSLeay();
Kevin Kofler dc6c77
+#else
Kevin Kofler dc6c77
+unsigned long q_OpenSSL_version_num();
Kevin Kofler dc6c77
+#define q_SSLeay q_OpenSSL_version_num
Kevin Kofler dc6c77
+#endif
Kevin Kofler dc6c77
 
Kevin Kofler dc6c77
 // Helper function
Kevin Kofler dc6c77
 class QDateTime;