]>
Commit | Line | Data |
---|---|---|
bbc27441 | 1 | /* |
1f7b830e | 2 | * Copyright (C) 1996-2025 The Squid Software Foundation and contributors |
bbc27441 AJ |
3 | * |
4 | * Squid software is distributed under GPLv2+ license and includes | |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
7 | */ | |
8 | ||
ff9d9458 FC |
9 | #ifndef SQUID_SRC_SSL_HELPER_H |
10 | #define SQUID_SRC_SSL_HELPER_H | |
95d2589c | 11 | |
a72b6e88 AJ |
12 | #if USE_OPENSSL |
13 | ||
0e208dad | 14 | #include "base/AsyncJobCalls.h" |
72247610 | 15 | #include "base/ClpMap.h" |
24438ec5 | 16 | #include "helper/forward.h" |
a72b6e88 | 17 | #include "security/forward.h" |
14798e73 | 18 | #include "ssl/cert_validate_message.h" |
95d2589c CT |
19 | #include "ssl/crtd_message.h" |
20 | ||
21 | namespace Ssl | |
22 | { | |
cb0b3d63 | 23 | #if USE_SSL_CRTD |
95d2589c | 24 | /** |
23da195f CT |
25 | * Set of thread for ssl_crtd. This class is singleton. |
26 | * This class use helper structure for threads management. | |
95d2589c CT |
27 | */ |
28 | class Helper | |
29 | { | |
30 | public: | |
23da195f CT |
31 | static void Init(); ///< Init helper structure. |
32 | static void Shutdown(); ///< Shutdown helper structure. | |
33 | static void Reconfigure(); ///< Reconfigure helper structure. | |
95d2589c | 34 | /// Submit crtd message to external crtd server. |
23da195f | 35 | static void Submit(CrtdMessage const & message, HLPCB * callback, void *data); |
95d2589c | 36 | private: |
3bd118d6 | 37 | static ::Helper::ClientPointer ssl_crtd; ///< helper for management of ssl_crtd. |
95d2589c | 38 | }; |
4a77bb4e | 39 | #endif |
95d2589c | 40 | |
14798e73 CT |
41 | class CertValidationRequest; |
42 | class CertValidationResponse; | |
2cef0ca6 AR |
43 | class CertValidationHelper |
44 | { | |
45 | public: | |
e5ddd4ce AR |
46 | using Answer = CertValidationResponse::Pointer; |
47 | using Callback = AsyncCallback<Answer>; | |
0e208dad | 48 | |
14798e73 | 49 | typedef void CVHCB(void *, Ssl::CertValidationResponse const &); |
23da195f CT |
50 | static void Init(); ///< Init helper structure. |
51 | static void Shutdown(); ///< Shutdown helper structure. | |
52 | static void Reconfigure(); ///< Reconfigure helper structure | |
14798e73 | 53 | /// Submit crtd request message to external crtd server. |
e5ddd4ce | 54 | static void Submit(const Ssl::CertValidationRequest &, const Callback &); |
2cef0ca6 | 55 | private: |
3bd118d6 | 56 | static ::Helper::ClientPointer ssl_crt_validator; ///< helper for management of ssl_crtd. |
14798e73 | 57 | public: |
72247610 AJ |
58 | typedef ClpMap<SBuf, CertValidationResponse::Pointer, CertValidationResponse::MemoryUsedByResponse> CacheType; |
59 | static CacheType *HelperCache; ///< cache for cert validation helper | |
2cef0ca6 AR |
60 | }; |
61 | ||
95d2589c | 62 | } //namespace Ssl |
a72b6e88 AJ |
63 | |
64 | #endif /* USE_OPENSSL */ | |
ff9d9458 | 65 | #endif /* SQUID_SRC_SSL_HELPER_H */ |
f53969cc | 66 |