stub_libsecurity.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2021 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 "Downloader.h"
13 #include "HttpRequest.h"
14 
15 #define STUB_API "security/libsecurity.la"
16 #include "tests/STUB.h"
17 
20 namespace Security
21 {
23 Security::ContextPointer BlindPeerConnector::getTlsContext() STUB_RETVAL(Security::ContextPointer())
24 void BlindPeerConnector::noteNegotiationDone(ErrorState *) STUB
25 }
26 
27 #include "security/EncryptorAnswer.h"
29 std::ostream &Security::operator <<(std::ostream &os, const Security::EncryptorAnswer &) STUB_RETVAL(os)
30 
31 #include "security/Handshake.h"
34 
35 #include "security/Io.h"
39 
40 #include "security/KeyData.h"
41 namespace Security
42 {
43 void KeyData::loadFromFiles(const AnyP::PortCfg &, const char *) STUB
44 }
45 
46 #include "security/KeyLogger.h"
48 
49 #include "security/ErrorDetail.h"
51 #if USE_OPENSSL
53 #elif USE_GNUTLS
55 #endif
58 SBuf Security::ErrorDetail::brief() const STUB_RETVAL(SBuf())
60 const char *Security::ErrorNameFromCode(ErrorCode, bool) STUB_RETVAL("")
61 
62 #include "security/NegotiationHistory.h"
64 void Security::NegotiationHistory::retrieveNegotiatedInfo(const Security::SessionPointer &) STUB
65 void Security::NegotiationHistory::retrieveParsedInfo(Security::TlsDetails::Pointer const &) STUB
66 const char *Security::NegotiationHistory::cipherName() const STUB
67 const char *Security::NegotiationHistory::printTlsVersion(AnyP::ProtocolVersion const &) const STUB
68 
69 #include "security/PeerConnector.h"
70 class TlsNegotiationDetails: public RefCountable {};
72 namespace Security
73 {
75  AsyncJob("Security::PeerConnector") {STUB}
76 PeerConnector::~PeerConnector() STUB
77 void PeerConnector::start() STUB
78 bool PeerConnector::doneAll() const STUB_RETVAL(true)
79 void PeerConnector::swanSong() STUB
80 const char *PeerConnector::status() const STUB_RETVAL("")
81 void PeerConnector::fillChecklist(ACLFilledChecklist &) const STUB
82 void PeerConnector::commCloseHandler(const CommCloseCbParams &) STUB
83 void PeerConnector::commTimeoutHandler(const CommTimeoutCbParams &) STUB
84 bool PeerConnector::initialize(Security::SessionPointer &) STUB_RETVAL(false)
85 void PeerConnector::negotiate() STUB
86 bool PeerConnector::sslFinalized() STUB_RETVAL(false)
87 void PeerConnector::handleNegotiationResult(const Security::IoResult &) STUB;
88 void PeerConnector::noteWantRead() STUB
89 void PeerConnector::noteWantWrite() STUB
90 void PeerConnector::noteNegotiationError(const Security::ErrorDetailPointer &) STUB
91 // virtual Security::ContextPointer getTlsContext() = 0;
92 void PeerConnector::bail(ErrorState *) STUB
93 void PeerConnector::sendSuccess() STUB
94 void PeerConnector::callBack() STUB
95 void PeerConnector::disconnect() STUB
96 void PeerConnector::countFailingConnection() STUB
97 void PeerConnector::recordNegotiationDetails() STUB
98 EncryptorAnswer &PeerConnector::answer() STUB_RETREF(EncryptorAnswer)
99 }
100 
101 #include "security/PeerOptions.h"
104 #if USE_OPENSSL
105  parsedOptions = 0;
106 #endif
107  STUB_NOP
108 }
109 void Security::PeerOptions::parse(char const*) STUB
111 void Security::PeerOptions::updateTlsVersionLimits() STUB
112 Security::ContextPointer Security::PeerOptions::createBlankContext() const STUB_RETVAL(Security::ContextPointer())
113 void Security::PeerOptions::updateContextCa(Security::ContextPointer &) STUB
114 void Security::PeerOptions::updateContextCrl(Security::ContextPointer &) STUB
115 void Security::PeerOptions::updateContextTrust(Security::ContextPointer &) STUB
116 void Security::PeerOptions::updateSessionOptions(Security::SessionPointer &) STUB
117 void Security::PeerOptions::dumpCfg(Packable*, char const*) const STUB
118 void Security::PeerOptions::parseOptions() STUB
119 void parse_securePeerOptions(Security::PeerOptions *) STUB
120 
121 #include "security/ServerOptions.h"
122 //Security::ServerOptions::ServerOptions(const Security::ServerOptions &) STUB
124 void Security::ServerOptions::parse(const char *) STUB
125 void Security::ServerOptions::dumpCfg(Packable *, const char *) const STUB
127 void Security::ServerOptions::initServerContexts(AnyP::PortCfg&) STUB
128 bool Security::ServerOptions::createStaticServerContext(AnyP::PortCfg &) STUB_RETVAL(false)
129 void Security::ServerOptions::createSigningContexts(const AnyP::PortCfg &) STUB
130 bool Security::ServerOptions::updateContextConfig(Security::ContextPointer &) STUB_RETVAL(false)
131 void Security::ServerOptions::updateContextEecdh(Security::ContextPointer &) STUB
132 void Security::ServerOptions::updateContextClientCa(Security::ContextPointer &) STUB
133 void Security::ServerOptions::syncCaFiles() STUB
134 void Security::ServerOptions::updateContextSessionId(Security::ContextPointer &) STUB
135 
136 #include "security/Session.h"
137 namespace Security {
138 bool CreateClientSession(const Security::ContextPointer &, const Comm::ConnectionPointer &, const char *) STUB_RETVAL(false)
139 bool CreateServerSession(const Security::ContextPointer &, const Comm::ConnectionPointer &, Security::PeerOptions &, const char *) STUB_RETVAL(false)
144 #if USE_OPENSSL
147 #endif
148 } // namespace Security
149 
bool CreateClientSession(const Security::ContextPointer &, const Comm::ConnectionPointer &, const char *squidCtx)
Definition: Session.cc:183
ErrorCode ErrorCodeFromName(const char *name)
Definition: ErrorDetail.cc:407
PeerConnector(const Comm::ConnectionPointer &aServerConn, AsyncCall::Pointer &aCallback, const AccessLogEntryPointer &alp, const time_t timeout=0)
int ErrorCode
Squid-defined error code (<0), an error code returned by X.509 API, or zero.
Definition: forward.h:102
std::shared_ptr< SSL_CTX > ContextPointer
Definition: Context.h:29
Security::ContextPointer createClientContext(bool setOptions)
generate a security client-context from these configured options
Definition: PeerOptions.cc:271
void MaybeGetSessionResumeData(const Security::SessionPointer &, Security::SessionStatePointer &data)
Definition: Session.cc:225
AnyP::ProtocolVersion ProtocolVersion()
Protocol version to use in Http::Message structures wrapping FTP messages.
Definition: Elements.cc:24
#define STUB_RETVAL(x)
Definition: STUB.h:41
virtual Security::ContextPointer createBlankContext() const
generate an unset security context object
Security::LockingPointer< X509, X509_free_cpp, HardFun< int, X509 *, X509_up_ref > > CertPointer
Definition: forward.h:74
Definition: SBuf.h:87
virtual bool initialize(Security::SessionPointer &)
Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.
Definition: AcceptLimiter.h:17
a summary a TLS I/O operation outcome
Definition: Io.h:19
HandshakeParser(MessageSource)
Definition: Handshake.cc:218
PeerOptions ProxyOutgoingConfig
configuration options for DIRECT server access
Definition: PeerOptions.cc:24
void SessionSendGoodbye(const Security::SessionPointer &)
send the shutdown/bye notice for an active TLS session.
Definition: Session.cc:199
bool SessionIsResumed(const Security::SessionPointer &)
whether the session is a resumed one
Definition: Session.cc:212
SessionPointer::element_type * ConnectionPointer
Definition: Io.cc:21
void loadFromFiles(const AnyP::PortCfg &, const char *portType)
load the contents of certFile and privateKeyFile into memory cert, pkey and chain
Definition: KeyData.cc:191
Definition: forward.h:15
TLS squid.conf settings for a remote server peer.
Definition: PeerOptions.h:24
void setPeerCertificate(const CertPointer &)
Definition: ErrorDetail.cc:487
#define true
Definition: GnuRegex.c:234
std::ostream &Security::operator<<(std::ostream &os, const Security::EncryptorAnswer &) STUB_RETVAL(os) Security CBDATA_NAMESPACED_CLASS_INIT(Security, PeerConnector)
void SetSessionCacheCallbacks(Security::ContextPointer &)
Setup the given TLS context with callbacks used to manage the session cache.
Definition: Session.cc:375
Security::SessionPointer NewSessionObject(const Security::ContextPointer &)
Definition: Session.cc:90
#define STUB_RETREF(x)
Definition: STUB.h:51
virtual SBuf verbose(const HttpRequestPointer &) const
Definition: ErrorDetail.cc:530
void ForgetErrors()
clear any errors that a TLS library has accumulated in its global storage
Definition: Io.cc:55
bool parseHello(const SBuf &data)
Definition: Handshake.cc:640
SSL Connection
Definition: Session.h:45
#define STUB
macro to stub a void function.
Definition: STUB.h:33
const char * ErrorNameFromCode(ErrorCode err, bool prefixRawCode=false)
Definition: ErrorDetail.cc:427
void maybeLog(const Connection &, const Acl::ChecklistFiller &)
(slowly checks logging preconditions and) logs if possible
Definition: KeyLogger.cc:22
bool CreateServerSession(const Security::ContextPointer &, const Comm::ConnectionPointer &, Security::PeerOptions &, const char *squidCtx)
Definition: Session.cc:193
ErrorDetail(ErrorCode err_no, const CertPointer &peer, const CertPointer &broken, const char *aReason=NULL)
Definition: ErrorDetail.cc:463
TLS squid.conf settings for a listening port.
Definition: ServerOptions.h:26
std::ostream & operator<<(std::ostream &, const Security::EncryptorAnswer &)
std::shared_ptr< SSL > SessionPointer
Definition: Session.h:49
virtual void dumpCfg(Packable *, const char *pfx) const
output squid.conf syntax with 'pfx' prefix on parameters for the stored settings
std::unique_ptr< SSL_SESSION, HardFun< void, SSL_SESSION *, &SSL_SESSION_free > > SessionStatePointer
Definition: Session.h:51
#define STUB_NOP
Definition: STUB.h:37
IoResult Connect(Comm::Connection &transport)
establish a TLS connection over the specified from-Squid transport connection
Definition: Io.cc:212
virtual void parse(const char *)
parse a TLS squid.conf option
Security::ParsedOptions parsedOptions
Definition: PeerOptions.h:95
IoResult Accept(Comm::Connection &transport)
accept a TLS connection over the specified to-Squid transport connection
Definition: Io.cc:197
ServerOptions & operator=(const ServerOptions &)
interface for supplying additional information about a transaction failure
Definition: Detail.h:21
#define false
Definition: GnuRegex.c:233
Network/connection security abstraction layer.
Definition: Connection.h:34
an interface for those capable of configuring an ACLFilledChecklist object
void parse_securePeerOptions(Security::PeerOptions *opt)
Definition: PeerOptions.cc:801
~EncryptorAnswer()
deletes error if it is still set
unsigned long LibErrorCode
TLS library-reported non-validation error.
Definition: forward.h:112
virtual void parse(const char *)
parse a TLS squid.conf option
Definition: PeerOptions.cc:33
void SetSessionResumeData(const Security::SessionPointer &, const Security::SessionStatePointer &)
Definition: Session.cc:246

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors