|
|
1178d8 |
From 36dcccb94bef72a7c4cf6acf7479f18568e545bb Mon Sep 17 00:00:00 2001
|
|
|
1178d8 |
From: Kamil Dudka <kdudka@redhat.com>
|
|
|
1178d8 |
Date: Tue, 2 May 2017 17:19:20 +0200
|
|
|
1178d8 |
Subject: [PATCH] module: drop link-time vs. run-time TLS backend check
|
|
|
1178d8 |
|
|
|
1178d8 |
This effectively reverts the following commit:
|
|
|
1178d8 |
8891398a31119ce7c872509ed60328926c51cdfb
|
|
|
1178d8 |
|
|
|
1178d8 |
Bug: https://bugzilla.redhat.com/1446850
|
|
|
1178d8 |
---
|
|
|
1178d8 |
src/module.c | 62 ----------------------------------------------------
|
|
|
1178d8 |
1 file changed, 62 deletions(-)
|
|
|
1178d8 |
|
|
|
1178d8 |
diff --git a/src/module.c b/src/module.c
|
|
|
1178d8 |
index a7108a0..af79875 100644
|
|
|
1178d8 |
--- a/src/module.c
|
|
|
1178d8 |
+++ b/src/module.c
|
|
|
1178d8 |
@@ -328,15 +328,6 @@ initpycurl(void)
|
|
|
1178d8 |
PyObject *collections_module = NULL;
|
|
|
1178d8 |
PyObject *named_tuple = NULL;
|
|
|
1178d8 |
PyObject *arglist = NULL;
|
|
|
1178d8 |
-#ifdef HAVE_CURL_GLOBAL_SSLSET
|
|
|
1178d8 |
- const curl_ssl_backend **ssllist = NULL;
|
|
|
1178d8 |
- CURLsslset sslset;
|
|
|
1178d8 |
- int i, runtime_supported_backend_found = 0;
|
|
|
1178d8 |
- char backends[200];
|
|
|
1178d8 |
- size_t backends_len = 0;
|
|
|
1178d8 |
-#else
|
|
|
1178d8 |
- const char *runtime_ssl_lib;
|
|
|
1178d8 |
-#endif
|
|
|
1178d8 |
|
|
|
1178d8 |
assert(Curl_Type.tp_weaklistoffset > 0);
|
|
|
1178d8 |
assert(CurlMulti_Type.tp_weaklistoffset > 0);
|
|
|
1178d8 |
@@ -354,59 +345,6 @@ initpycurl(void)
|
|
|
1178d8 |
goto error;
|
|
|
1178d8 |
}
|
|
|
1178d8 |
|
|
|
1178d8 |
- /* Our compiled crypto locks should correspond to runtime ssl library. */
|
|
|
1178d8 |
-#ifdef HAVE_CURL_GLOBAL_SSLSET
|
|
|
1178d8 |
- sslset = curl_global_sslset(-1, COMPILE_SSL_LIB, &ssllist);
|
|
|
1178d8 |
- if (sslset != CURLSSLSET_OK) {
|
|
|
1178d8 |
- if (sslset == CURLSSLSET_NO_BACKENDS) {
|
|
|
1178d8 |
- strcpy(backends, "none");
|
|
|
1178d8 |
- } else {
|
|
|
1178d8 |
- for (i = 0; ssllist[i] != NULL; i++) {
|
|
|
1178d8 |
- switch (ssllist[i]->id) {
|
|
|
1178d8 |
- case CURLSSLBACKEND_OPENSSL:
|
|
|
1178d8 |
- case CURLSSLBACKEND_GNUTLS:
|
|
|
1178d8 |
- case CURLSSLBACKEND_NSS:
|
|
|
1178d8 |
- case CURLSSLBACKEND_WOLFSSL:
|
|
|
1178d8 |
- case CURLSSLBACKEND_MBEDTLS:
|
|
|
1178d8 |
- runtime_supported_backend_found = 1;
|
|
|
1178d8 |
- break;
|
|
|
1178d8 |
- default:
|
|
|
1178d8 |
- break;
|
|
|
1178d8 |
- }
|
|
|
1178d8 |
- if (backends_len < sizeof(backends)) {
|
|
|
1178d8 |
- backends_len += snprintf(backends + backends_len, sizeof(backends) - backends_len, "%s%s", (i > 0) ? ", " : "", ssllist[i]->name);
|
|
|
1178d8 |
- }
|
|
|
1178d8 |
- }
|
|
|
1178d8 |
- }
|
|
|
1178d8 |
- /* Don't error if both the curl library and pycurl itself is compiled without SSL */
|
|
|
1178d8 |
- if (runtime_supported_backend_found || COMPILE_SUPPORTED_SSL_BACKEND_FOUND) {
|
|
|
1178d8 |
- PyErr_Format(PyExc_ImportError, "pycurl: libcurl link-time ssl backends (%s) do not include compile-time ssl backend (%s)", backends, COMPILE_SSL_LIB);
|
|
|
1178d8 |
- goto error;
|
|
|
1178d8 |
- }
|
|
|
1178d8 |
- }
|
|
|
1178d8 |
-#else
|
|
|
1178d8 |
- if (vi->ssl_version == NULL) {
|
|
|
1178d8 |
- runtime_ssl_lib = "none/other";
|
|
|
1178d8 |
- } else if (!strncmp(vi->ssl_version, "OpenSSL/", 8) || !strncmp(vi->ssl_version, "LibreSSL/", 9) ||
|
|
|
1178d8 |
- !strncmp(vi->ssl_version, "BoringSSL", 9)) {
|
|
|
1178d8 |
- runtime_ssl_lib = "openssl";
|
|
|
1178d8 |
- } else if (!strncmp(vi->ssl_version, "wolfSSL/", 8)) {
|
|
|
1178d8 |
- runtime_ssl_lib = "wolfssl";
|
|
|
1178d8 |
- } else if (!strncmp(vi->ssl_version, "GnuTLS/", 7)) {
|
|
|
1178d8 |
- runtime_ssl_lib = "gnutls";
|
|
|
1178d8 |
- } else if (!strncmp(vi->ssl_version, "NSS/", 4)) {
|
|
|
1178d8 |
- runtime_ssl_lib = "nss";
|
|
|
1178d8 |
- } else if (!strncmp(vi->ssl_version, "mbedTLS/", 8)) {
|
|
|
1178d8 |
- runtime_ssl_lib = "mbedtls";
|
|
|
1178d8 |
- } else {
|
|
|
1178d8 |
- runtime_ssl_lib = "none/other";
|
|
|
1178d8 |
- }
|
|
|
1178d8 |
- if (strcmp(runtime_ssl_lib, COMPILE_SSL_LIB)) {
|
|
|
1178d8 |
- PyErr_Format(PyExc_ImportError, "pycurl: libcurl link-time ssl backend (%s) is different from compile-time ssl backend (%s)", runtime_ssl_lib, COMPILE_SSL_LIB);
|
|
|
1178d8 |
- goto error;
|
|
|
1178d8 |
- }
|
|
|
1178d8 |
-#endif
|
|
|
1178d8 |
-
|
|
|
1178d8 |
/* Initialize the type of the new type objects here; doing it here
|
|
|
1178d8 |
* is required for portability to Windows without requiring C++. */
|
|
|
1178d8 |
p_Curl_Type = &Curl_Type;
|
|
|
1178d8 |
--
|
|
|
1178d8 |
2.10.2
|
|
|
1178d8 |
|