Lines 1-10
Link Here
|
1 |
* Boilerplate for SSL_CTX_set1_groups() used in qsslcontext_openssl.cpp |
1 |
--- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig 2018-10-21 15:55:52 UTC |
2 |
* |
2 |
+++ src/network/ssl/qsslsocket_openssl_symbols.cpp |
3 |
* Prepend the path of the SSL libraries used for building so the same libraries are |
|
|
4 |
* found and loaded at runtime. Normal search finds base SSL libraries before ports. |
5 |
* |
6 |
--- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig 2018-02-08 19:24:48.000000000 +0100 |
7 |
+++ src/network/ssl/qsslsocket_openssl_symbols.cpp 2018-06-29 12:22:11.265885000 +0200 |
8 |
@@ -150,6 +150,14 @@ DEFINEFUNC2(int, BN_is_word, BIGNUM *a, |
3 |
@@ -150,6 +150,14 @@ DEFINEFUNC2(int, BN_is_word, BIGNUM *a, |
9 |
DEFINEFUNC(int, EVP_CIPHER_CTX_reset, EVP_CIPHER_CTX *c, c, return 0, return) |
4 |
DEFINEFUNC(int, EVP_CIPHER_CTX_reset, EVP_CIPHER_CTX *c, c, return 0, return) |
10 |
DEFINEFUNC(int, EVP_PKEY_base_id, EVP_PKEY *a, a, return NID_undef, return) |
5 |
DEFINEFUNC(int, EVP_PKEY_base_id, EVP_PKEY *a, a, return NID_undef, return) |
Lines 38-44
Link Here
|
38 |
DEFINEFUNC(EVP_PKEY *, X509_get_pubkey, X509 *a, a, return 0, return) |
33 |
DEFINEFUNC(EVP_PKEY *, X509_get_pubkey, X509 *a, a, return 0, return) |
39 |
DEFINEFUNC2(void, X509_STORE_set_verify_cb, X509_STORE *a, a, X509_STORE_CTX_verify_cb verify_cb, verify_cb, return, DUMMYARG) |
34 |
DEFINEFUNC2(void, X509_STORE_set_verify_cb, X509_STORE *a, a, X509_STORE_CTX_verify_cb verify_cb, verify_cb, return, DUMMYARG) |
40 |
DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get0_chain, X509_STORE_CTX *a, a, return 0, return) |
35 |
DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get0_chain, X509_STORE_CTX *a, a, return 0, return) |
41 |
@@ -524,6 +535,9 @@ DEFINEFUNC(void, EC_KEY_free, EC_KEY *ec |
36 |
@@ -406,7 +417,7 @@ DEFINEFUNC2(int, SSL_CTX_use_PrivateKey, |
|
|
37 |
DEFINEFUNC2(int, SSL_CTX_use_RSAPrivateKey, SSL_CTX *a, a, RSA *b, b, return -1, return) |
38 |
DEFINEFUNC3(int, SSL_CTX_use_PrivateKey_file, SSL_CTX *a, a, const char *b, b, int c, c, return -1, return) |
39 |
DEFINEFUNC(X509_STORE *, SSL_CTX_get_cert_store, const SSL_CTX *a, a, return 0, return) |
40 |
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L |
41 |
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER) |
42 |
DEFINEFUNC(SSL_CONF_CTX *, SSL_CONF_CTX_new, DUMMYARG, DUMMYARG, return 0, return); |
43 |
DEFINEFUNC(void, SSL_CONF_CTX_free, SSL_CONF_CTX *a, a, return ,return); |
44 |
DEFINEFUNC2(void, SSL_CONF_CTX_set_ssl_ctx, SSL_CONF_CTX *a, a, SSL_CTX *b, b, return, return); |
45 |
@@ -537,6 +548,9 @@ DEFINEFUNC(void, EC_KEY_free, EC_KEY *ec |
42 |
DEFINEFUNC2(size_t, EC_get_builtin_curves, EC_builtin_curve * r, r, size_t nitems, nitems, return 0, return) |
46 |
DEFINEFUNC2(size_t, EC_get_builtin_curves, EC_builtin_curve * r, r, size_t nitems, nitems, return 0, return) |
43 |
#if OPENSSL_VERSION_NUMBER >= 0x10002000L |
47 |
#if OPENSSL_VERSION_NUMBER >= 0x10002000L |
44 |
DEFINEFUNC(int, EC_curve_nist2nid, const char *name, name, return 0, return) |
48 |
DEFINEFUNC(int, EC_curve_nist2nid, const char *name, name, return 0, return) |
Lines 48-76
Link Here
|
48 |
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L |
52 |
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L |
49 |
#endif // OPENSSL_NO_EC |
53 |
#endif // OPENSSL_NO_EC |
50 |
|
54 |
|
51 |
@@ -769,8 +783,8 @@ static QPair<QLibrary*, QLibrary*> loadO |
55 |
@@ -782,8 +796,8 @@ static QPair<QLibrary*, QLibrary*> loadO |
52 |
#endif |
56 |
#endif |
53 |
#if defined(SHLIB_VERSION_NUMBER) && !defined(Q_OS_QNX) // on QNX, the libs are always libssl.so and libcrypto.so |
57 |
#if defined(SHLIB_VERSION_NUMBER) && !defined(Q_OS_QNX) // on QNX, the libs are always libssl.so and libcrypto.so |
54 |
// first attempt: the canonical name is libssl.so.<SHLIB_VERSION_NUMBER> |
58 |
// first attempt: the canonical name is libssl.so.<SHLIB_VERSION_NUMBER> |
55 |
- libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String(SHLIB_VERSION_NUMBER)); |
59 |
- libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String(SHLIB_VERSION_NUMBER)); |
56 |
- libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String(SHLIB_VERSION_NUMBER)); |
60 |
- libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String(SHLIB_VERSION_NUMBER)); |
57 |
+ libssl->setFileNameAndVersion(QLatin1String("%%OPENSSLLIB%%/libssl"), QLatin1String(SHLIB_VERSION_NUMBER)); |
61 |
+ libssl->setFileNameAndVersion(QLatin1String(""%%OPENSSLLIB%%/libssl"), QLatin1String(SHLIB_VERSION_NUMBER)); |
58 |
+ libcrypto->setFileNameAndVersion(QLatin1String("%%OPENSSLLIB%%/libcrypto"), QLatin1String(SHLIB_VERSION_NUMBER)); |
62 |
+ libcrypto->setFileNameAndVersion(QLatin1String(""%%OPENSSLLIB%%/libcrypto"), QLatin1String(SHLIB_VERSION_NUMBER)); |
59 |
if (libcrypto->load() && libssl->load()) { |
63 |
if (libcrypto->load() && libssl->load()) { |
60 |
// libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found |
64 |
// libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found |
61 |
return pair; |
65 |
return pair; |
62 |
@@ -787,8 +801,8 @@ static QPair<QLibrary*, QLibrary*> loadO |
66 |
@@ -800,8 +814,8 @@ static QPair<QLibrary*, QLibrary*> loadO |
63 |
// macOS's /usr/lib/libssl.dylib, /usr/lib/libcrypto.dylib will be picked up in the third |
67 |
// macOS's /usr/lib/libssl.dylib, /usr/lib/libcrypto.dylib will be picked up in the third |
64 |
// attempt, _after_ <bundle>/Contents/Frameworks has been searched. |
68 |
// attempt, _after_ <bundle>/Contents/Frameworks has been searched. |
65 |
// iOS does not ship a system libssl.dylib, libcrypto.dylib in the first place. |
69 |
// iOS does not ship a system libssl.dylib, libcrypto.dylib in the first place. |
66 |
- libssl->setFileNameAndVersion(QLatin1String("ssl"), -1); |
70 |
- libssl->setFileNameAndVersion(QLatin1String("ssl"), -1); |
67 |
- libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1); |
71 |
- libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1); |
68 |
+ libssl->setFileNameAndVersion(QLatin1String("%%OPENSSLLIB%%/libssl"), -1); |
72 |
+ libssl->setFileNameAndVersion(QLatin1String(""%%OPENSSLLIB%%/libssl"), -1); |
69 |
+ libcrypto->setFileNameAndVersion(QLatin1String("%%OPENSSLLIB%%/libcrypto"), -1); |
73 |
+ libcrypto->setFileNameAndVersion(QLatin1String(""%%OPENSSLLIB%%/libcrypto"), -1); |
70 |
if (libcrypto->load() && libssl->load()) { |
74 |
if (libcrypto->load() && libssl->load()) { |
71 |
// libssl.so.0 and libcrypto.so.0 found |
75 |
// libssl.so.0 and libcrypto.so.0 found |
72 |
return pair; |
76 |
return pair; |
73 |
@@ -872,17 +886,30 @@ bool q_resolveOpenSslSymbols() |
77 |
@@ -885,17 +899,30 @@ bool q_resolveOpenSslSymbols() |
74 |
RESOLVEFUNC(EVP_CIPHER_CTX_reset) |
78 |
RESOLVEFUNC(EVP_CIPHER_CTX_reset) |
75 |
RESOLVEFUNC(EVP_PKEY_base_id) |
79 |
RESOLVEFUNC(EVP_PKEY_base_id) |
76 |
RESOLVEFUNC(RSA_bits) |
80 |
RESOLVEFUNC(RSA_bits) |
Lines 102-108
Link Here
|
102 |
RESOLVEFUNC(SSL_get_session) |
106 |
RESOLVEFUNC(SSL_get_session) |
103 |
RESOLVEFUNC(CRYPTO_get_ex_new_index) |
107 |
RESOLVEFUNC(CRYPTO_get_ex_new_index) |
104 |
RESOLVEFUNC(TLS_method) |
108 |
RESOLVEFUNC(TLS_method) |
105 |
@@ -891,7 +918,9 @@ bool q_resolveOpenSslSymbols() |
109 |
@@ -904,7 +931,9 @@ bool q_resolveOpenSslSymbols() |
106 |
RESOLVEFUNC(X509_STORE_CTX_get0_chain) |
110 |
RESOLVEFUNC(X509_STORE_CTX_get0_chain) |
107 |
RESOLVEFUNC(X509_getm_notBefore) |
111 |
RESOLVEFUNC(X509_getm_notBefore) |
108 |
RESOLVEFUNC(X509_getm_notAfter) |
112 |
RESOLVEFUNC(X509_getm_notAfter) |
Lines 112-118
Link Here
|
112 |
RESOLVEFUNC(X509_get_pubkey) |
116 |
RESOLVEFUNC(X509_get_pubkey) |
113 |
RESOLVEFUNC(X509_STORE_set_verify_cb) |
117 |
RESOLVEFUNC(X509_STORE_set_verify_cb) |
114 |
RESOLVEFUNC(CRYPTO_free) |
118 |
RESOLVEFUNC(CRYPTO_free) |
115 |
@@ -908,7 +937,9 @@ bool q_resolveOpenSslSymbols() |
119 |
@@ -921,7 +950,9 @@ bool q_resolveOpenSslSymbols() |
116 |
|
120 |
|
117 |
RESOLVEFUNC(SSL_SESSION_get_ticket_lifetime_hint) |
121 |
RESOLVEFUNC(SSL_SESSION_get_ticket_lifetime_hint) |
118 |
RESOLVEFUNC(DH_bits) |
122 |
RESOLVEFUNC(DH_bits) |
Lines 122-128
Link Here
|
122 |
|
126 |
|
123 |
#else // !opensslv11 |
127 |
#else // !opensslv11 |
124 |
|
128 |
|
125 |
@@ -979,10 +1010,9 @@ bool q_resolveOpenSslSymbols() |
129 |
@@ -992,10 +1023,9 @@ bool q_resolveOpenSslSymbols() |
126 |
RESOLVEFUNC(OPENSSL_add_all_algorithms_conf) |
130 |
RESOLVEFUNC(OPENSSL_add_all_algorithms_conf) |
127 |
RESOLVEFUNC(SSLeay) |
131 |
RESOLVEFUNC(SSLeay) |
128 |
|
132 |
|
Lines 134-140
Link Here
|
134 |
delete libs.first; |
138 |
delete libs.first; |
135 |
delete libs.second; |
139 |
delete libs.second; |
136 |
qCWarning(lcSsl, "Incompatible version of OpenSSL"); |
140 |
qCWarning(lcSsl, "Incompatible version of OpenSSL"); |
137 |
@@ -994,8 +1024,12 @@ bool q_resolveOpenSslSymbols() |
141 |
@@ -1007,8 +1037,12 @@ bool q_resolveOpenSslSymbols() |
138 |
|
142 |
|
139 |
#ifndef OPENSSL_NO_EC |
143 |
#ifndef OPENSSL_NO_EC |
140 |
#if OPENSSL_VERSION_NUMBER >= 0x10002000L |
144 |
#if OPENSSL_VERSION_NUMBER >= 0x10002000L |
Lines 148-150
Link Here
|
148 |
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L |
152 |
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L |
149 |
#endif // OPENSSL_NO_EC |
153 |
#endif // OPENSSL_NO_EC |
150 |
|
154 |
|
|
|
155 |
@@ -1122,7 +1156,7 @@ bool q_resolveOpenSslSymbols() |
156 |
RESOLVEFUNC(SSL_CTX_use_RSAPrivateKey) |
157 |
RESOLVEFUNC(SSL_CTX_use_PrivateKey_file) |
158 |
RESOLVEFUNC(SSL_CTX_get_cert_store); |
159 |
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L |
160 |
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER) |
161 |
RESOLVEFUNC(SSL_CONF_CTX_new); |
162 |
RESOLVEFUNC(SSL_CONF_CTX_free); |
163 |
RESOLVEFUNC(SSL_CONF_CTX_set_ssl_ctx); |