]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4347: compile errors with LibreSSL 2.3
authorStuart Henderson <stu@spacehopper.org>
Sun, 11 Oct 2015 05:36:19 +0000 (22:36 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 11 Oct 2015 05:36:19 +0000 (22:36 -0700)
src/ssl/bio.cc
src/ssl/support.cc

index ba3d680530a8bd17c8f2833c121fef5b975cb311..90cd21443d3be3e2b9e963f7550476ce388b4e46 100644 (file)
@@ -1009,7 +1009,11 @@ Ssl::Bio::sslFeatures::parseV3Hello(const unsigned char *messageContainer, size_
 
     ciphers += 2;
     if (ciphersLen) {
-        const SSL_METHOD *method = SSLv3_method();
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+        const SSL_METHOD *method = TLS_method();
+#else
+        const SSL_METHOD *method = SSLv23_method();
+#endif
         for (size_t i = 0; i < ciphersLen; i += 2) {
             // each cipher in v3/tls  HELLO message is of size 2
             const SSL_CIPHER *c = method->get_cipher_by_char((ciphers + i));
@@ -1106,7 +1110,11 @@ Ssl::Bio::sslFeatures::parseV23Hello(const unsigned char *hello, size_t size)
         return false;
 
     if (ciphersLen) {
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+        const SSL_METHOD *method = TLS_method();
+#else
         const SSL_METHOD *method = SSLv23_method();
+#endif
         for (unsigned int i = 0; i < ciphersLen; i += 3) {
             // The v2 hello messages cipher has 3 bytes.
             // The v2 cipher has the first byte not null
index 85305ce895337fbecd718b7ab31f3c8bf7f6fd3f..7ffa5fb822ed32905d0d583572cebf71a27ea386 100644 (file)
@@ -1070,8 +1070,13 @@ Ssl::method(int version)
         break;
 
     case 3:
+#if !defined(OPENSSL_NO_SSL3)
         debugs(83, 5, "Using SSLv3.");
         return SSLv3_client_method();
+#else
+        debugs(83, DBG_IMPORTANT, "SSLv3 is not available in this Proxy.");
+        return NULL;
+#endif
         break;
 
     case 4:
@@ -1117,7 +1122,7 @@ Ssl::serverMethod(int version)
     switch (version) {
 
     case 2:
-#ifndef OPENSSL_NO_SSL2
+#if !defined(OPENSSL_NO_SSL2)
         debugs(83, 5, "Using SSLv2.");
         return SSLv2_server_method();
 #else
@@ -1127,8 +1132,13 @@ Ssl::serverMethod(int version)
         break;
 
     case 3:
+#if !defined(OPENSSL_NO_SSL3)
         debugs(83, 5, "Using SSLv3.");
         return SSLv3_server_method();
+#else
+        debugs(83, DBG_IMPORTANT, "SSLv3 is not available in this Proxy.");
+        return NULL;
+#endif
         break;
 
     case 4:
@@ -1543,7 +1553,7 @@ Ssl::contextMethod(int version)
     switch (version) {
 
     case 2:
-#ifndef OPENSSL_NO_SSL2
+#if !defined(OPENSSL_NO_SSL2)
         debugs(83, 5, "Using SSLv2.");
         method = SSLv2_server_method();
 #else
@@ -1553,8 +1563,13 @@ Ssl::contextMethod(int version)
         break;
 
     case 3:
+#if !defined(OPENSSL_NO_SSL3)
         debugs(83, 5, "Using SSLv3.");
         method = SSLv3_server_method();
+#else
+        debugs(83, DBG_IMPORTANT, "SSLv3 is not available in this Proxy.");
+        return NULL;
+#endif
         break;
 
     case 4: