Blame SOURCES/0002-python-pycurl-7.43.0-tls-backend.patch

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