]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ssl/context_storage.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / ssl / context_storage.h
index 59dd08c7d58e242417c2026798707e2599b2d491..73b3a0895b6bbbd84c1c3e589f8c53f9e3d61c8d 100644 (file)
@@ -1,22 +1,31 @@
+/*
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef SQUID_SSL_CONTEXT_STORAGE_H
 #define SQUID_SSL_CONTEXT_STORAGE_H
 
-#if USE_SSL
+#if USE_OPENSSL
 
 #include "base/LruMap.h"
-#include "SquidTime.h"
 #include "CacheManager.h"
+#include "compat/openssl.h"
 #include "ip/Address.h"
 #include "mgr/Action.h"
 #include "mgr/Command.h"
+#include "security/forward.h"
+#include "SquidTime.h"
 #include "ssl/gadgets.h"
-#if HAVE_MAP
-#include <map>
-#endif
-#if HAVE_LIST
+
 #include <list>
-#endif
+#include <map>
+#if HAVE_OPENSSL_SSL_H
 #include <openssl/ssl.h>
+#endif
 
 /// TODO: Replace on real size.
 #define SSL_CTX_SIZE 1024
@@ -40,7 +49,7 @@ public:
     virtual bool aggregatable() const { return false; }
 };
 
-typedef LruMap<SSL_CTX_Pointer, SSL_CTX_SIZE> LocalContextStorage;
+typedef LruMap<SBuf, Security::ContextPointer, SSL_CTX_SIZE> LocalContextStorage;
 
 /// Class for storing/manipulating LocalContextStorage per local listening address/port.
 class GlobalContextStorage
@@ -52,7 +61,7 @@ public:
     /// Create new SSL context storage for the local listening address/port.
     void addLocalStorage(Ip::Address const & address, size_t size_of_store);
     /// Return the local storage for the given listening address/port.
-    LocalContextStorage getLocalStorage(Ip::Address const & address);
+    LocalContextStorage *getLocalStorage(Ip::Address const & address);
     /// When reconfigring should be called this method.
     void reconfigureStart();
 private:
@@ -68,6 +77,7 @@ private:
 /// Global cache for store all SSL server certificates.
 extern GlobalContextStorage TheGlobalContextStorage;
 } //namespace Ssl
-#endif // USE_SSL
+#endif // USE_OPENSSL
 
 #endif // SQUID_SSL_CONTEXT_STORAGE_H
+