]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixes to allow compile with older openSSL versions
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 23 May 2014 15:29:40 +0000 (18:29 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 23 May 2014 15:29:40 +0000 (18:29 +0300)
src/ssl/PeerConnector.cc
src/ssl/bio.cc

index 62dcad1f3e170d64432c23bd2bfbe2eae15f816e..72c3262ec217f5f50da9f9465ec6a7fdaa561b61 100644 (file)
@@ -145,8 +145,10 @@ Ssl::PeerConnector::initializeSsl()
         const Ssl::Bio::sslFeatures &features = clnBio->getFeatures();
         if (features.sslVersion != -1) {
             SSL_set_ssl_method(ssl, Ssl::method(features.toSquidSSLVersion()));
+#ifdef TLSEXT_NAMETYPE_host_name
             if (!features.serverName.empty())
                 SSL_set_tlsext_host_name(ssl, features.serverName.c_str());
+#endif
             if (!features.clientRequestedCiphers.empty())
                 SSL_set_cipher_list(ssl, features.clientRequestedCiphers.c_str());
 #ifdef SSL_OP_NO_COMPRESSION /* XXX: OpenSSL 0.9.8k lacks SSL_OP_NO_COMPRESSION */
index 58c58a7cd3daa357243127801d0dcbd126bd8c61..75cee5a5c1b97098a4dbcc81a444e0b38c4d4339 100644 (file)
@@ -349,7 +349,9 @@ adjustSSL(SSL *ssl, Ssl::Bio::sslFeatures &features, bool force)
 
     for (std::list<int>::iterator it = features.extensions.begin(); it != features.extensions.end(); ++it) {
         static int supportedExtensions[] = {
+#ifdef TLSEXT_TYPE_server_name
             TLSEXT_TYPE_server_name,
+#endif
 #ifdef TLSEXT_TYPE_opaque_prf_input
             TLSEXT_TYPE_opaque_prf_input,
 #endif
@@ -413,7 +415,7 @@ adjustSSL(SSL *ssl, Ssl::Bio::sslFeatures &features, bool force)
 
     size_t mainHelloSize = features.helloMessage.contentSize() - 5;
     const char *mainHello = features.helloMessage.content() + 5;
-    assert(ssl->init_buf->max > mainHelloSize);
+    assert((size_t)ssl->init_buf->max > mainHelloSize);
     memcpy(ssl->init_buf->data, mainHello, mainHelloSize);
     debugs(83, 5, "Hello Data init and adjustd sizes :" << ssl->init_num << " = "<< mainHelloSize);
     ssl->init_num = mainHelloSize;
@@ -652,9 +654,11 @@ Ssl::Bio::sslFeatures::get(const SSL *ssl)
     sslVersion = SSL_version(ssl);
     debugs(83, 7, "SSL version: " << SSL_get_version(ssl) << " (" << sslVersion << ")");
 
+#if defined(TLSEXT_NAMETYPE_host_name) 
     if(const char *server = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name))
         serverName = server;
     debugs(83, 7, "SNI server name: " << serverName);
+#endif
 
     if (ssl->session->compress_meth)
             compressMethod = ssl->session->compress_meth;