View | Details | Raw Unified | Return to bug 214691 | Differences between
and this patch

Collapse All | Expand All

(-)net/qt4-network/Makefile (-1 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	network
4
PORTNAME=	network
5
DISTVERSION=	${QT4_VERSION}
5
DISTVERSION=	${QT4_VERSION}
6
PORTREVISION=	7
6
PORTREVISION=	8
7
CATEGORIES=	net ipv6
7
CATEGORIES=	net ipv6
8
PKGNAMEPREFIX=	qt4-
8
PKGNAMEPREFIX=	qt4-
9
9
(-)net/qt4-network/files/patch-src_network_ssl_qsslcertificate.cpp (+63 lines)
Line 0 Link Here
1
--- src/network/ssl/qsslcertificate.cpp.orig	2015-05-07 14:14:44 UTC
2
+++ src/network/ssl/qsslcertificate.cpp
3
@@ -259,10 +259,10 @@ void QSslCertificate::clear()
4
 QByteArray QSslCertificate::version() const
5
 {
6
     QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));
7
-    if (d->versionString.isEmpty() && d->x509)
8
+    if (d->versionString.isEmpty() && d->x509) {
9
         d->versionString =
10
-            QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1);
11
-
12
+	    QByteArray::number(qlonglong(q_X509_get_version(d->x509)) + 1);
13
+    }
14
     return d->versionString;
15
 }
16
 
17
@@ -276,7 +276,7 @@ QByteArray QSslCertificate::serialNumber() const
18
 {
19
     QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));
20
     if (d->serialNumberString.isEmpty() && d->x509) {
21
-        ASN1_INTEGER *serialNumber = d->x509->cert_info->serialNumber;
22
+        ASN1_INTEGER *serialNumber = q_X509_get_serialNumber(d->x509);
23
         // if we cannot convert to a long, just output the hexadecimal number
24
         if (serialNumber->length > 4) {
25
             QByteArray hexString;
26
@@ -489,24 +489,33 @@ QSslKey QSslCertificate::publicKey() const
27
     QSslKey key;
28
 
29
     key.d->type = QSsl::PublicKey;
30
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
31
     X509_PUBKEY *xkey = d->x509->cert_info->key;
32
+#else
33
+    X509_PUBKEY *xkey = q_X509_get_X509_PUBKEY(d->x509);
34
+#endif
35
     EVP_PKEY *pkey = q_X509_PUBKEY_get(xkey);
36
     Q_ASSERT(pkey);
37
 
38
-    if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_RSA) {
39
+    int key_id;
40
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
41
+    key_id = q_EVP_PKEY_type(pkey->type);
42
+#else
43
+    key_id = q_EVP_PKEY_base_id(pkey);
44
+#endif
45
+    if (key_id == EVP_PKEY_RSA) {
46
         key.d->rsa = q_EVP_PKEY_get1_RSA(pkey);
47
         key.d->algorithm = QSsl::Rsa;
48
         key.d->isNull = false;
49
-    } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA) {
50
+    } else if (key_id == EVP_PKEY_DSA) {
51
         key.d->dsa = q_EVP_PKEY_get1_DSA(pkey);
52
         key.d->algorithm = QSsl::Dsa;
53
         key.d->isNull = false;
54
-    } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DH) {
55
+    } else if (key_id == EVP_PKEY_DH) {
56
         // DH unsupported
57
     } else {
58
         // error?
59
     }
60
-
61
     q_EVP_PKEY_free(pkey);
62
     return key;
63
 }
(-)net/qt4-network/files/patch-src_network_ssl_qsslkey.cpp (+22 lines)
Line 0 Link Here
1
--- src/network/ssl/qsslkey.cpp.orig	2015-05-07 14:14:44 UTC
2
+++ src/network/ssl/qsslkey.cpp
3
@@ -321,8 +321,19 @@ int QSslKey::length() const
4
 {
5
     if (d->isNull)
6
         return -1;
7
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
8
     return (d->algorithm == QSsl::Rsa)
9
            ? q_BN_num_bits(d->rsa->n) : q_BN_num_bits(d->dsa->p);
10
+#else
11
+    if (d->algorithm == QSsl::Rsa) {
12
+        return q_RSA_bits(d->rsa);
13
+    }else{
14
+        BIGNUM *p = NULL;
15
+        q_DSA_get0_pqg(d->dsa, &p, NULL, NULL);
16
+	return q_BN_num_bits(p);
17
+    }
18
+#endif
19
+
20
 }
21
 
22
 /*!
(-)net/qt4-network/files/patch-src_network_ssl_qsslsocket__openssl.cpp (-4 / +102 lines)
Lines 1-8 Link Here
1
* Make availability of SSLv3 in Qt4 same as in Qt5, i.e. not part of SecureProtocols
2
*
3
--- src/network/ssl/qsslsocket_openssl.cpp.orig	2015-05-07 14:14:44 UTC
1
--- src/network/ssl/qsslsocket_openssl.cpp.orig	2015-05-07 14:14:44 UTC
4
+++ src/network/ssl/qsslsocket_openssl.cpp
2
+++ src/network/ssl/qsslsocket_openssl.cpp
5
@@ -267,9 +267,13 @@ init_context:
3
@@ -93,6 +93,7 @@ bool QSslSocketPrivate::s_libraryLoaded = false;
4
 bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
5
 bool QSslSocketPrivate::s_loadRootCertsOnDemand = false;
6
 
7
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
8
 /* \internal
9
 
10
     From OpenSSL's thread(3) manual page:
11
@@ -174,6 +175,8 @@ static unsigned long id_function()
12
 }
13
 } // extern "C"
14
 
15
+#endif //OPENSSL_VERSION_NUMBER >= 0x10100000L
16
+
17
 QSslSocketBackendPrivate::QSslSocketBackendPrivate()
18
     : ssl(0),
19
       ctx(0),
20
@@ -222,9 +225,12 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_S
21
             ciph.d->encryptionMethod = descriptionList.at(4).mid(4);
22
         ciph.d->exportable = (descriptionList.size() > 6 && descriptionList.at(6) == QLatin1String("export"));
23
 
24
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
25
         ciph.d->bits = cipher->strength_bits;
26
         ciph.d->supportedBits = cipher->alg_bits;
27
-
28
+#else
29
+	ciph.d->bits = q_SSL_CIPHER_get_bits(cipher, &ciph.d->supportedBits);
30
+#endif
31
     }
32
     return ciph;
33
 }
34
@@ -267,9 +273,13 @@ init_context:
6
 #endif
35
 #endif
7
         break;
36
         break;
8
     case QSsl::SslV3:
37
     case QSsl::SslV3:
Lines 17-23 Link Here
17
     case QSsl::TlsV1SslV3: // SslV2 will be disabled below
46
     case QSsl::TlsV1SslV3: // SslV2 will be disabled below
18
     case QSsl::AnyProtocol:
47
     case QSsl::AnyProtocol:
19
     default:
48
     default:
20
@@ -297,8 +301,10 @@ init_context:
49
@@ -297,8 +307,10 @@ init_context:
21
 
50
 
22
     // Enable bug workarounds.
51
     // Enable bug workarounds.
23
     long options;
52
     long options;
Lines 29-31 Link Here
29
     else
58
     else
30
         options = SSL_OP_ALL;
59
         options = SSL_OP_ALL;
31
 
60
 
61
@@ -363,7 +375,7 @@ init_context:
62
         //
63
         // See also: QSslContext::fromConfiguration()
64
         if (caCertificate.expiryDate() >= QDateTime::currentDateTime()) {
65
-            q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle());
66
+	  q_X509_STORE_add_cert(q_SSL_CTX_get_cert_store(ctx), (X509 *)caCertificate.handle());
67
         }
68
     }
69
 
70
@@ -500,8 +512,10 @@ void QSslSocketBackendPrivate::destroySslContext()
71
 */
72
 void QSslSocketPrivate::deinitialize()
73
 {
74
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
75
     q_CRYPTO_set_id_callback(0);
76
     q_CRYPTO_set_locking_callback(0);
77
+#endif
78
 }
79
 
