]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: remove last SSL_CTX_Pointer uses
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 27 Jan 2016 04:41:56 +0000 (17:41 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 27 Jan 2016 04:41:56 +0000 (17:41 +1300)
src/client_side.cc
src/ssl/context_storage.h
src/ssl/gadgets.h
src/ssl/support.cc

index 8c87acc9e6d33ce206d3f422977f80d91be4a3df..791697708004726c7536b9be682fea85e1445dd8 100644 (file)
@@ -3673,7 +3673,7 @@ ConnStateData::getSslContextStart()
             debugs(33, 5, "Finding SSL certificate for " << sslBumpCertKey << " in cache");
             Ssl::LocalContextStorage * ssl_ctx_cache = Ssl::TheGlobalContextStorage.getLocalStorage(port->s);
             Security::ContextPtr dynCtx = nullptr;
-            Ssl::SSL_CTX_Pointer *cachedCtx = ssl_ctx_cache ? ssl_ctx_cache->get(sslBumpCertKey.termedBuf()) : NULL;
+            Security::ContextPointer *cachedCtx = ssl_ctx_cache ? ssl_ctx_cache->get(sslBumpCertKey.termedBuf()) : nullptr;
             if (cachedCtx && (dynCtx = cachedCtx->get())) {
                 debugs(33, 5, "SSL certificate for " << sslBumpCertKey << " found in cache");
                 if (Ssl::verifySslCertificate(dynCtx, certProperties)) {
@@ -3746,7 +3746,7 @@ ConnStateData::getSslContextDone(Security::ContextPtr sslContext, bool isNew)
         Ssl::LocalContextStorage *ssl_ctx_cache = Ssl::TheGlobalContextStorage.getLocalStorage(port->s);
         assert(sslBumpCertKey.size() > 0 && sslBumpCertKey[0] != '\0');
         if (sslContext) {
-            if (!ssl_ctx_cache || !ssl_ctx_cache->add(sslBumpCertKey.termedBuf(), new Ssl::SSL_CTX_Pointer(sslContext))) {
+            if (!ssl_ctx_cache || !ssl_ctx_cache->add(sslBumpCertKey.termedBuf(), new Security::ContextPointer(sslContext))) {
                 // If it is not in storage delete after using. Else storage deleted it.
                 fd_table[clientConnection->fd].dynamicSslContext = sslContext;
             }
index ddc383db52e2b2d87548c4cd977c168f818ca8f9..b10a7af959a1718ef3fbdaa8dd24fd0c8e21b06a 100644 (file)
@@ -16,6 +16,7 @@
 #include "ip/Address.h"
 #include "mgr/Action.h"
 #include "mgr/Command.h"
+#include "security/forward.h"
 #include "SquidTime.h"
 #include "ssl/gadgets.h"
 
@@ -47,7 +48,7 @@ public:
     virtual bool aggregatable() const { return false; }
 };
 
-typedef LruMap<SSL_CTX_Pointer, SSL_CTX_SIZE> LocalContextStorage;
+typedef LruMap<Security::ContextPointer, SSL_CTX_SIZE> LocalContextStorage;
 
 /// Class for storing/manipulating LocalContextStorage per local listening address/port.
 class GlobalContextStorage
index 30c24b1b861ffb187c35e5a6aad075927d13bc64..8b8afc912832b573db330594d766d23d213046dd 100644 (file)
@@ -66,9 +66,6 @@ typedef TidyPointer<RSA, RSA_free_cpp> RSA_Pointer;
 CtoCpp1(X509_REQ_free, X509_REQ *)
 typedef TidyPointer<X509_REQ, X509_REQ_free_cpp> X509_REQ_Pointer;
 
-CtoCpp1(SSL_CTX_free, SSL_CTX *)
-typedef TidyPointer<SSL_CTX, SSL_CTX_free_cpp> SSL_CTX_Pointer;
-
 sk_free_wrapper(sk_X509_NAME, STACK_OF(X509_NAME) *, X509_NAME_free)
 typedef TidyPointer<STACK_OF(X509_NAME), sk_X509_NAME_free_wrapper> X509_NAME_STACK_Pointer;
 
index 6b9688fb368cefe309ef5b8494d3ec1aecdf93a3..51130d200fc2031ed3c6a4190cf86c2b29a98a45 100644 (file)
@@ -937,9 +937,9 @@ Security::ContextPtr
 Ssl::createSSLContext(Security::CertPointer & x509, Ssl::EVP_PKEY_Pointer & pkey, AnyP::PortCfg &port)
 {
 #if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-    Ssl::SSL_CTX_Pointer sslContext(SSL_CTX_new(TLS_server_method()));
+    Security::ContextPointer sslContext(SSL_CTX_new(TLS_server_method()));
 #else
-    Ssl::SSL_CTX_Pointer sslContext(SSL_CTX_new(SSLv23_server_method()));
+    Security::ContextPointer sslContext(SSL_CTX_new(SSLv23_server_method()));
 #endif
 
     if (!SSL_CTX_use_certificate(sslContext.get(), x509.get()))