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