]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ssl/helper.h
CI: Upgrade GitHub Setup Node and CodeQL actions to Node 20 (#1845)
[thirdparty/squid.git] / src / ssl / helper.h
1 /*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
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
9 #ifndef SQUID_SRC_SSL_HELPER_H
10 #define SQUID_SRC_SSL_HELPER_H
11
12 #if USE_OPENSSL
13
14 #include "base/AsyncJobCalls.h"
15 #include "base/ClpMap.h"
16 #include "helper/forward.h"
17 #include "security/forward.h"
18 #include "ssl/cert_validate_message.h"
19 #include "ssl/crtd_message.h"
20
21 namespace Ssl
22 {
23 #if USE_SSL_CRTD
24 /**
25 * Set of thread for ssl_crtd. This class is singleton.
26 * This class use helper structure for threads management.
27 */
28 class Helper
29 {
30 public:
31 static void Init(); ///< Init helper structure.
32 static void Shutdown(); ///< Shutdown helper structure.
33 static void Reconfigure(); ///< Reconfigure helper structure.
34 /// Submit crtd message to external crtd server.
35 static void Submit(CrtdMessage const & message, HLPCB * callback, void *data);
36 private:
37 static ::Helper::ClientPointer ssl_crtd; ///< helper for management of ssl_crtd.
38 };
39 #endif
40
41 class CertValidationRequest;
42 class CertValidationResponse;
43 class CertValidationHelper
44 {
45 public:
46 using Answer = CertValidationResponse::Pointer;
47 using Callback = AsyncCallback<Answer>;
48
49 typedef void CVHCB(void *, Ssl::CertValidationResponse const &);
50 static void Init(); ///< Init helper structure.
51 static void Shutdown(); ///< Shutdown helper structure.
52 static void Reconfigure(); ///< Reconfigure helper structure
53 /// Submit crtd request message to external crtd server.
54 static void Submit(const Ssl::CertValidationRequest &, const Callback &);
55 private:
56 static ::Helper::ClientPointer ssl_crt_validator; ///< helper for management of ssl_crtd.
57 public:
58 typedef ClpMap<SBuf, CertValidationResponse::Pointer, CertValidationResponse::MemoryUsedByResponse> CacheType;
59 static CacheType *HelperCache; ///< cache for cert validation helper
60 };
61
62 } //namespace Ssl
63
64 #endif /* USE_OPENSSL */
65 #endif /* SQUID_SRC_SSL_HELPER_H */
66