9#ifndef SQUID_SRC_SECURITY_FORWARD_H
10#define SQUID_SRC_SECURITY_FORWARD_H
18#if HAVE_GNUTLS_ABSTRACT_H
19#include <gnutls/abstract.h>
28#include <openssl/bn.h>
31#include <openssl/err.h>
34#include <openssl/rsa.h>
36#if HAVE_OPENSSL_X509_H
37#include <openssl/x509.h>
40#include <unordered_set>
46#define sk_dtor_wrapper(sk_object, argument_type, freefunction) \
47 struct sk_object ## _free_wrapper { \
48 void operator()(argument_type a) { sk_object ## _pop_free(a, freefunction); } \
53#define SSL_FLAG_NO_DEFAULT_CA (1<<0)
54#define SSL_FLAG_DELAYED_AUTH (1<<1)
55#define SSL_FLAG_DONT_VERIFY_PEER (1<<2)
56#define SSL_FLAG_DONT_VERIFY_DOMAIN (1<<3)
57#define SSL_FLAG_NO_SESSION_REUSE (1<<4)
58#define SSL_FLAG_VERIFY_CRL (1<<5)
59#define SSL_FLAG_VERIFY_CRL_ALL (1<<6)
60#define SSL_FLAG_CONDITIONAL_AUTH (1<<7)
62#if !USE_OPENSSL && !HAVE_LIBGNUTLS
90typedef std::shared_ptr<struct gnutls_x509_crt_int>
CertPointer;
99CtoCpp1(gnutls_x509_crl_deinit, gnutls_x509_crl_t);
113using PrivateKeyPointer = std::shared_ptr<struct gnutls_x509_privkey_int>;
115using PrivateKeyPointer = std::shared_ptr<void>;
119#if OPENSSL_VERSION_MAJOR < 3
154 return ERR_error_string(code,
nullptr);
156 return gnutls_strerror(code);
159 return "[no TLS library]";
165typedef std::unordered_set<Security::ErrorCode>
Errors;
189class CommunicationSecrets;
196typedef std::shared_ptr<struct gnutls_priority_st>
ParsedOptions;
#define CtoCpp1(function, argument)
A PeerConnector for TLS cache_peers and origin servers. No SslBump capabilities.
A combination of PeerOptions and the corresponding Context.
a single tls_key_log directive configuration and logging handler
TLS squid.conf settings for a remote server peer.
TLS squid.conf settings for a listening port.
Network/connection security abstraction layer.
Security::LockingPointer< X509_CRL, X509_CRL_free_cpp, HardFun< int, X509_CRL *, X509_CRL_up_ref > > CrlPointer
RefCount< ErrorDetail > ErrorDetailPointer
Security::LockingPointer< DH, DH_free_cpp, HardFun< int, DH *, DH_up_ref > > DhePointer
int ErrorCode
Squid-defined error code (<0), an error code returned by X.509 API, or zero.
void OpenLogs()
opens logs enabled in the current configuration
unsigned long LibErrorCode
TLS library-reported non-validation error.
CbDataList< Security::CertError > CertErrors
Holds a list of X.509 certificate errors.
Security::LockingPointer< X509, X509_free_cpp, HardFun< int, X509 *, X509_up_ref > > CertPointer
std::unordered_set< Security::ErrorCode > Errors
std::list< Security::CrlPointer > CertRevokeList
std::list< Security::CertPointer > CertList
void CloseLogs()
closes logs opened by OpenLogs()
const char * ErrorString(const LibErrorCode code)
converts numeric LibErrorCode into a human-friendlier string
void RotateLogs()
rotates logs opened by OpenLogs()
std::ostream & operator<<(std::ostream &, const EncryptorAnswer &)
@ SQUID_X509_V_ERR_INFINITE_VALIDATION
@ SQUID_X509_V_ERR_DOMAIN_MISMATCH
@ SQUID_TLS_ERR_CONNECT
failure to establish a connection with a TLS server
@ SQUID_TLS_ERR_ACCEPT
failure to accept a connection from a TLS client
@ SQUID_X509_V_ERR_CERT_CHANGE