Squid Web Cache master
Loading...
Searching...
No Matches
stub_libsslsquid.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
11#if USE_OPENSSL
12
13#include "fatal.h"
14#include "sbuf/Algorithms.h"
15#include "sbuf/SBuf.h"
16
17/* Stub File for the ssl/libsslsquid.la convenience library */
18
19#define STUB_API "ssl/libsslsquid.la"
20#include "tests/STUB.h"
21
22#include "ssl/Config.h"
25 ssl_crtd(nullptr),
26#endif
27 ssl_crt_validator(nullptr)
28{
29 ssl_crt_validator_Children.concurrency = 1;
31}
33Ssl::Config Ssl::TheConfig;
34
35#include "ssl/context_storage.h"
36//Ssl::CertificateStorageAction::CertificateStorageAction(const Mgr::Command::Pointer &) STUB
41{ fatal(STUB_API " required"); static LocalContextStorage v(0); return &v; }
43
44#include "ssl/ErrorDetail.h"
45#include "ssl/support.h"
46namespace Ssl
47{
48bool ParseErrorString(const char *, Security::Errors &) STUB_RETVAL(false)
49int AskPasswordCb(char *, int, int, void *) STUB_RETVAL(0)
50bool InitServerContext(Security::ContextPointer &, AnyP::PortCfg &) STUB_RETVAL(false)
51bool InitClientContext(Security::ContextPointer &, Security::PeerOptions &, Security::ParsedPortFlags) STUB_RETVAL(false)
52void ConfigurePeerVerification(Security::ContextPointer &, const Security::ParsedPortFlags) STUB
53void DisablePeerVerification(Security::ContextPointer &) STUB
54void MaybeSetupRsaCallback(Security::ContextPointer &) STUB
55} // namespace Ssl
56const char *sslGetUserEmail(SSL *) STUB_RETVAL(nullptr)
57const char *sslGetUserAttribute(SSL *, const char *) STUB_RETVAL(nullptr)
58const char *sslGetCAAttribute(SSL *, const char *) STUB_RETVAL(nullptr)
61namespace Ssl
62{
63//GETX509ATTRIBUTE GetX509UserAttribute;
64//GETX509ATTRIBUTE GetX509CAAttribute;
65//GETX509ATTRIBUTE GetX509Fingerprint;
66std::vector<const char *> BumpModeStr = {""};
67bool generateUntrustedCert(Security::CertPointer &, Security::PrivateKeyPointer &, Security::CertPointer const &, Security::PrivateKeyPointer const &) STUB_RETVAL(false)
69bool verifySslCertificate(const Security::ContextPointer &, CertificateProperties const &) STUB_RETVAL(false)
71bool HasMatchingSubjectName(X509 &, const GeneralNameMatcher &) STUB_RETVAL(false)
72bool HasSubjectName(X509 &, const AnyP::Host &) STUB_RETVAL(false)
73int asn1timeToString(ASN1_TIME *, char *, int) STUB_RETVAL(0)
74void setClientSNI(SSL *, const char *) STUB
76} //namespace Ssl
77
78#endif
79
#define STUB
macro to stub a void function.
Definition STUB.h:34
#define STUB_NOP
Definition STUB.h:38
#define STUB_RETSTATREF(x)
Definition STUB.h:55
#define STUB_RETVAL(x)
Definition STUB.h:42
class SquidConfig Config
#define USE_SSL_CRTD
Definition autoconf.h:1580
either a domain name (as defined in DNS RFC 1034) or an IP address
Definition Host.h:25
Definition SBuf.h:94
TLS squid.conf settings for a listening port.
static Pointer Create(const Mgr::Command::Pointer &cmd)
void dump(StoreEntry *sentry) override
void reconfigureStart()
When reconfigring should be called this method.
void addLocalStorage(Ip::Address const &address, size_t size_of_store)
Create new SSL context storage for the local listening address/port.
LocalContextStorage * getLocalStorage(Ip::Address const &address)
Return the local storage for the given listening address/port.
void fatal(const char *message)
Definition fatal.cc:28
Security::ContextPointer GenerateSslContext(CertificateProperties const &, Security::ServerOptions &, bool trusted)
Definition support.cc:1052
GETX509PEM GetX509PEM
Definition support.h:121
std::vector< const char * > BumpModeStr
Definition support.cc:46
SBuf sslGetUserCertificatePEM(SSL *ssl)
Definition support.cc:987
bool generateUntrustedCert(Security::CertPointer &untrustedCert, Security::PrivateKeyPointer &untrustedPkey, Security::CertPointer const &cert, Security::PrivateKeyPointer const &pkey)
Definition support.cc:1463
const char * sslGetUserAttribute(SSL *ssl, const char *attribute_name)
Definition support.cc:954
bool verifySslCertificate(const Security::ContextPointer &, CertificateProperties const &)
Definition support.cc:1141
int asn1timeToString(ASN1_TIME *tm, char *buf, int len)
Definition support.cc:248
const char * sslGetCAAttribute(SSL *ssl, const char *attribute_name)
Definition support.cc:967
Security::ContextPointer GenerateSslContextUsingPkeyAndCertFromMemory(const char *data, Security::ServerOptions &, bool trusted)
Definition support.cc:1038
SBuf sslGetUserCertificateChainPEM(SSL *ssl)
Definition support.cc:998
void setClientSNI(SSL *ssl, const char *fqdn)
Definition support.cc:1166
const char * sslGetUserEmail(SSL *ssl)
Definition support.cc:981
Definition forward.h:15
Network/connection security abstraction layer.
Definition Connection.h:34
std::shared_ptr< SSL_CTX > ContextPointer
Definition Context.h:29
std::unordered_set< Security::ErrorCode > Errors
Definition forward.h:165
Definition Xaction.cc:40
bool HasMatchingSubjectName(X509 &, const GeneralNameMatcher &)
Definition support.cc:307
bool HasSubjectName(X509 &, const AnyP::Host &)
whether at least one common or alternate subject name matches the given one
Definition support.cc:338
void DisablePeerVerification(Security::ContextPointer &)
Definition support.cc:528
bool InitClientContext(Security::ContextPointer &, Security::PeerOptions &, Security::ParsedPortFlags)
initialize a TLS client context with OpenSSL specific settings
Definition support.cc:806
bool ParseErrorString(const char *name, Security::Errors &)
ClpMap< SBuf, Security::ContextPointer, MemoryUsedByContext > LocalContextStorage
int AskPasswordCb(char *buf, int size, int rwflag, void *userdata)
Definition support.cc:131
void MaybeSetupRsaCallback(Security::ContextPointer &)
if required, setup callback for generating ephemeral RSA keys
Definition support.cc:238
void ConfigurePeerVerification(Security::ContextPointer &, const Security::ParsedPortFlags)
set the certificate verify callback for a context
Definition support.cc:501
bool InitServerContext(Security::ContextPointer &, AnyP::PortCfg &)
initialize a TLS server context with OpenSSL specific settings
Definition support.cc:797
int unsigned int
Definition stub_fd.cc:19
#define STUB_API