]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SSL server certificate validator implementation: remove "#if 1 //USE_SSL_CERT_VALIDAT...
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 13 Dec 2012 21:39:46 +0000 (23:39 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 13 Dec 2012 21:39:46 +0000 (23:39 +0200)
src/forward.cc
src/main.cc
src/ssl/helper.cc
src/ssl/support.cc

index 8b5adde40768b16d49eb8279586fb16708a2edd7..a6ab3daae828d19114b6163476f9279a17eb9341 100644 (file)
 #include "urn.h"
 #include "whois.h"
 #if USE_SSL
-#if 1 // USE_SSL_CERT_VALIDATOR
 #include "ssl/cert_validate_message.h"
 #include "ssl/Config.h"
 #include "ssl/helper.h"
-#endif
 #include "ssl/support.h"
 #include "ssl/ErrorDetail.h"
 #include "ssl/ServerBump.h"
@@ -744,7 +742,6 @@ FwdState::negotiateSSL(int fd)
         serverConnection()->getPeer()->sslSession = SSL_get1_session(ssl);
     }
 
-#if 1 // USE_SSL_CERT_VALIDATOR
     if (Ssl::TheConfig.ssl_crt_validator) {
         Ssl::CertValidationRequest validationRequest;
         // WARNING: The STACK_OF(*) OpenSSL objects does not support locking.
@@ -786,12 +783,10 @@ FwdState::negotiateSSL(int fd)
             return;
         }
     }
-#endif // USE_SSL_CERT_VALIDATOR
 
     dispatch();
 }
 
-#if 1 // USE_SSL_CERT_VALIDATOR
 void
 FwdState::sslCrtvdHandleReplyWrapper(void *data, const HelperReply &reply)
 {
@@ -928,8 +923,6 @@ FwdState::sslCrtvdCheckForErrors(Ssl::CertValidationResponse &resp, Ssl::ErrorDe
     return errs;
 }
 
-#endif // USE_SSL_CERT_VALIDATOR
-
 void
 FwdState::initiateSSL()
 {
@@ -992,20 +985,16 @@ FwdState::initiateSSL()
             Ssl::setClientSNI(ssl, hostname);
     }
 
-#if 1 // USE_SSL_CERT_VALIDATOR
     // If CertValidation Helper used do not lookup checklist for errors,
     // but keep a list of errors to send it to CertValidator
     if (!Ssl::TheConfig.ssl_crt_validator) {
-#endif
         // Create the ACL check list now, while we have access to more info.
         // The list is used in ssl_verify_cb() and is freed in ssl_free().
         if (acl_access *acl = Config.ssl_client.cert_error) {
             ACLFilledChecklist *check = new ACLFilledChecklist(acl, request, dash_str);
             SSL_set_ex_data(ssl, ssl_ex_index_cert_error_check, check);
         }
-#if 1 // USE_SSL_CERT_VALIDATOR
     }
-#endif
 
     // store peeked cert to check SQUID_X509_V_ERR_CERT_CHANGE
     X509 *peeked_cert;
index 1bd6718647571cef839059a6d81157a8db1ef948..5b532244294154c0225b6838b50a710ef293a076 100644 (file)
@@ -767,10 +767,8 @@ mainReconfigureStart(void)
     Ssl::Helper::GetInstance()->Shutdown();
 #endif
 #if USE_SSL
-#if 1 // USE_SSL_CERT_VALIDATOR
     if (Ssl::CertValidationHelper::GetInstance())
         Ssl::CertValidationHelper::GetInstance()->Shutdown();
-#endif
     Ssl::TheGlobalContextStorage.reconfigureStart();
 #endif
     redirectShutdown();
@@ -853,7 +851,7 @@ mainReconfigureFinish(void *)
 #if USE_SSL_CRTD
     Ssl::Helper::GetInstance()->Init();
 #endif
-#if USE_SSL // && USE_SSL_CERT_VALIDATOR
+#if USE_SSL
     if (Ssl::CertValidationHelper::GetInstance())
         Ssl::CertValidationHelper::GetInstance()->Init();
 #endif
@@ -1054,7 +1052,7 @@ mainInitialize(void)
     Ssl::Helper::GetInstance()->Init();
 #endif
 
-#if USE_SSL // && USE_SSL_CERT_VALIDATOR
+#if USE_SSL
     if (Ssl::CertValidationHelper::GetInstance())
         Ssl::CertValidationHelper::GetInstance()->Init();
 #endif
@@ -1852,7 +1850,7 @@ SquidShutdown()
 #if USE_SSL_CRTD
     Ssl::Helper::GetInstance()->Shutdown();
 #endif
-#if USE_SSL //&& USE_SSL_CERT_VALIDATOR
+#if USE_SSL
     if (Ssl::CertValidationHelper::GetInstance())
         Ssl::CertValidationHelper::GetInstance()->Shutdown();
 #endif
index c5b9fff4d14cfe2178b1c2195ff5ec4ad9ce9ae2..a025d05c212450ecb3b8c479777bdabe4fa133f7 100644 (file)
@@ -108,9 +108,6 @@ void Ssl::Helper::sslSubmit(CrtdMessage const & message, HLPCB * callback, void
 }
 #endif //USE_SSL_CRTD
 
-#if 1 // USE_SSL_CERT_VALIDATOR
-/*ssl_crtd_validator*/
-
 Ssl::CertValidationHelper * Ssl::CertValidationHelper::GetInstance()
 {
     static Ssl::CertValidationHelper sslHelper;
@@ -193,4 +190,3 @@ void Ssl::CertValidationHelper::sslSubmit(CrtdMessage const & message, HLPCB * c
     msg += '\n';
     helperSubmit(ssl_crt_validator, msg.c_str(), callback, data);
 }
-#endif // USE_SSL_CERT_VALIDATOR
index f4b15197e53bb2435503848d24833efb3364d5a3..fbdb2849fc71b6af7500ca57941e0b2e523f26e4 100644 (file)
@@ -290,12 +290,10 @@ ssl_verify_cb(int ok, X509_STORE_CTX * ctx)
             filledCheck->sslErrors = NULL;
             filledCheck->serverCert.reset(NULL);
         }
-#if 1 // USE_SSL_CERT_VALIDATOR
         // If the certificate validator is used then we need to allow all errors and
         // pass them to certficate validator for more processing
         else if (Ssl::TheConfig.ssl_crt_validator)
             ok = 1;
-#endif
     }
 
     if (!dont_verify_domain && server) {}