]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SourceFormat Enforcement
authorAutomatic source maintenance <squidadm@squid-cache.org>
Tue, 14 Dec 2010 01:12:24 +0000 (18:12 -0700)
committerAutomatic source maintenance <squidadm@squid-cache.org>
Tue, 14 Dec 2010 01:12:24 +0000 (18:12 -0700)
snmplib/snmp_pdu.c
snmplib/snmp_vars.c
src/comm_select.cc
src/forward.cc
src/fs/coss/store_dir_coss.cc
src/ssl/ErrorDetail.cc
src/ssl/ErrorDetail.h
src/ssl/support.cc
src/ssl/support.h
src/wccp.cc

index 94fe830deddbe4334d86661d75afb4ae5acbc267..0acbf7eab2af07d424304b4b127c455eb8b7efd1 100644 (file)
@@ -519,7 +519,7 @@ snmp_pdu_decode(u_char * Packet,    /* data */
             return (NULL);
         }
         memcpy((char *) PDU->enterprise, (char *) objid,
-                PDU->enterprise_length * sizeof(oid));
+               PDU->enterprise_length * sizeof(oid));
 
         /* Agent-addr */
         four = 4;
index ed3c581eaad3c9c9b19bd34cd096cdddc643012b..f438d0348cb05d3ad4494a575b2b0f4b68a76f35 100644 (file)
@@ -192,7 +192,7 @@ snmp_var_clone(struct variable_list *Src) {
         printf("VARS: Copying name OID. (Size %d)\n", Src->name_length);
 #endif
         memcpy((char *) Dest->name, (char *) Src->name,
-                Src->name_length * sizeof(oid));
+               Src->name_length * sizeof(oid));
     }
     /* CISCO Catalyst 2900 returns NULL strings as data of length 0. */
     if ((Src->val.string != NULL) &&
index 5b8b40a3bc2407b86b2888e02a7dafb6aeea6e74..ee8617d617c9de63d603d3d6ac7cb4e1ba140351 100644 (file)
@@ -381,10 +381,10 @@ comm_select(int msec)
         maxfd = Biggest_FD + 1;
 
         memcpy(&readfds, &global_readfds,
-                howmany(maxfd, FD_MASK_BITS) * FD_MASK_BYTES);
+               howmany(maxfd, FD_MASK_BITS) * FD_MASK_BYTES);
 
         memcpy(&writefds, &global_writefds,
-                howmany(maxfd, FD_MASK_BITS) * FD_MASK_BYTES);
+               howmany(maxfd, FD_MASK_BITS) * FD_MASK_BYTES);
 
         /* remove stalled FDs, and deal with pending descriptors */
         pending = 0;
index f20bb209a775d6bbf9881610c9587d0e5f16b558..b30b3d6aea81d115e6ef8e73005900ecd508d2a0 100644 (file)
@@ -606,7 +606,7 @@ FwdState::negotiateSSL(int fd)
 #endif
 
             Ssl::ErrorDetail *errFromFailure = (Ssl::ErrorDetail *)SSL_get_ex_data(ssl, ssl_ex_index_ssl_error_detail);
