]> git.ipfire.org Git - thirdparty/squid.git/blob - src/security/forward.h
Cleanup: add Security::ContextPointer as smart pointer to SSL_CTX*
[thirdparty/squid.git] / src / security / forward.h
1 /*
2 * Copyright (C) 1996-2015 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_SECURITY_FORWARD_H
10 #define SQUID_SRC_SECURITY_FORWARD_H
11
12 #include "security/Context.h"
13 #include "security/Session.h"
14
15 #if USE_GNUTLS
16 #if HAVE_GNUTLS_X509_H
17 #include <gnutls/x509.h>
18 #endif
19 #endif
20 #include <list>
21
22 /* flags a SSL connection can be configured with */
23 #define SSL_FLAG_NO_DEFAULT_CA (1<<0)
24 #define SSL_FLAG_DELAYED_AUTH (1<<1)
25 #define SSL_FLAG_DONT_VERIFY_PEER (1<<2)
26 #define SSL_FLAG_DONT_VERIFY_DOMAIN (1<<3)
27 #define SSL_FLAG_NO_SESSION_REUSE (1<<4)
28 #define SSL_FLAG_VERIFY_CRL (1<<5)
29 #define SSL_FLAG_VERIFY_CRL_ALL (1<<6)
30
31 /// Network/connection security abstraction layer
32 namespace Security
33 {
34
35 class EncryptorAnswer;
36 class PeerOptions;
37 class ServerOptions;
38
39 #if USE_OPENSSL
40 CtoCpp1(X509_free, X509 *)
41 typedef Security::LockingPointer<X509, X509_free_cpp, CRYPTO_LOCK_X509> CertPointer;
42 #elif USE_GNUTLS
43 CtoCpp1(gnutls_x509_crt_deinit, gnutls_x509_crt_t)
44 typedef Security::LockingPointer<struct gnutls_x509_crt_int, gnutls_x509_crt_deinit, -1> CertPointer;
45 #else
46 typedef void * CertPointer;
47 #endif
48
49 #if USE_OPENSSL
50 CtoCpp1(X509_CRL_free, X509_CRL *)
51 typedef LockingPointer<X509_CRL, X509_CRL_free_cpp, CRYPTO_LOCK_X509_CRL> CrlPointer;
52 #elif USE_GNUTLS
53 CtoCpp1(gnutls_x509_crl_deinit, gnutls_x509_crl_t)
54 typedef Security::LockingPointer<struct gnutls_x509_crl_int, gnutls_x509_crl_deinit, -1> CrlPointer;
55 #else
56 typedef void *CrlPointer;
57 #endif
58
59 typedef std::list<Security::CrlPointer> CertRevokeList;
60
61 #if USE_OPENSSL
62 CtoCpp1(DH_free, DH *);
63 typedef Security::LockingPointer<DH, DH_free_cpp, CRYPTO_LOCK_DH> DhePointer;
64 #else
65 typedef void *DhePointer;
66 #endif
67
68 } // namespace Security
69
70 #endif /* SQUID_SRC_SECURITY_FORWARD_H */
71