Squid Web Cache master
Loading...
Searching...
No Matches
stub_libsecurity.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 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#include "squid.h"
10#include "AccessLogEntry.h"
11#include "comm/Connection.h"
12#include "HttpRequest.h"
13
14#define STUB_API "security/libsecurity.la"
15#include "tests/STUB.h"
16
19namespace Security
20{
22 const AsyncCallback<EncryptorAnswer> & aCallback,
23 const AccessLogEntryPointer &alp,
24 time_t) :
25 AsyncJob("Security::BlindPeerConnector"),
26 Security::PeerConnector(aServerConn, aCallback, alp, 0)
28
29bool BlindPeerConnector::initialize(Security::SessionPointer &) STUB_RETVAL(false)
30FuturePeerContext *BlindPeerConnector::peerContext() const STUB_RETVAL(nullptr)
31void BlindPeerConnector::noteNegotiationDone(ErrorState *) STUB
32}
33
34#include "security/EncryptorAnswer.h"
36std::ostream &Security::operator <<(std::ostream &os, const Security::EncryptorAnswer &) STUB_RETVAL(os)
37
38#include "security/Certificate.h"
42std::ostream &operator <<(std::ostream &os, Security::Certificate &) STUB_RETVAL(os)
43
44#include "security/Handshake.h"
47
48#include "security/Io.h"
51void Security::IoResult::printGist(std::ostream &) const STUB
52void Security::IoResult::printWithExtras(std::ostream &) const STUB
55
56#include "security/KeyData.h"
57namespace Security
58{
59void KeyData::loadFromFiles(const AnyP::PortCfg &, const char *) STUB
60}
61
62#include "security/KeyLogger.h"
64
67#if USE_OPENSSL
69#elif HAVE_LIBGNUTLS
71#endif
74SBuf Security::ErrorDetail::brief() const STUB_RETVAL(SBuf())
76const char *Security::ErrorNameFromCode(ErrorCode, bool) STUB_RETVAL("")
77
78#include "security/NegotiationHistory.h"
80void Security::NegotiationHistory::retrieveNegotiatedInfo(const Security::SessionPointer &) STUB
81void Security::NegotiationHistory::retrieveParsedInfo(Security::TlsDetails::Pointer const &) STUB
82const char *Security::NegotiationHistory::cipherName() const STUB
83const char *Security::NegotiationHistory::printTlsVersion(AnyP::ProtocolVersion const &) const STUB
84
85#include "security/PeerConnector.h"
86class TlsNegotiationDetails: public RefCountable {};
87namespace Security
88{
90 AsyncJob("Security::PeerConnector") {STUB}
91PeerConnector::~PeerConnector() STUB
92void PeerConnector::start() STUB
93bool PeerConnector::doneAll() const STUB_RETVAL(true)
94void PeerConnector::swanSong() STUB
95const char *PeerConnector::status() const STUB_RETVAL("")
96void PeerConnector::fillChecklist(ACLFilledChecklist &) const STUB
97void PeerConnector::commCloseHandler(const CommCloseCbParams &) STUB
98void PeerConnector::commTimeoutHandler(const CommTimeoutCbParams &) STUB
99bool PeerConnector::initialize(Security::SessionPointer &) STUB_RETVAL(false)
100void PeerConnector::negotiate() STUB
101bool PeerConnector::sslFinalized() STUB_RETVAL(false)
102void PeerConnector::handleNegotiationResult(const Security::IoResult &) STUB;
103void PeerConnector::noteWantRead() STUB
104void PeerConnector::noteWantWrite() STUB
105void PeerConnector::noteNegotiationError(const Security::ErrorDetailPointer &) STUB
106void PeerConnector::bail(ErrorState *) STUB
107void PeerConnector::sendSuccess() STUB
108void PeerConnector::callBack() STUB
109void PeerConnector::disconnect() STUB
110void PeerConnector::countFailingConnection() STUB
111void PeerConnector::recordNegotiationDetails() STUB
112EncryptorAnswer &PeerConnector::answer() STUB_RETREF(EncryptorAnswer)
113}
114
115#include "security/PeerOptions.h"
117
118Security::PeerOptions::PeerOptions() {
119#if USE_OPENSSL
120 parsedOptions = 0;
121#endif
123}
124void Security::PeerOptions::parse(char const*) STUB
126void Security::PeerOptions::updateTlsVersionLimits() STUB
127Security::ContextPointer Security::PeerOptions::createBlankContext() const STUB_RETVAL(Security::ContextPointer())
128void Security::PeerOptions::updateContextCa(Security::ContextPointer &) STUB
129void Security::PeerOptions::updateContextCrl(Security::ContextPointer &) STUB
130void Security::PeerOptions::updateContextTrust(Security::ContextPointer &) STUB
131void Security::PeerOptions::updateSessionOptions(Security::SessionPointer &) STUB
132void Security::PeerOptions::dumpCfg(std::ostream &, char const*) const STUB
133void Security::PeerOptions::parseOptions() STUB
134void parse_securePeerOptions(Security::PeerOptions *) STUB
135
136#include "security/ServerOptions.h"
137//Security::ServerOptions::ServerOptions(const Security::ServerOptions &) STUB
139void Security::ServerOptions::parse(const char *) STUB
140void Security::ServerOptions::dumpCfg(std::ostream &, const char *) const STUB
142void Security::ServerOptions::initServerContexts(AnyP::PortCfg&) STUB
143bool Security::ServerOptions::createStaticServerContext(AnyP::PortCfg &) STUB_RETVAL(false)
144void Security::ServerOptions::createSigningContexts(const AnyP::PortCfg &) STUB
145bool Security::ServerOptions::updateContextConfig(Security::ContextPointer &) STUB_RETVAL(false)
146void Security::ServerOptions::updateContextEecdh(Security::ContextPointer &) STUB
147void Security::ServerOptions::updateContextClientCa(Security::ContextPointer &) STUB
148void Security::ServerOptions::syncCaFiles() STUB
149void Security::ServerOptions::updateContextSessionId(Security::ContextPointer &) STUB
150
151#include "security/Session.h"
152namespace Security {
153bool CreateClientSession(FuturePeerContext &, const Comm::ConnectionPointer &, const char *) STUB_RETVAL(false)
154bool CreateServerSession(const Security::ContextPointer &, const Comm::ConnectionPointer &, Security::PeerOptions &, const char *) STUB_RETVAL(false)
159#if USE_OPENSSL
162#endif
163} // namespace Security
164
#define RefCountable
The locking interface for use on Reference-Counted classes.
Definition Lock.h:66
void parse_securePeerOptions(Security::PeerOptions *opt)
#define STUB
macro to stub a void function.
Definition STUB.h:34
#define STUB_NOP
Definition STUB.h:38
#define STUB_RETREF(x)
Definition STUB.h:52
#define STUB_RETVAL(x)
Definition STUB.h:42
#define CBDATA_NAMESPACED_CLASS_INIT(namespace, type)
Definition cbdata.h:333
an interface for those capable of configuring an ACLFilledChecklist object
a smart AsyncCall pointer for delivery of future results
interface for supplying additional information about a transaction failure
Definition Detail.h:21
Definition SBuf.h:94
BlindPeerConnector(HttpRequestPointer &aRequest, const Comm::ConnectionPointer &aServerConn, const AsyncCallback< EncryptorAnswer > &aCallback, const AccessLogEntryPointer &alp, time_t timeout=0)
~EncryptorAnswer()
deletes error if it is still set
SBuf verbose(const HttpRequestPointer &) const override
ErrorDetail(ErrorCode err_no, const CertPointer &peer, const CertPointer &broken, const char *aReason=nullptr)
void setPeerCertificate(const CertPointer &)
HandshakeParser(MessageSource)
Definition Handshake.cc:219
bool parseHello(const SBuf &data)
Definition Handshake.cc:641
a summary a TLS I/O operation outcome
Definition Io.h:19
void printWithExtras(std::ostream &) const
Definition Io.cc:58
void printGist(std::ostream &) const
reports brief summary (on one line) suitable for low-level debugging
Definition Io.cc:49
void loadFromFiles(const AnyP::PortCfg &, const char *portType)
load the contents of certFile and privateKeyFile into memory cert, pkey and chain
Definition KeyData.cc:182
void maybeLog(const Connection &, const Acl::ChecklistFiller &)
(slowly checks logging preconditions and) logs if possible
Definition KeyLogger.cc:22
PeerConnector(const Comm::ConnectionPointer &aServerConn, const AsyncCallback< EncryptorAnswer > &, const AccessLogEntryPointer &alp, const time_t timeout=0)
TLS squid.conf settings for a remote server peer.
Definition PeerOptions.h:26
Security::ContextPointer createClientContext(bool setOptions)
generate a security client-context from these configured options
virtual void parse(const char *)
parse a TLS squid.conf option
TLS squid.conf settings for a listening port.
Security::ContextPointer createBlankContext() const override
generate an unset security context object
void parse(const char *) override
parse a TLS squid.conf option
void dumpCfg(std::ostream &, const char *pfx) const override
output squid.conf syntax with 'pfx' prefix on parameters for the stored settings
ServerOptions & operator=(const ServerOptions &)
Definition forward.h:15
Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.
Network/connection security abstraction layer.
Definition Connection.h:34
void SetSessionCacheCallbacks(Security::ContextPointer &)
Setup the given TLS context with callbacks used to manage the session cache.
Definition Session.cc:409
void PrepForIo()
Definition Io.cc:78
SBuf IssuerName(Certificate &)
The Issuer field of the given certificate (if found) or an empty SBuf.
std::shared_ptr< SSL_CTX > ContextPointer
Definition Context.h:29
SSL Connection
Definition Session.h:49
bool CreateClientSession(FuturePeerContext &, const Comm::ConnectionPointer &, const char *squidCtx)
Definition Session.cc:216
bool CreateServerSession(const Security::ContextPointer &, const Comm::ConnectionPointer &, Security::PeerOptions &, const char *squidCtx)
Definition Session.cc:227
IoResult Accept(Comm::Connection &transport)
accept a TLS connection over the specified to-Squid transport connection
Definition Io.cc:208
int ErrorCode
Squid-defined error code (<0), an error code returned by X.509 API, or zero.
Definition forward.h:134
const char * ErrorNameFromCode(ErrorCode err, bool prefixRawCode=false)
Security::SessionPointer NewSessionObject(const Security::ContextPointer &)
Definition Session.cc:123
void SetSessionResumeData(const Security::SessionPointer &, const Security::SessionStatePointer &)
Definition Session.cc:280
std::shared_ptr< SSL > SessionPointer
Definition Session.h:53
IoResult Connect(Comm::Connection &transport)
establish a TLS connection over the specified from-Squid transport connection
Definition Io.cc:223
unsigned long LibErrorCode
TLS library-reported non-validation error.
Definition forward.h:141
X509 Certificate
Definition forward.h:79
bool SessionIsResumed(const Security::SessionPointer &)
whether the session is a resumed one
Definition Session.cc:246
void SessionSendGoodbye(const Security::SessionPointer &)
send the shutdown/bye notice for an active TLS session.
Definition Session.cc:233
SessionPointer::element_type * ConnectionPointer
Definition Io.cc:22
Security::LockingPointer< X509, X509_free_cpp, HardFun< int, X509 *, X509_up_ref > > CertPointer
Definition forward.h:88
ErrorCode ErrorCodeFromName(const char *name)
SBuf SubjectName(Certificate &)
The SubjectName field of the given certificate (if found) or an empty SBuf.
bool IssuedBy(Certificate &cert, Certificate &issuer)
std::unique_ptr< SSL_SESSION, HardFun< void, SSL_SESSION *, &SSL_SESSION_free > > SessionStatePointer
Definition Session.h:55
void MaybeGetSessionResumeData(const Security::SessionPointer &, Security::SessionStatePointer &data)
Definition Session.cc:259
PeerOptions & ProxyOutgoingConfig()
configuration options for DIRECT server access
std::ostream & operator<<(std::ostream &, const EncryptorAnswer &)
void ForgetErrors()
clear any errors that a TLS library has accumulated in its global storage
Definition Io.cc:70
STL namespace.