stub_libsslsquid.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 
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"
24 #if USE_SSL_CRTD
25  ssl_crtd(NULL),
26 #endif
27  ssl_crt_validator(NULL)
28 {
29  ssl_crt_validator_Children.concurrency = 1;
30  STUB_NOP
31 }
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 //Ssl::GlobalContextStorage Ssl::TheGlobalContextStorage;
44 
45 #include "ssl/ErrorDetail.h"
46 #include "ssl/support.h"
47 namespace Ssl
48 {
49 bool ParseErrorString(const char *, Security::Errors &) STUB_RETVAL(false)
50 int AskPasswordCb(char *, int, int, void *) STUB_RETVAL(0)
56 } // namespace Ssl
57 const char *sslGetUserEmail(SSL *) STUB_RETVAL(nullptr)
58 const char *sslGetUserAttribute(SSL *, const char *) STUB_RETVAL(nullptr)
59 const char *sslGetCAAttribute(SSL *, const char *) STUB_RETVAL(nullptr)
62 namespace Ssl
63 {
64 //GETX509ATTRIBUTE GetX509UserAttribute;
65 //GETX509ATTRIBUTE GetX509CAAttribute;
66 //GETX509ATTRIBUTE GetX509Fingerprint;
67 std::vector<const char *> BumpModeStr = {""};
68 bool generateUntrustedCert(Security::CertPointer &, Security::PrivateKeyPointer &, Security::CertPointer const &, Security::PrivateKeyPointer const &) STUB_RETVAL(false)
70 bool verifySslCertificate(const Security::ContextPointer &, CertificateProperties const &) STUB_RETVAL(false)
72 int matchX509CommonNames(X509 *, void *, int (*)(void *, ASN1_STRING *)) STUB_RETVAL(0)
73 bool checkX509ServerValidity(X509 *, const char *) STUB_RETVAL(false)
74 int asn1timeToString(ASN1_TIME *, char *, int) STUB_RETVAL(0)
75 void setClientSNI(SSL *, const char *) STUB
77 } //namespace Ssl
78 
79 #endif
80 
const char * sslGetCAAttribute(SSL *ssl, const char *attribute_name)
Definition: support.cc:863
void fatal(const char *message)
Definition: fatal.cc:28
bool InitClientContext(Security::ContextPointer &, Security::PeerOptions &, Security::ParsedPortFlags)
initialize a TLS client context with OpenSSL specific settings
Definition: support.cc:702
int asn1timeToString(ASN1_TIME *tm, char *buf, int len)
Definition: support.cc:181
bool generateUntrustedCert(Security::CertPointer &untrustedCert, Security::PrivateKeyPointer &untrustedPkey, Security::CertPointer const &cert, Security::PrivateKeyPointer const &pkey)
Definition: support.cc:1365
std::shared_ptr< SSL_CTX > ContextPointer
Definition: Context.h:29
void MaybeSetupRsaCallback(Security::ContextPointer &)
if required, setup callback for generating ephemeral RSA keys
Definition: support.cc:171
bool InitServerContext(Security::ContextPointer &, AnyP::PortCfg &)
initialize a TLS server context with OpenSSL specific settings
Definition: support.cc:693
int matchX509CommonNames(X509 *peer_cert, void *check_data, int(*check_func)(void *check_data, ASN1_STRING *cn_data))
Definition: support.cc:195
Definition: SBuf.h:87
GETX509PEM GetX509PEM
Definition: support.h:115
const char * sslGetUserEmail(SSL *) STUB_RETVAL(nullptr) const char *sslGetUserAttribute(SSL *
virtual void dump(StoreEntry *sentry)
bool checkX509ServerValidity(X509 *cert, const char *server)
Definition: support.cc:254
bool ParseErrorString(const char *name, Security::Errors &)
Definition: ErrorDetail.cc:110
#define NULL
Definition: types.h:166
#define STUB_RETSTATREF(x)
Definition: STUB.h:54
Definition: forward.h:15
LocalContextStorage * getLocalStorage(Ip::Address const &address)
Return the local storage for the given listening address/port.
Definition: ClpMap.h:41
Definition: Xaction.cc:49
Config TheConfig
Definition: Config.cc:16
long ParsedPortFlags
Definition: forward.h:175
Security::ContextPointer GenerateSslContextUsingPkeyAndCertFromMemory(const char *data, Security::ServerOptions &, bool trusted)
Definition: support.cc:934
#define STUB
macro to stub a void function.
Definition: STUB.h:33
SBuf sslGetUserCertificateChainPEM(SSL *ssl)
Definition: support.cc:894
Security::ContextPointer GenerateSslContext(CertificateProperties const &, Security::ServerOptions &, bool trusted)
Definition: support.cc:948
const char * sslGetUserAttribute(SSL *ssl, const char *attribute_name)
Definition: support.cc:850
std::vector< const char * > BumpModeStr
Definition: support.cc:46
TLS squid.conf settings for a listening port.
Definition: ServerOptions.h:26
void reconfigureStart()
When reconfigring should be called this method.
void DisablePeerVerification(Security::ContextPointer &)
Definition: support.cc:435
const char const char * STUB_RETVAL(nullptr) const char *sslGetCAAttribute(SSL *
int AskPasswordCb(char *buf, int size, int rwflag, void *userdata)
Definition: support.cc:64
static Pointer Create(const Mgr::Command::Pointer &cmd)
bool verifySslCertificate(const Security::ContextPointer &, CertificateProperties const &)
Definition: support.cc:1037
#define STUB_NOP
Definition: STUB.h:37
void addLocalStorage(Ip::Address const &address, size_t size_of_store)
Create new SSL context storage for the local listening address/port.
void ConfigurePeerVerification(Security::ContextPointer &, const Security::ParsedPortFlags)
set the certificate verify callback for a context
Definition: support.cc:408
std::unordered_set< Security::ErrorCode > Errors
Definition: forward.h:136
#define false
Definition: GnuRegex.c:233
Network/connection security abstraction layer.
Definition: Connection.h:34
SBuf sslGetUserCertificatePEM(SSL *ssl)
Definition: support.cc:883
void setClientSNI(SSL *ssl, const char *fqdn)
Definition: support.cc:1062
#define STUB_API
class SquidConfig Config
Definition: SquidConfig.cc:12
int unsigned int
Definition: stub_fd.cc:19
ClpMap< SBuf, Security::ContextPointer, MemoryUsedByContext > LocalContextStorage

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors