From: Christos Tsantilas Date: Tue, 14 Dec 2010 12:17:34 +0000 (+0200) Subject: Fix the "Report ERR_SECURE_CONNECT_FAIL details" patch (rev 11122) X-Git-Tag: take00~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=461b9576fded7c2b44e5262bf19de769fb832973;p=thirdparty%2Fsquid.git Fix the "Report ERR_SECURE_CONNECT_FAIL details" patch (rev 11122) Looks that the error_t is a define in some platforms. Rename Ssl::error_t to Ssl::ssl_error_t to avoid compile problems --- diff --git a/src/acl/SslErrorData.cc b/src/acl/SslErrorData.cc index 93381a6177..d565253f29 100644 --- a/src/acl/SslErrorData.cc +++ b/src/acl/SslErrorData.cc @@ -22,7 +22,7 @@ ACLSslErrorData::~ACLSslErrorData() } bool -ACLSslErrorData::match(Ssl::error_t toFind) +ACLSslErrorData::match(Ssl::ssl_error_t toFind) { return values->findAndTune (toFind); } @@ -30,14 +30,14 @@ ACLSslErrorData::match(Ssl::error_t toFind) /* explicit instantiation required for some systems */ /** \cond AUTODOCS-IGNORE */ // AYJ: 2009-05-20 : Removing. clashes with template instantiation for other ACLs. -// template cbdata_type CbDataList::CBDATA_CbDataList; +// template cbdata_type CbDataList::CBDATA_CbDataList; /** \endcond */ wordlist * ACLSslErrorData::dump() { wordlist *W = NULL; - CbDataList *data = values; + CbDataList *data = values; while (data != NULL) { wordlistAdd(&W, Ssl::getErrorName(data->element)); @@ -50,12 +50,12 @@ ACLSslErrorData::dump() void ACLSslErrorData::parse() { - CbDataList **Tail; + CbDataList **Tail; char *t = NULL; for (Tail = &values; *Tail; Tail = &((*Tail)->next)); while ((t = strtokFile())) { - CbDataList *q = new CbDataList(Ssl::parseErrorString(t)); + CbDataList *q = new CbDataList(Ssl::parseErrorString(t)); *(Tail) = q; Tail = &q->next; } @@ -67,7 +67,7 @@ ACLSslErrorData::empty() const return values == NULL; } -ACLData * +ACLData * ACLSslErrorData::clone() const { /* Splay trees don't clone yet. */ diff --git a/src/acl/SslErrorData.h b/src/acl/SslErrorData.h index d2974921a9..1f21a7ceae 100644 --- a/src/acl/SslErrorData.h +++ b/src/acl/SslErrorData.h @@ -11,7 +11,7 @@ #include "ssl/support.h" #include "ssl/ErrorDetail.h" -class ACLSslErrorData : public ACLData +class ACLSslErrorData : public ACLData { public: @@ -21,13 +21,13 @@ public: ACLSslErrorData(ACLSslErrorData const &); ACLSslErrorData &operator= (ACLSslErrorData const &); virtual ~ACLSslErrorData(); - bool match(Ssl::error_t); + bool match(Ssl::ssl_error_t); wordlist *dump(); void parse(); bool empty() const; - virtual ACLData *clone() const; + virtual ACLData *clone() const; - CbDataList *values; + CbDataList *values; }; MEMPROXY_CLASS_INLINE(ACLSslErrorData); diff --git a/src/ssl/ErrorDetail.cc b/src/ssl/ErrorDetail.cc index 26ed64d481..a7f8f383d2 100644 --- a/src/ssl/ErrorDetail.cc +++ b/src/ssl/ErrorDetail.cc @@ -2,7 +2,7 @@ #include "ssl/ErrorDetail.h" struct SslErrorDetailEntry { - Ssl::error_t value; + Ssl::ssl_error_t value; const char *name; const char *detail; }; @@ -37,7 +37,7 @@ static SslErrorDetailEntry TheSslDetailMap[] = { {SSL_ERROR_NONE, NULL, NULL } }; -Ssl::error_t +Ssl::ssl_error_t Ssl::parseErrorString(const char *name) { assert(name); @@ -59,7 +59,7 @@ Ssl::parseErrorString(const char *name) } const char * -Ssl::getErrorName(Ssl::error_t value) +Ssl::getErrorName(Ssl::ssl_error_t value) { for (int i = 0; TheSslDetailMap[i].name; ++i) { @@ -70,7 +70,7 @@ Ssl::getErrorName(Ssl::error_t value) return NULL; } -static const char *getErrorDetail(Ssl::error_t value) +static const char *getErrorDetail(Ssl::ssl_error_t value) { for (int i = 0; TheSslDetailMap[i].name; ++i) { if (TheSslDetailMap[i].value == value) @@ -247,7 +247,7 @@ const String &Ssl::ErrorDetail::toString() const CRYPTO_add(&(cert->references),1,CRYPTO_LOCK_X509); peer_cert.reset(cert); */ -Ssl::ErrorDetail::ErrorDetail( error_t err_no, X509 *cert): error_no (err_no) +Ssl::ErrorDetail::ErrorDetail( Ssl::ssl_error_t err_no, X509 *cert): error_no (err_no) { peer_cert.reset(X509_dup(cert)); } diff --git a/src/ssl/ErrorDetail.h b/src/ssl/ErrorDetail.h index fd3a7ae1cb..c1e08150a0 100644 --- a/src/ssl/ErrorDetail.h +++ b/src/ssl/ErrorDetail.h @@ -18,19 +18,19 @@ namespace Ssl { /// Squid defined error code (<0), an error code returned by SSL X509 api, or SSL_ERROR_NONE -typedef int error_t; +typedef int ssl_error_t; /** \ingroup ServerProtocolSSLAPI - * The error_t representation of the error described by "name". + * The ssl_error_t representation of the error described by "name". */ -error_t parseErrorString(const char *name); +ssl_error_t parseErrorString(const char *name); /** \ingroup ServerProtocolSSLAPI * The string representation of the SSL error "value" */ -const char *getErrorName(error_t value); +const char *getErrorName(ssl_error_t value); /** \ingroup ServerProtocolSSLAPI @@ -40,7 +40,7 @@ const char *getErrorName(error_t value); class ErrorDetail { public: - ErrorDetail(error_t err_no, X509 *cert); + ErrorDetail(ssl_error_t err_no, X509 *cert); ErrorDetail(ErrorDetail const &); const String &toString() const; ///< An error detail string to embed in squid error pages @@ -68,7 +68,7 @@ private: void buildDetail() const; mutable String errDetailStr; ///< Caches the error detail message - error_t error_no; ///< The error code + ssl_error_t error_no; ///< The error code X509_Pointer peer_cert; ///< A pointer to the peer certificate }; diff --git a/src/ssl/support.cc b/src/ssl/support.cc index 3e682b9b24..e68774aeb3 100644 --- a/src/ssl/support.cc +++ b/src/ssl/support.cc @@ -211,7 +211,7 @@ ssl_verify_cb(int ok, X509_STORE_CTX * ctx) void *dont_verify_domain = SSL_CTX_get_ex_data(sslctx, ssl_ctx_ex_index_dont_verify_domain); ACLChecklist *check = (ACLChecklist*)SSL_get_ex_data(ssl, ssl_ex_index_cert_error_check); X509 *peer_cert = ctx->cert; - Ssl::error_t error_no = SSL_ERROR_NONE; + Ssl::ssl_error_t error_no = SSL_ERROR_NONE; X509_NAME_oneline(X509_get_subject_name(peer_cert), buffer, sizeof(buffer));