]>
Commit | Line | Data |
---|---|---|
bbc27441 | 1 | /* |
ef57eb7b | 2 | * Copyright (C) 1996-2016 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 | ||
95d2589c CT |
9 | #ifndef SQUID_SSL_HELPER_H |
10 | #define SQUID_SSL_HELPER_H | |
11 | ||
0e208dad | 12 | #include "base/AsyncJobCalls.h" |
602d9612 | 13 | #include "base/LruMap.h" |
24438ec5 | 14 | #include "helper/forward.h" |
14798e73 | 15 | #include "ssl/cert_validate_message.h" |
95d2589c CT |
16 | #include "ssl/crtd_message.h" |
17 | ||
18 | namespace Ssl | |
19 | { | |
cb0b3d63 | 20 | #if USE_SSL_CRTD |
95d2589c CT |
21 | /** |
22 | * Set of thread for ssl_crtd. This class is singleton. Use this class only | |
23 | * over GetIntance() static method. This class use helper structure | |
24 | * for threads management. | |
25 | */ | |
26 | class Helper | |
27 | { | |
28 | public: | |
29 | static Helper * GetInstance(); ///< Instance class. | |
30 | void Init(); ///< Init helper structure. | |
31 | void Shutdown(); ///< Shutdown helper structure. | |
32 | /// Submit crtd message to external crtd server. | |
33 | void sslSubmit(CrtdMessage const & message, HLPCB * callback, void *data); | |
34 | private: | |
35 | Helper(); | |
36 | ~Helper(); | |
37 | ||
38 | helper * ssl_crtd; ///< helper for management of ssl_crtd. | |
39 | }; | |
4a77bb4e | 40 | #endif |
95d2589c | 41 | |
0e208dad | 42 | class PeerConnector; |
14798e73 CT |
43 | class CertValidationRequest; |
44 | class CertValidationResponse; | |
2cef0ca6 AR |
45 | class CertValidationHelper |
46 | { | |
47 | public: | |
0e208dad CT |
48 | typedef UnaryMemFunT<Ssl::PeerConnector, CertValidationResponse::Pointer> CbDialer; |
49 | ||
14798e73 | 50 | typedef void CVHCB(void *, Ssl::CertValidationResponse const &); |
2cef0ca6 AR |
51 | static CertValidationHelper * GetInstance(); ///< Instance class. |
52 | void Init(); ///< Init helper structure. | |
53 | void Shutdown(); ///< Shutdown helper structure. | |
14798e73 | 54 | /// Submit crtd request message to external crtd server. |
0e208dad | 55 | void sslSubmit(Ssl::CertValidationRequest const & request, AsyncCall::Pointer &); |
2cef0ca6 AR |
56 | private: |
57 | CertValidationHelper(); | |
58 | ~CertValidationHelper(); | |
59 | ||
60 | helper * ssl_crt_validator; ///< helper for management of ssl_crtd. | |
14798e73 | 61 | public: |
0e208dad CT |
62 | typedef LruMap<Ssl::CertValidationResponse::Pointer, sizeof(Ssl::CertValidationResponse::Pointer) + sizeof(Ssl::CertValidationResponse)> LruCache; |
63 | static LruCache *HelperCache; ///< cache for cert validation helper | |
2cef0ca6 AR |
64 | }; |
65 | ||
95d2589c CT |
66 | } //namespace Ssl |
67 | #endif // SQUID_SSL_HELPER_H | |
f53969cc | 68 |