80
 /*!
81
@@ -522,13 +536,17 @@ bool QSslSocketPrivate::ensureLibraryLoaded()
82
         return false;
83
 
84
     // Check if the library itself needs to be initialized.
85
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
86
     QMutexLocker locker(openssl_locks()->initLock());
87
+#endif
88
     if (!s_libraryLoaded) {
89
         s_libraryLoaded = true;
90
 
91
         // Initialize OpenSSL.
92
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
93
         q_CRYPTO_set_id_callback(id_function);
94
         q_CRYPTO_set_locking_callback(locking_function);
95
+#endif
96
         if (q_SSL_library_init() != 1)
97
             return false;
98
         q_SSL_load_error_strings();
99
@@ -567,7 +585,9 @@ bool QSslSocketPrivate::ensureLibraryLoaded()
100
 
101
 void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
102
 {
103
-    QMutexLocker locker(openssl_locks()->initLock());
104
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
105
+  QMutexLocker locker(openssl_locks()->initLock());
106
+#endif
107
     if (s_loadedCiphersAndCerts)
108
         return;
109
     s_loadedCiphersAndCerts = true;
110
@@ -659,13 +679,18 @@ void QSslSocketPrivate::resetDefaultCiphers()
111
     STACK_OF(SSL_CIPHER) *supportedCiphers = q_SSL_get_ciphers(mySsl);
112
     for (int i = 0; i < q_sk_SSL_CIPHER_num(supportedCiphers); ++i) {
113
         if (SSL_CIPHER *cipher = q_sk_SSL_CIPHER_value(supportedCiphers, i)) {
114
-            if (cipher->valid) {
115
+
116
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
117
+	  if (cipher->valid) {
118
+#endif
119
                 QSslCipher ciph = QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(cipher);
120
                 if (!ciph.isNull()) {
121
                     if (!ciph.name().toLower().startsWith(QLatin1String("adh")))
122
                         ciphers << ciph;
123
                 }
124
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
125
             }
126
+#endif
127
         }
128
     }
129
 
(-)net/qt4-network/files/patch-src_network_ssl_qsslsocket__openssl__p.h (+13 lines)
Line 0 Link Here
1
--- src/network/ssl/qsslsocket_openssl_p.h.orig	2015-05-07 14:14:44 UTC
2
+++ src/network/ssl/qsslsocket_openssl_p.h
3
@@ -84,6 +84,10 @@
4
 #include <openssl/tls1.h>
5
 #endif
6
 
7
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
8
+#define OPENSSL_NO_SSL2
9
+#endif
10
+
11
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
12
 typedef _STACK STACK;
13
 #endif
(-)net/qt4-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols.cpp (-5 / +289 lines)
Lines 1-9 Link Here
1
* Prepend the path of the SSL libraries used for building so the same libraries are
2
* found and loaded at runtime. Normal search finds base SSL libraries before ports.
3
*
4
--- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig	2015-05-07 14:14:44 UTC
1
--- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig	2015-05-07 14:14:44 UTC
5
+++ src/network/ssl/qsslsocket_openssl_symbols.cpp
2
+++ src/network/ssl/qsslsocket_openssl_symbols.cpp
6
@@ -511,9 +511,9 @@ static QPair<QLibrary*, QLibrary*> loadO
3
@@ -117,9 +117,11 @@ DEFINEFUNC3(int, BIO_read, BIO *a, a, void *b, b, int 
4
 DEFINEFUNC(BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return)
5
 DEFINEFUNC3(int, BIO_write, BIO *a, a, const void *b, b, int c, c, return -1, return)
6
 DEFINEFUNC(int, BN_num_bits, const BIGNUM *a, a, return 0, return)
7
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
8
 DEFINEFUNC(int, CRYPTO_num_locks, DUMMYARG, DUMMYARG, return 0, return)
9
 DEFINEFUNC(void, CRYPTO_set_locking_callback, void (*a)(int, int, const char *, int), a, return, DUMMYARG)
10
 DEFINEFUNC(void, CRYPTO_set_id_callback, unsigned long (*a)(), a, return, DUMMYARG)
11
+#endif
12
 DEFINEFUNC(void, CRYPTO_free, void *a, a, return, DUMMYARG)
13
 DEFINEFUNC(void, DSA_free, DSA *a, a, return, DUMMYARG)
14
 #if  OPENSSL_VERSION_NUMBER < 0x00908000L
15
@@ -157,6 +159,7 @@ DEFINEFUNC2(int, PEM_write_bio_RSA_PUBKEY, BIO *a, a, 
16
 DEFINEFUNC2(void, RAND_seed, const void *a, a, int b, b, return, DUMMYARG)
17
 DEFINEFUNC(int, RAND_status, void, DUMMYARG, return -1, return)
18
 DEFINEFUNC(void, RSA_free, RSA *a, a, return, DUMMYARG)
19
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
20
 DEFINEFUNC(int, sk_num, STACK *a, a, return -1, return)
21
 DEFINEFUNC2(void, sk_pop_free, STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
22
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
23
@@ -166,6 +169,12 @@ DEFINEFUNC2(void *, sk_value, STACK *a, a, int b, b, r
24
 DEFINEFUNC(void, sk_free, STACK *a, a, return, DUMMYARG)
25
 DEFINEFUNC2(char *, sk_value, STACK *a, a, int b, b, return 0, return)
26
 #endif
27
+#else
28
+DEFINEFUNC(int, OPENSSL_sk_num, STACK *a, a, return -1, return)
29
+DEFINEFUNC2(void, OPENSSL_sk_pop_free, STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
30
+DEFINEFUNC(void, OPENSSL_sk_free, _STACK *a, a, return, DUMMYARG)
31
+DEFINEFUNC2(void *, OPENSSL_sk_value, STACK *a, a, int b, b, return 0, return)
32
+#endif
33
 DEFINEFUNC(int, SSL_accept, SSL *a, a, return -1, return)
34
 DEFINEFUNC(int, SSL_clear, SSL *a, a, return -1, return)
35
 DEFINEFUNC3(char *, SSL_CIPHER_description, SSL_CIPHER *a, a, char *b, b, int c, c, return 0, return)
36
@@ -213,8 +222,12 @@ DEFINEFUNC(long, SSL_get_verify_result, const SSL *a, 
37
 #else
38
 DEFINEFUNC(long, SSL_get_verify_result, SSL *a, a, return -1, return)
39
 #endif
40
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
41
 DEFINEFUNC(int, SSL_library_init, void, DUMMYARG, return -1, return)
42
 DEFINEFUNC(void, SSL_load_error_strings, void, DUMMYARG, return, DUMMYARG)
43
+#else
44
+DEFINEFUNC2(int, OPENSSL_init_ssl, uint64_t opts, opts, void *settings, settings, return -1, return)
45
+#endif
46
 DEFINEFUNC(SSL *, SSL_new, SSL_CTX *a, a, return 0, return)
47
 #if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
48
 DEFINEFUNC4(long, SSL_ctrl, SSL *a, a, int cmd, cmd, long larg, larg, void *parg, parg, return -1, return)
49
@@ -229,13 +242,21 @@ DEFINEFUNC(int, SSL_shutdown, SSL *a, a, return -1, re
50
 DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
51
 #endif
52
 DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
53
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
54
 DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
55
+#else
56
+DEFINEFUNC(const SSL_METHOD *, TLS_client_method, DUMMYARG, DUMMYARG, return 0, return)
57
+#endif
58
 DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
59
 #ifndef OPENSSL_NO_SSL2
60
 DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
61
 #endif
62
 DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
63
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
64
 DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
65
+#else
66
+DEFINEFUNC(const SSL_METHOD *, TLS_server_method, DUMMYARG, DUMMYARG, return 0, return)
67
+#endif
68
 DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
69
 #else
70
 DEFINEFUNC(SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
71
@@ -274,7 +295,11 @@ DEFINEFUNC2(int, X509_STORE_CTX_set_purpose, X509_STOR
72
 DEFINEFUNC(int, X509_STORE_CTX_get_error, X509_STORE_CTX *a, a, return -1, return)
73
 DEFINEFUNC(int, X509_STORE_CTX_get_error_depth, X509_STORE_CTX *a, a, return -1, return)
74
 DEFINEFUNC(X509 *, X509_STORE_CTX_get_current_cert, X509_STORE_CTX *a, a, return 0, return)
75
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
76
 DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get_chain, X509_STORE_CTX *a, a, return 0, return)
77
+#else
78
+DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get0_chain, X509_STORE_CTX *a, a, return 0, return)
79
+#endif
80
 DEFINEFUNC(X509_STORE_CTX *, X509_STORE_CTX_new, DUMMYARG, DUMMYARG, return 0, return)
81
 #ifdef SSLEAY_MACROS
82
 DEFINEFUNC2(int, i2d_DSAPrivateKey, const DSA *a, a, unsigned char **b, b, return -1, return)
83
@@ -282,11 +307,40 @@ DEFINEFUNC2(int, i2d_RSAPrivateKey, const RSA *a, a, u
84
 DEFINEFUNC3(RSA *, d2i_RSAPrivateKey, RSA **a, a, unsigned char **b, b, long c, c, return 0, return)
85
 DEFINEFUNC3(DSA *, d2i_DSAPrivateKey, DSA **a, a, unsigned char **b, b, long c, c, return 0, return)
86
 #endif
87
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
88
 DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMMYARG)
89
 DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG)
90
+#else
91
+DEFINEFUNC2(int, OPENSSL_init_crypto, uint64_t opts, opts, void *settings, settings, return -1, return)
92
+#endif
93
 DEFINEFUNC3(int, SSL_CTX_load_verify_locations, SSL_CTX *ctx, ctx, const char *CAfile, CAfile, const char *CApath, CApath, return 0, return)
94
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
95
 DEFINEFUNC(long, SSLeay, void, DUMMYARG, return 0, return)
96
+#else
97
+DEFINEFUNC(unsigned long, OpenSSL_version_num, void, DUMMYARG, return 0, return)
98
+#endif
99
+DEFINEFUNC(X509_STORE *, SSL_CTX_get_cert_store, const SSL_CTX *ctx, ctx, return 0, return)
100
 
101
+DEFINEFUNC(ASN1_INTEGER *, X509_get_serialNumber, X509 *x, x, return 0, return)
102
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
103
+DEFINEFUNC(int, EVP_PKEY_id, const EVP_PKEY *pkey, pkey, return 0, return)
104
+DEFINEFUNC(int, EVP_PKEY_base_id, const EVP_PKEY *pkey, pkey, return 0, return)
105
+DEFINEFUNC2(int, SSL_CIPHER_get_bits, const SSL_CIPHER *cipher, cipher, int *alg_bits, alg_bits, return 0, return)
106
+DEFINEFUNC2(long, SSL_CTX_set_options, SSL_CTX *ctx, ctx, long options, options, return 0, return)
107
+DEFINEFUNC(long, X509_get_version, X509 *x, x, return 0, return)
108
+DEFINEFUNC(X509_PUBKEY *, X509_get_X509_PUBKEY, X509 *x, x, return 0, return)
109
+DEFINEFUNC(int, RSA_bits,  const RSA *rsa, rsa, return 0, return)
110
+DEFINEFUNC(int, DSA_security_bits, const DSA *dsa, dsa, return 0, return)
111
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
112
+DEFINEFUNC(ASN1_TIME *, X509_get_notAfter, X509 *x, x, return 0, return)
113
+DEFINEFUNC(ASN1_TIME *, X509_get_notBefore, X509 *x, x, return 0, return)
114
+#else
115
+DEFINEFUNC(ASN1_TIME *, X509_getm_notAfter, X509 *x, x, return 0, return)
116
+DEFINEFUNC(ASN1_TIME *, X509_getm_notBefore, X509 *x, x, return 0, return)
117
+#endif
118
+DEFINEFUNC4(void, DSA_get0_pqg, const DSA *d, d, BIGNUM **p, p, BIGNUM **q, q, BIGNUM **g, g, return, return)
119
+#endif
120
+
121
 #ifdef Q_OS_SYMBIAN
122
 #define RESOLVEFUNC(func, ordinal, lib) \
123
     if (!(_q_##func = _q_PTR_##func(lib->resolve(#ordinal)))) \
124
@@ -511,9 +565,9 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
7
     libcrypto->setLoadHints(libcrypto->loadHints() | QLibrary::ImprovedSearchHeuristics);
125
     libcrypto->setLoadHints(libcrypto->loadHints() | QLibrary::ImprovedSearchHeuristics);
8
 #elif defined(SHLIB_VERSION_NUMBER)
126
 #elif defined(SHLIB_VERSION_NUMBER)
9
     // first attempt: the canonical name is libssl.so.<SHLIB_VERSION_NUMBER>
127
     // first attempt: the canonical name is libssl.so.<SHLIB_VERSION_NUMBER>
Lines 15-21 Link Here
15
     libcrypto->setLoadHints(libcrypto->loadHints() | QLibrary::ImprovedSearchHeuristics);
133
     libcrypto->setLoadHints(libcrypto->loadHints() | QLibrary::ImprovedSearchHeuristics);
16
     if (libcrypto->load() && libssl->load()) {
134
     if (libcrypto->load() && libssl->load()) {
17
         // libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found
135
         // libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found
18
@@ -525,8 +525,8 @@ static QPair<QLibrary*, QLibrary*> loadO
136
@@ -525,8 +579,8 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
19
 #endif
137
 #endif
20
 
138
 
21
     // second attempt: find the development files libssl.so and libcrypto.so
139
     // second attempt: find the development files libssl.so and libcrypto.so
Lines 26-28 Link Here
26
     if (libcrypto->load() && libssl->load()) {
144
     if (libcrypto->load() && libssl->load()) {
27
         // libssl.so.0 and libcrypto.so.0 found
145
         // libssl.so.0 and libcrypto.so.0 found
28
         return pair;
146
         return pair;
147
@@ -580,8 +634,12 @@ bool q_resolveOpenSslSymbols()
148
     static volatile bool symbolsResolved = false;
149
     static volatile bool triedToResolveSymbols = false;
150
 #ifndef QT_NO_THREAD
151
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
152
     QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_SSL_library_init));
153
+#else
154
+    QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_OPENSSL_init_ssl));
155
 #endif
156
+#endif
157
     if (symbolsResolved)
158
         return true;
159
     if (triedToResolveSymbols)
160
@@ -614,9 +672,11 @@ bool q_resolveOpenSslSymbols()
161
     RESOLVEFUNC(BIO_write, 269, libs.second )
162
     RESOLVEFUNC(BN_num_bits, 387, libs.second )
163
     RESOLVEFUNC(CRYPTO_free, 469, libs.second )
164
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
165
     RESOLVEFUNC(CRYPTO_num_locks, 500, libs.second )
166
     RESOLVEFUNC(CRYPTO_set_id_callback, 513, libs.second )
167
     RESOLVEFUNC(CRYPTO_set_locking_callback, 516, libs.second )
168
+#endif
169
     RESOLVEFUNC(DSA_free, 594, libs.second )
170
     RESOLVEFUNC(ERR_error_string, 744, libs.second )
171
     RESOLVEFUNC(ERR_get_error, 749, libs.second )
172
@@ -674,8 +734,10 @@ bool q_resolveOpenSslSymbols()
173
     RESOLVEFUNC(SSL_get_peer_cert_chain, 117, libs.first )
174
     RESOLVEFUNC(SSL_get_peer_certificate, 118, libs.first )
175
     RESOLVEFUNC(SSL_get_verify_result, 132, libs.first )
176
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
177
     RESOLVEFUNC(SSL_library_init, 137, libs.first )
178
     RESOLVEFUNC(SSL_load_error_strings, 139, libs.first )
179
+#endif
180
     RESOLVEFUNC(SSL_new, 140, libs.first )
181
 #if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
182
     RESOLVEFUNC(SSL_ctrl, 95, libs.first )
183
@@ -747,9 +809,11 @@ bool q_resolveOpenSslSymbols()
184
     RESOLVEFUNC(BIO_write)
185
     RESOLVEFUNC(BN_num_bits)
186
     RESOLVEFUNC(CRYPTO_free)
187
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
188
     RESOLVEFUNC(CRYPTO_num_locks)
189
     RESOLVEFUNC(CRYPTO_set_id_callback)
190
     RESOLVEFUNC(CRYPTO_set_locking_callback)
191
+#endif
192
     RESOLVEFUNC(DSA_free)
193
     RESOLVEFUNC(ERR_error_string)
194
     RESOLVEFUNC(ERR_get_error)
195
@@ -779,10 +843,17 @@ bool q_resolveOpenSslSymbols()
196
     RESOLVEFUNC(RAND_seed)
197
     RESOLVEFUNC(RAND_status)
198
     RESOLVEFUNC(RSA_free)
199
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
200
     RESOLVEFUNC(sk_free)
201
     RESOLVEFUNC(sk_num)
202
     RESOLVEFUNC(sk_pop_free)
203
     RESOLVEFUNC(sk_value)
204
+#else
205
+    RESOLVEFUNC(OPENSSL_sk_free)
206
+    RESOLVEFUNC(OPENSSL_sk_num)
207
+    RESOLVEFUNC(OPENSSL_sk_pop_free)
208
+    RESOLVEFUNC(OPENSSL_sk_value)
209
+#endif
210
     RESOLVEFUNC(SSL_CIPHER_description)
211
     RESOLVEFUNC(SSL_CTX_check_private_key)
212
     RESOLVEFUNC(SSL_CTX_ctrl)
213
@@ -797,6 +868,7 @@ bool q_resolveOpenSslSymbols()
214
     RESOLVEFUNC(SSL_CTX_use_PrivateKey)
215
     RESOLVEFUNC(SSL_CTX_use_RSAPrivateKey)
216
     RESOLVEFUNC(SSL_CTX_use_PrivateKey_file)
217
+    RESOLVEFUNC(SSL_CTX_get_cert_store)
218
     RESOLVEFUNC(SSL_accept)
219
     RESOLVEFUNC(SSL_clear)
220
     RESOLVEFUNC(SSL_connect)
221
@@ -807,8 +879,12 @@ bool q_resolveOpenSslSymbols()
222
     RESOLVEFUNC(SSL_get_peer_cert_chain)
223
     RESOLVEFUNC(SSL_get_peer_certificate)
224
     RESOLVEFUNC(SSL_get_verify_result)
225
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
226
     RESOLVEFUNC(SSL_library_init)
227
     RESOLVEFUNC(SSL_load_error_strings)
228
+#else
229
+    RESOLVEFUNC(OPENSSL_init_ssl)
230
+#endif
231
     RESOLVEFUNC(SSL_new)
232
 #if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
233
     RESOLVEFUNC(SSL_ctrl)
234
@@ -819,17 +895,47 @@ bool q_resolveOpenSslSymbols()
235
     RESOLVEFUNC(SSL_set_connect_state)
236
     RESOLVEFUNC(SSL_shutdown)
237
     RESOLVEFUNC(SSL_write)
238
+
239
+    RESOLVEFUNC(X509_get_serialNumber)
240
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
241
+    RESOLVEFUNC(SSL_CTX_ctrl)
242
+    RESOLVEFUNC(EVP_PKEY_id)
243
+    RESOLVEFUNC(EVP_PKEY_base_id)
244
+    RESOLVEFUNC(SSL_CIPHER_get_bits)
245
+    RESOLVEFUNC(SSL_CTX_set_options)
246
+    RESOLVEFUNC(X509_get_version)
247
+    RESOLVEFUNC(X509_get_X509_PUBKEY)
248
+    RESOLVEFUNC(RSA_bits)
249
+    RESOLVEFUNC(DSA_security_bits)
250
+    RESOLVEFUNC(DSA_get0_pqg)
251
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
252
+    RESOLVEFUNC(X509_get_notAfter)
253
+    RESOLVEFUNC(X509_get_notBefore)
254
+#else
255
+    RESOLVEFUNC(X509_getm_notAfter)
256
+    RESOLVEFUNC(X509_getm_notBefore)
257
+#endif
258
+#endif
259
+
260
 #ifndef OPENSSL_NO_SSL2
261
     RESOLVEFUNC(SSLv2_client_method)
262
 #endif
263
     RESOLVEFUNC(SSLv3_client_method)
264
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
265
     RESOLVEFUNC(SSLv23_client_method)
266
+#else
267
+    RESOLVEFUNC(TLS_client_method)
268
+#endif
269
     RESOLVEFUNC(TLSv1_client_method)
270
 #ifndef OPENSSL_NO_SSL2
271
     RESOLVEFUNC(SSLv2_server_method)
272
 #endif
273
     RESOLVEFUNC(SSLv3_server_method)
274
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
275
     RESOLVEFUNC(SSLv23_server_method)
276
+#else
277
+    RESOLVEFUNC(TLS_server_method)
278
+#endif
279
     RESOLVEFUNC(TLSv1_server_method)
280
     RESOLVEFUNC(X509_NAME_entry_count)
281
     RESOLVEFUNC(X509_NAME_get_entry)
282
@@ -846,7 +952,11 @@ bool q_resolveOpenSslSymbols()
283
     RESOLVEFUNC(X509_STORE_CTX_get_error)
284
     RESOLVEFUNC(X509_STORE_CTX_get_error_depth)
285
     RESOLVEFUNC(X509_STORE_CTX_get_current_cert)
286
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
287
     RESOLVEFUNC(X509_STORE_CTX_get_chain)
288
+#else
289
+    RESOLVEFUNC(X509_STORE_CTX_get0_chain)
290
+#endif
291
     RESOLVEFUNC(X509_cmp)
292
 #ifndef SSLEAY_MACROS
293
     RESOLVEFUNC(X509_dup)
294
@@ -867,10 +977,18 @@ bool q_resolveOpenSslSymbols()
295
     RESOLVEFUNC(d2i_DSAPrivateKey)
296
     RESOLVEFUNC(d2i_RSAPrivateKey)
297
 #endif
298
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
299
     RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf)
300
     RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
301
+#else
302
+    RESOLVEFUNC(OPENSSL_init_crypto)
303
+#endif
304
     RESOLVEFUNC(SSL_CTX_load_verify_locations)
305
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
306
     RESOLVEFUNC(SSLeay)
307
+#else
308
+    RESOLVEFUNC(OpenSSL_version_num)
309
+#endif
310
 #endif // Q_OS_SYMBIAN
311
     symbolsResolved = true;
312
     delete libs.first;
(-)net/qt4-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h (+159 lines)
Line 0 Link Here
1
--- src/network/ssl/qsslsocket_openssl_symbols_p.h.orig	2015-05-07 14:14:44 UTC
2
+++ src/network/ssl/qsslsocket_openssl_symbols_p.h
3
@@ -213,9 +213,15 @@ int q_BIO_read(BIO *a, void *b, int c);
4
 BIO_METHOD *q_BIO_s_mem();
5
 int q_BIO_write(BIO *a, const void *b, int c);
6
 int q_BN_num_bits(const BIGNUM *a);
7
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
8
 int q_CRYPTO_num_locks();
9
 void q_CRYPTO_set_locking_callback(void (*a)(int, int, const char *, int));
10
 void q_CRYPTO_set_id_callback(unsigned long (*a)());
11
+#else
12
+#define q_CRYPTO_num_locks() 1
13
+#define q_CRYPTO_set_locking_callback(a)
14
+#define q_CRYPTO_set_id_callback(a)
15
+#endif
16
 void q_CRYPTO_free(void *a);
17
 void q_DSA_free(DSA *a);
18
 #if OPENSSL_VERSION_NUMBER >= 0x00908000L
19
@@ -258,6 +264,7 @@ int q_PEM_write_bio_RSA_PUBKEY(BIO *a, RSA *b);
20
 void q_RAND_seed(const void *a, int b);
21
 int q_RAND_status();
22
 void q_RSA_free(RSA *a);
23
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
24
 int q_sk_num(STACK *a);
25
 void q_sk_pop_free(STACK *a, void (*b)(void *));
26
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
27
@@ -267,6 +274,16 @@ void * q_sk_value(STACK *a, int b);
28
 void q_sk_free(STACK *a);
29
 char * q_sk_value(STACK *a, int b);
30
 #endif
31
+#else
32
+int q_OPENSSL_sk_num(STACK *a);
33
+void q_OPENSSL_sk_pop_free(STACK *a, void (*b)(void *));
34
+void q_OPENSSL_sk_free(_STACK *a);
35
+void * q_OPENSSL_sk_value(STACK *a, int b);
36
+#define q_sk_num q_OPENSSL_sk_num
37
+#define q_sk_pop_free q_OPENSSL_sk_pop_free
38
+#define q_sk_free q_OPENSSL_sk_free
39
+#define q_sk_value q_OPENSSL_sk_value
40
+#endif
41
 int q_SSL_accept(SSL *a);
42
 int q_SSL_clear(SSL *a);
43
 char *q_SSL_CIPHER_description(SSL_CIPHER *a, char *b, int c);
44
@@ -314,8 +331,14 @@ long q_SSL_get_verify_result(const SSL *a);
45
 #else
46
 long q_SSL_get_verify_result(SSL *a);
47
 #endif
48
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
49
 int q_SSL_library_init();
50
 void q_SSL_load_error_strings();
51
+#else
52
+int q_OPENSSL_init_ssl(uint64_t opts, void *settings);
53
+#define q_SSL_library_init() q_OPENSSL_init_ssl(0, NULL)
54
+#define q_SSL_load_error_strings() q_OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
55
+#endif
56
 SSL *q_SSL_new(SSL_CTX *a);
57
 #if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
58
 long q_SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg);
59
@@ -328,11 +351,21 @@ int q_SSL_shutdown(SSL *a);
60
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
61
 const SSL_METHOD *q_SSLv2_client_method();
62
 const SSL_METHOD *q_SSLv3_client_method();
63
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
64
 const SSL_METHOD *q_SSLv23_client_method();
65
+#else
66
+const SSL_METHOD *q_TLS_client_method();
67
+#define q_SSLv23_client_method q_TLS_client_method
68
+#endif
69
 const SSL_METHOD *q_TLSv1_client_method();
70
 const SSL_METHOD *q_SSLv2_server_method();
71
 const SSL_METHOD *q_SSLv3_server_method();
72
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
73
 const SSL_METHOD *q_SSLv23_server_method();
74
+#else
75
+const SSL_METHOD *q_TLS_server_method();
76
+#define q_SSLv23_server_method q_TLS_server_method
77
+#endif
78
 const SSL_METHOD *q_TLSv1_server_method();
79
 #else
80
 SSL_METHOD *q_SSLv2_client_method();
81
@@ -377,7 +410,12 @@ int q_X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, 
82
 int q_X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
83
 int q_X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);
84
 X509 *q_X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx);
85
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
86
 STACK_OF(X509) *q_X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);
87
+#else
88
+STACK_OF(X509) *q_X509_STORE_CTX_get0_chain(X509_STORE_CTX *ctx);
89
+#define q_X509_STORE_CTX_get_chain q_X509_STORE_CTX_get0_chain
90
+#endif
91
 
92
 #define q_BIO_get_mem_data(b, pp) (int)q_BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
93
 #define q_BIO_pending(b) (int)q_BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
94
@@ -399,7 +437,25 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, 
95
 		PEM_ASN1_write_bio((int (*)(void*, unsigned char**))q_i2d_DSAPrivateKey,PEM_STRING_DSA,\
96
 			bp,(char *)x,enc,kstr,klen,cb,u)
97
 #endif
98
+
99
+X509_STORE * q_SSL_CTX_get_cert_store(const SSL_CTX *ctx);
100
+ASN1_INTEGER * q_X509_get_serialNumber(X509 *x);
101
+
102
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
103
 #define q_SSL_CTX_set_options(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
104
+#define q_X509_get_version(x) X509_get_version(x)
105
+#else
106
+int q_EVP_PKEY_id(const EVP_PKEY *pkey);
107
+int q_EVP_PKEY_base_id(const EVP_PKEY *pkey);
108
+int q_SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *alg_bits);
109
+long q_SSL_CTX_set_options(SSL_CTX *ctx, long options);
110
+long q_X509_get_version(X509 *x);
111
+X509_PUBKEY * q_X509_get_X509_PUBKEY(X509 *x);
112
+int q_RSA_bits(const RSA *rsa);
113
+int q_DSA_security_bits(const DSA *dsa);
114
+void q_DSA_get0_pqg(const DSA *d, BIGNUM **p, BIGNUM **q, BIGNUM **g);
115
+#endif
116
+
117
 #define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_sk_num)(st)
118
 #define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_sk_value)(st, i)
119
 #define q_sk_GENERAL_NAME_num(st) q_SKM_sk_num(GENERAL_NAME, (st))
120
@@ -410,8 +466,17 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, 
121
 #define q_sk_SSL_CIPHER_value(st, i) q_SKM_sk_value(SSL_CIPHER, (st), (i))
122
 #define q_SSL_CTX_add_extra_chain_cert(ctx,x509) \
123
         q_SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
124
+
125
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
126
 #define q_X509_get_notAfter(x) X509_get_notAfter(x)
127
 #define q_X509_get_notBefore(x) X509_get_notBefore(x)
128
+#else
129
+ASN1_TIME *q_X509_getm_notAfter(X509 *x);
130
+ASN1_TIME *q_X509_getm_notBefore(X509 *x);
131
+#define q_X509_get_notAfter(x) q_X509_getm_notAfter(x)
132
+#define q_X509_get_notBefore(x) q_X509_getm_notBefore(x)
133
+#endif
134
+
135
 #define q_EVP_PKEY_assign_RSA(pkey,rsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\
136
 					(char *)(rsa))
137
 #define q_EVP_PKEY_assign_DSA(pkey,dsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
138
@@ -421,10 +486,21 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, 
139
 #else
140
 #define q_OpenSSL_add_all_algorithms() q_OPENSSL_add_all_algorithms_noconf()
141
 #endif
142
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
143
 void q_OPENSSL_add_all_algorithms_noconf();
144
 void q_OPENSSL_add_all_algorithms_conf();
145
+#else
146
+int q_OPENSSL_init_crypto(uint64_t opts, void *settings);
147
+#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, NULL)
148
+#  define q_OPENSSL_add_all_algorithms_noconf() q_OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
149
+#endif
150
 int q_SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath);
151
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
152
 long q_SSLeay();
153
+#else
154
+unsigned long q_OpenSSL_version_num();
155
+#define q_SSLeay q_OpenSSL_version_num
156
+#endif
157
 
158
 // Helper function
159
 class QDateTime;

Return to bug 214691