-            if (errFromFailure != NULL){
+            if (errFromFailure != NULL) {
                 // The errFromFailure is attached to the ssl object
                 // and will be released when ssl object destroyed.
                 // Copy errFromFailure to a new Ssl::ErrorDetail object
index 7b84624077b6548e693ed162aca6d7c92c29bff3..5937a0fbe72f2ee731f0f1293b1535c667864f29 100644 (file)
@@ -206,7 +206,7 @@ CossSwapDir::readCompleted(const char *buf, int len, int errflag, RefCount<ReadR
 
         sio->offset_ += len;
         memcpy(cstate->requestbuf, &cstate->readbuffer[cstate->requestoffset],
-                cstate->requestlen);
+               cstate->requestlen);
         rlen = (size_t) cstate->requestlen;
     }
 
index ac0d5a5336262fc53b8c5c1bec5869b3bc826074..26ed64d481ea338ccc3a906ff0264580fb3972a0 100644 (file)
@@ -9,9 +9,9 @@ struct SslErrorDetailEntry {
 
 // TODO: optimize by replacing with std::map or similar
 static SslErrorDetailEntry TheSslDetailMap[] = {
-    {  SQUID_X509_V_ERR_DOMAIN_MISMATCH, 
-       "SQUID_X509_V_ERR_DOMAIN_MISMATCH", 
-       "%err_name: The hostname you are connecting to (%H),  does not match any of the Certificate valid names: %ssl_cn"},
+    {  SQUID_X509_V_ERR_DOMAIN_MISMATCH,
+        "SQUID_X509_V_ERR_DOMAIN_MISMATCH",
+        "%err_name: The hostname you are connecting to (%H),  does not match any of the Certificate valid names: %ssl_cn"},
     { X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT,
       "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT",
       "%err_name: SSL Certficate error: certificate issuer (CA) not known: %ssl_ca_name" },
@@ -80,8 +80,7 @@ static const char *getErrorDetail(Ssl::error_t value)
     return NULL;
 }
 
-Ssl::ErrorDetail::err_frm_code Ssl::ErrorDetail::ErrorFormatingCodes[] = 
-{
+Ssl::ErrorDetail::err_frm_code Ssl::ErrorDetail::ErrorFormatingCodes[] = {
     {"ssl_subject", &Ssl::ErrorDetail::subject},
     {"ssl_ca_name", &Ssl::ErrorDetail::ca_name},
     {"ssl_cn", &Ssl::ErrorDetail::cn},
@@ -101,8 +100,8 @@ const char  *Ssl::ErrorDetail::subject() const
 
     static char tmpBuffer[256]; // A temporary buffer
     X509_NAME_oneline(X509_get_subject_name(peer_cert.get()), tmpBuffer,
-                       sizeof(tmpBuffer));
-     return tmpBuffer;
+                      sizeof(tmpBuffer));
+    return tmpBuffer;
 }
 
 // helper function to be used with Ssl::matchX509CommonNames
@@ -204,13 +203,13 @@ int Ssl::ErrorDetail::convert(const char *code, const char **value) const
             *value = (this->*action)();
             return len;
         }
-    }    
+    }
     return 0;
 }
 
 /**
- * It uses the convert method to build the string errDetailStr using 
- * a template message for the current SSL error. The template messages 
+ * It uses the convert method to build the string errDetailStr using
+ * a template message for the current SSL error. The template messages
  * can also contain normal error pages formating codes.
  * Currently the error template messages are hard-coded
  */
@@ -236,16 +235,16 @@ void Ssl::ErrorDetail::buildDetail() const
     errDetailStr.append(s, strlen(s));
 }
 
