Blob Blame History Raw
From 36dcccb94bef72a7c4cf6acf7479f18568e545bb Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Tue, 2 May 2017 17:19:20 +0200
Subject: [PATCH] module: drop link-time vs. run-time TLS backend check

This effectively reverts the following commit:
8891398a31119ce7c872509ed60328926c51cdfb

Bug: https://bugzilla.redhat.com/1446850
---
 src/module.c | 62 ----------------------------------------------------
 1 file changed, 62 deletions(-)

diff --git a/src/module.c b/src/module.c
index a7108a0..af79875 100644
--- a/src/module.c
+++ b/src/module.c
@@ -328,15 +328,6 @@ initpycurl(void)
     PyObject *collections_module = NULL;
     PyObject *named_tuple = NULL;
     PyObject *arglist = NULL;
-#ifdef HAVE_CURL_GLOBAL_SSLSET
-    const curl_ssl_backend **ssllist = NULL;
-    CURLsslset sslset;
-    int i, runtime_supported_backend_found = 0;
-    char backends[200];
-    size_t backends_len = 0;
-#else
-    const char *runtime_ssl_lib;
-#endif
 
     assert(Curl_Type.tp_weaklistoffset > 0);
     assert(CurlMulti_Type.tp_weaklistoffset > 0);
@@ -354,59 +345,6 @@ initpycurl(void)
         goto error;
     }
 
-    /* Our compiled crypto locks should correspond to runtime ssl library. */
-#ifdef HAVE_CURL_GLOBAL_SSLSET
-    sslset = curl_global_sslset(-1, COMPILE_SSL_LIB, &ssllist);
-    if (sslset != CURLSSLSET_OK) {
-        if (sslset == CURLSSLSET_NO_BACKENDS) {
-            strcpy(backends, "none");
-        } else {
-            for (i = 0; ssllist[i] != NULL; i++) {
-                switch (ssllist[i]->id) {
-                case CURLSSLBACKEND_OPENSSL:
-                case CURLSSLBACKEND_GNUTLS:
-                case CURLSSLBACKEND_NSS:
-                case CURLSSLBACKEND_WOLFSSL:
-                case CURLSSLBACKEND_MBEDTLS:
-                    runtime_supported_backend_found = 1;
-                    break;
-                default:
-                    break;
-                }
-                if (backends_len < sizeof(backends)) {
-                    backends_len += snprintf(backends + backends_len, sizeof(backends) - backends_len, "%s%s", (i > 0) ? ", " : "", ssllist[i]->name);
-                }
-            }
-        }
-        /* Don't error if both the curl library and pycurl itself is compiled without SSL */
-        if (runtime_supported_backend_found || COMPILE_SUPPORTED_SSL_BACKEND_FOUND) {
-            PyErr_Format(PyExc_ImportError, "pycurl: libcurl link-time ssl backends (%s) do not include compile-time ssl backend (%s)", backends, COMPILE_SSL_LIB);
-            goto error;
-        }
-    }
-#else
-    if (vi->ssl_version == NULL) {
-        runtime_ssl_lib = "none/other";
-    } else if (!strncmp(vi->ssl_version, "OpenSSL/", 8) || !strncmp(vi->ssl_version, "LibreSSL/", 9) ||
-               !strncmp(vi->ssl_version, "BoringSSL", 9)) {
-        runtime_ssl_lib = "openssl";
-    } else if (!strncmp(vi->ssl_version, "wolfSSL/", 8)) {
-        runtime_ssl_lib = "wolfssl";
-    } else if (!strncmp(vi->ssl_version, "GnuTLS/", 7)) {
-        runtime_ssl_lib = "gnutls";
-    } else if (!strncmp(vi->ssl_version, "NSS/", 4)) {
-        runtime_ssl_lib = "nss";
-    } else if (!strncmp(vi->ssl_version, "mbedTLS/", 8)) {
-        runtime_ssl_lib = "mbedtls";
-    } else {
-        runtime_ssl_lib = "none/other";
-    }
-    if (strcmp(runtime_ssl_lib, COMPILE_SSL_LIB)) {
-        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);
-        goto error;
-    }
-#endif
-
     /* Initialize the type of the new type objects here; doing it here
      * is required for portability to Windows without requiring C++. */
     p_Curl_Type = &Curl_Type;
-- 
2.10.2