-const String &Ssl::ErrorDetail::toString() const 
-{ 
+const String &Ssl::ErrorDetail::toString() const
+{
     if (!errDetailStr.defined())
         buildDetail();
     return errDetailStr;
 }
 
-/* We may do not want to use X509_dup but instead 
+/* We may do not want to use X509_dup but instead
    internal SSL locking:
-   CRYPTO_add(&(cert->references),1,CRYPTO_LOCK_X509); 
+   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)
index 7a2d847b0a0962380ef6862300421302b7878aa8..fd3a7ae1cb5994b32df2be3e5bd4e55a01338fe9 100644 (file)
 #define SQUID_SSL_ERROR_MIN SQUID_X509_V_ERR_DOMAIN_MISMATCH
 #define SQUID_SSL_ERROR_MAX INT_MAX
 
-namespace Ssl 
+namespace Ssl
 {
-    /// Squid defined error code (<0),  an error code returned by SSL X509 api, or SSL_ERROR_NONE
-    typedef int error_t;
+/// Squid defined error code (<0),  an error code returned by SSL X509 api, or SSL_ERROR_NONE
+typedef int error_t;
 
 /**
    \ingroup ServerProtocolSSLAPI
@@ -30,14 +30,15 @@ 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(error_t value);
 
 /**
    \ingroup ServerProtocolSSLAPI
  * Used to pass SSL error details to the error pages returned to the
  * end user.
  */
-class ErrorDetail {
+class ErrorDetail
+{
 public:
     ErrorDetail(error_t err_no, X509 *cert);
     ErrorDetail(ErrorDetail const &);
@@ -48,7 +49,8 @@ private:
     /**
      * Holds a formating code and its conversion method
      */
-    class err_frm_code {
+    class err_frm_code
+    {
     public:
         const char *code;             ///< The formating code
         fmt_action_t fmt_action; ///< A pointer to the conversion method
@@ -64,10 +66,10 @@ private:
 
     int convert(const char *code, const char **value) const;
     void buildDetail() const;
-    
+
     mutable String errDetailStr; ///< Caches the error detail message
     error_t error_no;   ///< The error code
-    X509_Pointer peer_cert; ///< A pointer to the peer certificate 
+    X509_Pointer peer_cert; ///< A pointer to the peer certificate
 };
 
 }//namespace Ssl
index 0feeab361e2cbc475b7460400884f9e36e7cc6f9..3e682b9b244334155f6ea9ed6dfb89006a9e17f3 100644 (file)
@@ -144,9 +144,9 @@ int Ssl::asn1timeToString(ASN1_TIME *tm, char *buf, int len)
     int write = 0;
     bio = BIO_new(BIO_s_mem());
     if (bio) {
-       if (ASN1_TIME_print(bio, tm))
-           write = BIO_read(bio, buf, len-1);
-       BIO_free(bio);
+        if (ASN1_TIME_print(bio, tm))
+            write = BIO_read(bio, buf, len-1);
+        BIO_free(bio);
     }
     buf[write]='\0';
     return write;
@@ -159,7 +159,7 @@ int Ssl::matchX509CommonNames(X509 *peer_cert, void *check_data, int (*check_fun
     X509_NAME *name = X509_get_subject_name(peer_cert);
 
     for (int i = X509_NAME_get_index_by_NID(name, NID_commonName, -1); i >= 0; i = X509_NAME_get_index_by_NID(name, NID_commonName, i)) {
-       
+
         ASN1_STRING *cn_data = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name, i));
 
         if ( (*check_func)(check_data, cn_data) == 0)
@@ -177,7 +177,7 @@ int Ssl::matchX509CommonNames(X509 *peer_cert, void *check_data, int (*check_fun
                 continue;
             }
             ASN1_STRING *cn_data = check->d.dNSName;
-            
+
             if ( (*check_func)(check_data, cn_data) == 0)
                 return 1;
         }
@@ -191,7 +191,7 @@ static int check_domain( void *check_data, ASN1_STRING *cn_data)
     char cn[1024];
     const char *server = (const char *)check_data;
 
-    if (cn_data->length > (int)sizeof(cn) - 1) { 
+    if (cn_data->length > (int)sizeof(cn) - 1) {
         return 1; //if does not fit our buffer just ignore
     }
     memcpy(cn, cn_data->data, cn_data->length);
@@ -219,7 +219,7 @@ ssl_verify_cb(int ok, X509_STORE_CTX * ctx)
     if (ok) {
         debugs(83, 5, "SSL Certificate signature OK: " << buffer);
 
-        if (server) {            
+        if (server) {
             int found = Ssl::matchX509CommonNames(peer_cert, (void *)server, check_domain);
 
             if (!found) {
@@ -261,7 +261,7 @@ ssl_verify_cb(int ok, X509_STORE_CTX * ctx)
         case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
             debugs(83, 5, "SSL Certificate is self signed: " << buffer);
             break;
-            
+
         default:
             debugs(83, 1, "SSL unknown certificate error " << ctx->error << " in " << buffer);
             break;
@@ -284,7 +284,7 @@ ssl_verify_cb(int ok, X509_STORE_CTX * ctx)
 
     if (error_no != SSL_ERROR_NONE && !SSL_get_ex_data(ssl, ssl_ex_index_ssl_error_detail) ) {
         Ssl::ErrorDetail *errDetail = new Ssl::ErrorDetail(error_no, peer_cert);
-        if(!SSL_set_ex_data(ssl, ssl_ex_index_ssl_error_detail,  errDetail)) {
+        if (!SSL_set_ex_data(ssl, ssl_ex_index_ssl_error_detail,  errDetail)) {
             debugs(83, 2, "Failed to set Ssl::ErrorDetail in ssl_verify_cb: Certificate " << buffer);
             delete errDetail;
         }
index 2d106ed3db6a69320a9d9d1496e6f457abca6bc3..2e83dd791be6882dbc3f90d7ae83895a704ce8e1 100644 (file)
@@ -114,7 +114,7 @@ SSL_CTX * generateSslContextUsingPkeyAndCertFromMemory(const char * data);
 /**
    \ingroup ServerProtocolSSLAPI
    * Iterates over the X509 common and alternate names and to see if  matches with given data
-   * using the check_func.  
+   * using the check_func.
    \param peer_cert  The X509 cert to check
    \param check_data The data with which the X509 CNs compared
    \param check_func The function used to match X509 CNs. The CN data passed as ASN1_STRING data
index fbe2e74e2d4c0f31af51a2e53d73acc9005f1716..6e01a0824c7946acd63640beabe9ed8c40f4231a 100644 (file)
@@ -355,8 +355,8 @@ wccpAssignBuckets(void)
     for (loop = 0; loop < number_caches; loop++) {
         int i;
         memcpy(&caches[loop],
-                &wccp_i_see_you.wccp_cache_entry[loop].ip_addr,
-                sizeof(*caches));
+               &wccp_i_see_you.wccp_cache_entry[loop].ip_addr,
+               sizeof(*caches));
 
         for (i = 0; i < buckets_per_cache; i++) {
             assert(bucket < WCCP_BUCKETS);