axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r580289 [10/20] - in /webservices/axis2/trunk/c: guththila/include/ guththila/samples/ guththila/src/ guththila/tests/ neethi/include/ neethi/src/ neethi/src/secpolicy/builder/ neethi/src/secpolicy/model/ neethi/test/ samples/client/echo/ s...
Date Fri, 28 Sep 2007 10:29:43 GMT
Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/secpolicy_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/secpolicy_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/secpolicy_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/secpolicy_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -24,172 +25,189 @@
 
 /*private functions*/
 
-axis2_status_t AXIS2_CALL
-secpolicy_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_secpolicy_t *secpolicy);
+axis2_status_t AXIS2_CALL secpolicy_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_secpolicy_t * secpolicy);
 
 /***********************************/
 
-
-AXIS2_EXTERN rp_secpolicy_t *AXIS2_CALL 
+AXIS2_EXTERN rp_secpolicy_t *AXIS2_CALL
 rp_secpolicy_builder_build(
-        const axutil_env_t *env,
-        neethi_policy_t *policy)
-
+    const axutil_env_t * env,
+    neethi_policy_t * policy)
 {
     axutil_array_list_t *alternatives = NULL;
     neethi_operator_t *component = NULL;
     neethi_all_t *all = NULL;
     rp_secpolicy_t *secpolicy = NULL;
-    /*neethi_policy_t *normalized_policy = NULL;*/
+    /*neethi_policy_t *normalized_policy = NULL; */
 
     secpolicy = rp_secpolicy_create(env);
 
-    /*normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);*/
+    /*normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy); */
 
     alternatives = neethi_policy_get_alternatives(policy, env);
 
-    component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);            
-    all = (neethi_all_t *)neethi_operator_get_value(component ,env);
-    
-    if(secpolicy_process_alternatives(env, all, secpolicy) == AXIS2_FAILURE)
+    component =
+        (neethi_operator_t *) axutil_array_list_get(alternatives, env, 0);
+    all = (neethi_all_t *) neethi_operator_get_value(component, env);
+
+    if (secpolicy_process_alternatives(env, all, secpolicy) == AXIS2_FAILURE)
     {
         return NULL;
-    }        
+    }
     return secpolicy;
 }
 
 axis2_status_t AXIS2_CALL
 secpolicy_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_secpolicy_t *secpolicy)
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_secpolicy_t * secpolicy)
 {
 
     neethi_operator_t *operator = NULL;
     axutil_array_list_t *arraylist = NULL;
     neethi_assertion_t *assertion = NULL;
-    neethi_assertion_type_t type;    
+    neethi_assertion_type_t type;
     void *value = NULL;
 
     int i = 0;
 
     arraylist = neethi_all_get_policy_components(all, env);
 
-    for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+    for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
     {
-        operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
-        assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
+        operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+                                                              i);
+        assertion =
+            (neethi_assertion_t *) neethi_operator_get_value(operator, env);
         value = neethi_assertion_get_value(assertion, env);
         type = neethi_assertion_get_type(assertion, env);
 
-        if(value)
+        if (value)
         {
-            if(type == ASSERTION_TYPE_TRANSPORT_BINDING)
+            if (type == ASSERTION_TYPE_TRANSPORT_BINDING)
             {
-                rp_property_t *binding = NULL;    
+                rp_property_t *binding = NULL;
                 rp_transport_binding_t *transport_binding = NULL;
 
-                transport_binding = (rp_transport_binding_t *)neethi_assertion_get_value(
-                        assertion, env);
-                if(!transport_binding)
+                transport_binding =
+                    (rp_transport_binding_t *)
+                    neethi_assertion_get_value(assertion, env);
+                if (!transport_binding)
                 {
                     return AXIS2_FAILURE;
-                }                    
+                }
                 binding = rp_property_create(env);
-                rp_property_set_value(binding, env, transport_binding, 
-                        RP_PROPERTY_TRANSPORT_BINDING);             
+                rp_property_set_value(binding, env, transport_binding,
+                                      RP_PROPERTY_TRANSPORT_BINDING);
                 rp_secpolicy_set_binding(secpolicy, env, binding);
             }
-            else if(type == ASSERTION_TYPE_ASSYMMETRIC_BINDING)
+            else if (type == ASSERTION_TYPE_ASSYMMETRIC_BINDING)
             {
-                rp_property_t *binding = NULL;    
+                rp_property_t *binding = NULL;
                 rp_asymmetric_binding_t *asymmetric_binding = NULL;
 
-                asymmetric_binding = (rp_asymmetric_binding_t *)neethi_assertion_get_value(
-                        assertion, env);
-                if(!asymmetric_binding)
+                asymmetric_binding =
+                    (rp_asymmetric_binding_t *)
+                    neethi_assertion_get_value(assertion, env);
+                if (!asymmetric_binding)
                 {
-                    /*printf("Asymmetric Binding not set\n");*/
+                    /*printf("Asymmetric Binding not set\n"); */
                     return AXIS2_FAILURE;
-                }                    
+                }
                 binding = rp_property_create(env);
-                rp_property_set_value(binding, env, asymmetric_binding, RP_PROPERTY_ASYMMETRIC_BINDING);             
+                rp_property_set_value(binding, env, asymmetric_binding,
+                                      RP_PROPERTY_ASYMMETRIC_BINDING);
                 rp_secpolicy_set_binding(secpolicy, env, binding);
             }
-            else if(type == ASSERTION_TYPE_SUPPORTING_TOKENS)
+            else if (type == ASSERTION_TYPE_SUPPORTING_TOKENS)
             {
                 rp_supporting_tokens_t *supporting_tokens = NULL;
-                supporting_tokens = (rp_supporting_tokens_t *)neethi_assertion_get_value(
-                        assertion, env);
-                if(supporting_tokens)
+                supporting_tokens =
+                    (rp_supporting_tokens_t *)
+                    neethi_assertion_get_value(assertion, env);
+                if (supporting_tokens)
                 {
                     rp_property_type_t type;
-                    type = rp_supporting_tokens_get_type(supporting_tokens, env);
-                    if(type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
+                    type =
+                        rp_supporting_tokens_get_type(supporting_tokens, env);
+                    if (type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
                     {
-                        rp_secpolicy_set_signed_supporting_tokens(
-                                secpolicy, env, supporting_tokens);
-                    }    
-                    else if(type == RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN)
+                        rp_secpolicy_set_signed_supporting_tokens(secpolicy,
+                                                                  env,
+                                                                  supporting_tokens);
+                    }
+                    else if (type ==
+                             RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN)
                     {
-                        rp_secpolicy_set_endorsing_supporting_tokens(
-                                secpolicy, env, supporting_tokens);
-                    }                       
-                    else return AXIS2_FAILURE;
-                }                    
-                else return AXIS2_FAILURE;
+                        rp_secpolicy_set_endorsing_supporting_tokens(secpolicy,
+                                                                     env,
+                                                                     supporting_tokens);
+                    }
+                    else
+                        return AXIS2_FAILURE;
+                }
+                else
+                    return AXIS2_FAILURE;
             }
-            else if(type == ASSERTION_TYPE_WSS10)
+            else if (type == ASSERTION_TYPE_WSS10)
             {
                 rp_wss10_t *wss10 = NULL;
                 rp_property_t *wss = NULL;
-                wss10 = (rp_wss10_t *)neethi_assertion_get_value(assertion, env);
-                if(!wss10)
+                wss10 =
+                    (rp_wss10_t *) neethi_assertion_get_value(assertion, env);
+                if (!wss10)
                 {
                     return AXIS2_FAILURE;
-                }                    
+                }
                 wss = rp_property_create(env);
                 rp_property_set_value(wss, env, wss10, RP_PROPERTY_WSS10);
                 rp_secpolicy_set_wss(secpolicy, env, wss);
             }
-            else if(type == ASSERTION_TYPE_SIGNED_ENCRYPTED_PARTS)
+            else if (type == ASSERTION_TYPE_SIGNED_ENCRYPTED_PARTS)
             {
                 rp_signed_encrypted_parts_t *signed_encrypted_parts = NULL;
-                signed_encrypted_parts = (rp_signed_encrypted_parts_t *)neethi_assertion_get_value(
-                        assertion, env);
-                if(signed_encrypted_parts)
+                signed_encrypted_parts =
+                    (rp_signed_encrypted_parts_t *)
+                    neethi_assertion_get_value(assertion, env);
+                if (signed_encrypted_parts)
                 {
-                    if(rp_signed_encrypted_parts_get_signedparts(signed_encrypted_parts, env))
+                    if (rp_signed_encrypted_parts_get_signedparts
+                        (signed_encrypted_parts, env))
                     {
-                        rp_secpolicy_set_signed_parts(
-                                secpolicy, env, signed_encrypted_parts);
+                        rp_secpolicy_set_signed_parts(secpolicy, env,
+                                                      signed_encrypted_parts);
                     }
                     else
                     {
-                        rp_secpolicy_set_encrypted_parts(
-                                secpolicy, env, signed_encrypted_parts);
+                        rp_secpolicy_set_encrypted_parts(secpolicy, env,
+                                                         signed_encrypted_parts);
                     }
                 }
-                else return AXIS2_FAILURE;
+                else
+                    return AXIS2_FAILURE;
 
             }
-            else if(type == ASSERTION_TYPE_RAMPART_CONFIG)
+            else if (type == ASSERTION_TYPE_RAMPART_CONFIG)
             {
                 rp_rampart_config_t *rampart_config = NULL;
-                rampart_config = (rp_rampart_config_t *)neethi_assertion_get_value(
-                        assertion, env);
-                if(!rampart_config)
+                rampart_config =
+                    (rp_rampart_config_t *)
+                    neethi_assertion_get_value(assertion, env);
+                if (!rampart_config)
                 {
                     return AXIS2_FAILURE;
-                }    
+                }
                 rp_secpolicy_set_rampart_config(secpolicy, env, rampart_config);
-            }                
-            else return AXIS2_FAILURE;
-        }        
-        else return AXIS2_FAILURE;
+            }
+            else
+                return AXIS2_FAILURE;
+        }
+        else
+            return AXIS2_FAILURE;
     }
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/signed_encrypted_parts_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/signed_encrypted_parts_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/signed_encrypted_parts_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/signed_encrypted_parts_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +16,6 @@
  * limitations under the License.
  */
 
-
 #include <rp_signed_encrypted_parts_builder.h>
 #include <neethi_operator.h>
 #include <neethi_policy.h>
@@ -24,176 +24,182 @@
 #include <neethi_engine.h>
 #include <rp_qname_matcher.h>
 
-rp_header_t *AXIS2_CALL
-rp_signed_encrypted_parts_builder_build_header(
-    axiom_element_t *element,
-    const axutil_env_t *env);
-
-
-axis2_status_t AXIS2_CALL
-rp_signed_encrypted_parts_builder_set_properties(
-        axiom_node_t *node,
-        axiom_element_t *element,
-        axis2_char_t *local_name,
-        rp_signed_encrypted_parts_t *signed_encrypted_parts,
-        const axutil_env_t *env);
-
-
+rp_header_t *AXIS2_CALL rp_signed_encrypted_parts_builder_build_header(
+    axiom_element_t * element,
+    const axutil_env_t * env);
+
+axis2_status_t AXIS2_CALL rp_signed_encrypted_parts_builder_set_properties(
+    axiom_node_t * node,
+    axiom_element_t * element,
+    axis2_char_t * local_name,
+    rp_signed_encrypted_parts_t * signed_encrypted_parts,
+    const axutil_env_t * env);
 
 AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
 rp_signed_encrypted_parts_builder_build(
-            const axutil_env_t *env,
-            axiom_node_t *parts,
-            axiom_element_t *parts_ele)
+    const axutil_env_t * env,
+    axiom_node_t * parts,
+    axiom_element_t * parts_ele)
 {
-    
+
     rp_signed_encrypted_parts_t *signed_encrypted_parts = NULL;
     axiom_children_iterator_t *children_iter = NULL;
     neethi_assertion_t *assertion = NULL;
     axis2_char_t *ele_name = NULL;
     axis2_status_t status = AXIS2_SUCCESS;
 
-    AXIS2_ENV_CHECK(env,NULL);
+    AXIS2_ENV_CHECK(env, NULL);
 
     signed_encrypted_parts = rp_signed_encrypted_parts_create(env);
-    if(!signed_encrypted_parts)
-    {    
+    if (!signed_encrypted_parts)
+    {
         return NULL;
     }
 
     ele_name = axiom_element_get_localname(parts_ele, env);
-    if(ele_name)
+    if (ele_name)
     {
-        if((axutil_strcmp(ele_name,RP_SIGNED_PARTS)==0))
+        if ((axutil_strcmp(ele_name, RP_SIGNED_PARTS) == 0))
+        {
+            rp_signed_encrypted_parts_set_signedparts(signed_encrypted_parts,
+                                                      env, AXIS2_TRUE);
+        }
+        else if (axutil_strcmp(ele_name, RP_ENCRYPTED_PARTS) == 0)
         {
-             rp_signed_encrypted_parts_set_signedparts(
-                     signed_encrypted_parts, env, AXIS2_TRUE);
-        }                    
-        else if(axutil_strcmp(ele_name,RP_ENCRYPTED_PARTS)==0)
-        {
-             rp_signed_encrypted_parts_set_signedparts(
-                     signed_encrypted_parts, env, AXIS2_FALSE);
-        }            
-        else return NULL;
-    }        
-    else return NULL;
+            rp_signed_encrypted_parts_set_signedparts(signed_encrypted_parts,
+                                                      env, AXIS2_FALSE);
+        }
+        else
+            return NULL;
+    }
+    else
+        return NULL;
 
     children_iter = axiom_element_get_children(parts_ele, env, parts);
-    if(children_iter )
+    if (children_iter)
     {
-        while(axiom_children_iterator_has_next(children_iter, env))
+        while (axiom_children_iterator_has_next(children_iter, env))
         {
             axiom_node_t *node = NULL;
             axiom_element_t *ele = NULL;
             axis2_char_t *local_name = NULL;
             node = axiom_children_iterator_next(children_iter, env);
-            if(node)
+            if (node)
             {
-                if(axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
+                if (axiom_node_get_node_type(node, env) == AXIOM_ELEMENT)
                 {
-                    ele = (axiom_element_t*)axiom_node_get_data_element(node, env);
-                    if(ele)
+                    ele =
+                        (axiom_element_t *) axiom_node_get_data_element(node,
+                                                                        env);
+                    if (ele)
                     {
                         local_name = axiom_element_get_localname(ele, env);
-                        if(local_name)
+                        if (local_name)
                         {
-                            status = rp_signed_encrypted_parts_builder_set_properties(
-                                    node, ele, local_name, signed_encrypted_parts, env);
-                            if(status!=AXIS2_SUCCESS)
+                            status =
+                                rp_signed_encrypted_parts_builder_set_properties
+                                (node, ele, local_name, signed_encrypted_parts,
+                                 env);
+                            if (status != AXIS2_SUCCESS)
                             {
-                                rp_signed_encrypted_parts_free(signed_encrypted_parts, env);
+                                rp_signed_encrypted_parts_free
+                                    (signed_encrypted_parts, env);
                                 signed_encrypted_parts = NULL;
-                            }                           
+                            }
                         }
                     }
                 }
             }
         }
     }
-    assertion = neethi_assertion_create_with_args(
-            env, (void *)rp_signed_encrypted_parts_free, signed_encrypted_parts, ASSERTION_TYPE_SIGNED_ENCRYPTED_PARTS);    
+    assertion =
+        neethi_assertion_create_with_args(env,
+                                          (void *)
+                                          rp_signed_encrypted_parts_free,
+                                          signed_encrypted_parts,
+                                          ASSERTION_TYPE_SIGNED_ENCRYPTED_PARTS);
     return assertion;
-}            
-
+}
 
 axis2_status_t AXIS2_CALL
 rp_signed_encrypted_parts_builder_set_properties(
-        axiom_node_t *node,
-        axiom_element_t *element,
-        axis2_char_t *local_name,
-        rp_signed_encrypted_parts_t *signed_encrypted_parts,
-        const axutil_env_t *env)
+    axiom_node_t * node,
+    axiom_element_t * element,
+    axis2_char_t * local_name,
+    rp_signed_encrypted_parts_t * signed_encrypted_parts,
+    const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    if(strcmp(local_name, RP_BODY)==0)
+    if (strcmp(local_name, RP_BODY) == 0)
     {
-        if(rp_match_secpolicy_qname(env, RP_BODY, node, element))
+        if (rp_match_secpolicy_qname(env, RP_BODY, node, element))
         {
-            rp_signed_encrypted_parts_set_body(
-                    signed_encrypted_parts, env, AXIS2_TRUE);
+            rp_signed_encrypted_parts_set_body(signed_encrypted_parts, env,
+                                               AXIS2_TRUE);
             return AXIS2_SUCCESS;
         }
         else
-        {    
+        {
             return AXIS2_FAILURE;
         }
     }
-    else if(strcmp(local_name, RP_HEADER)==0)
+    else if (strcmp(local_name, RP_HEADER) == 0)
     {
-        if(rp_match_secpolicy_qname(env, RP_HEADER, node, element))
+        if (rp_match_secpolicy_qname(env, RP_HEADER, node, element))
         {
             rp_header_t *header = NULL;
-            header = rp_signed_encrypted_parts_builder_build_header(element, env);
-            if(!header)
-            {    
+            header =
+                rp_signed_encrypted_parts_builder_build_header(element, env);
+            if (!header)
+            {
                 return AXIS2_FAILURE;
             }
 
-            return rp_signed_encrypted_parts_add_header(
-                    signed_encrypted_parts, env, header);    
+            return rp_signed_encrypted_parts_add_header(signed_encrypted_parts,
+                                                        env, header);
         }
-        else 
-        {    
+        else
+        {
             return AXIS2_FAILURE;
-        }    
+        }
     }
     else
-    {    
+    {
         return AXIS2_FAILURE;
-    }    
+    }
 }
 
-rp_header_t *AXIS2_CALL 
+rp_header_t *AXIS2_CALL
 rp_signed_encrypted_parts_builder_build_header(
-    axiom_element_t *element,
-    const axutil_env_t *env)
+    axiom_element_t * element,
+    const axutil_env_t * env)
 {
     rp_header_t *header = NULL;
     axis2_char_t *name = NULL;
-    axis2_char_t *nspace = NULL;    
+    axis2_char_t *nspace = NULL;
 
-    AXIS2_ENV_CHECK(env,NULL);
+    AXIS2_ENV_CHECK(env, NULL);
 
-    header = rp_header_create(env);    
-    if(!header)
+    header = rp_header_create(env);
+    if (!header)
         return NULL;
 
     name = axiom_element_get_attribute_value_by_name(element, env, RP_NAME);
-    nspace = axiom_element_get_attribute_value_by_name(
-            element, env, RP_NAMESPACE);
-    if(!nspace)
+    nspace =
+        axiom_element_get_attribute_value_by_name(element, env, RP_NAMESPACE);
+    if (!nspace)
     {
         rp_header_free(header, env);
         header = NULL;
-        return NULL;    
-    }     
-    if(name)
-    {    
-        rp_header_set_name(header, env, name); 
+        return NULL;
+    }
+    if (name)
+    {
+        rp_header_set_name(header, env, name);
     }
 
-    rp_header_set_namespace(header, env, nspace);    
-    
+    rp_header_set_namespace(header, env, nspace);
+
     return header;
 }

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/supporting_tokens_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/supporting_tokens_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/supporting_tokens_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/supporting_tokens_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -24,27 +25,22 @@
 
 /*private functions*/
 
-axis2_status_t AXIS2_CALL
-supporting_tokens_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_supporting_tokens_t *supporting_tokens);
-
+axis2_status_t AXIS2_CALL supporting_tokens_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_supporting_tokens_t * supporting_tokens);
 
 axis2_bool_t AXIS2_CALL is_token_assertion(
-        const axutil_env_t *env,
-        neethi_assertion_type_t type);
-
+    const axutil_env_t * env,
+    neethi_assertion_type_t type);
 
 /***********************************/
 
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL 
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
 rp_supporting_tokens_builder_build(
-        const axutil_env_t *env,
-        axiom_node_t *node,
-        axiom_element_t *element)
-
+    const axutil_env_t * env,
+    axiom_node_t * node,
+    axiom_element_t * element)
 {
     rp_supporting_tokens_t *supporting_tokens = NULL;
     neethi_policy_t *policy = NULL;
@@ -60,124 +56,145 @@
     supporting_tokens = rp_supporting_tokens_create(env);
     local_name = axiom_element_get_localname(element, env);
 
-    if(local_name)
+    if (local_name)
     {
-        if(axutil_strcmp(local_name, RP_SIGNED_SUPPORTING_TOKENS) == 0)
+        if (axutil_strcmp(local_name, RP_SIGNED_SUPPORTING_TOKENS) == 0)
         {
-            rp_supporting_tokens_set_type(
-                    supporting_tokens, env, RP_PROPERTY_SIGNED_SUPPORTING_TOKEN);
+            rp_supporting_tokens_set_type(supporting_tokens, env,
+                                          RP_PROPERTY_SIGNED_SUPPORTING_TOKEN);
         }
-        else if(axutil_strcmp(local_name, RP_SIGNED_ENDORSING_SUPPORTING_TOKENS)==0)
+        else if (axutil_strcmp
+                 (local_name, RP_SIGNED_ENDORSING_SUPPORTING_TOKENS) == 0)
         {
-            rp_supporting_tokens_set_type(
-                    supporting_tokens, env, RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN);
-        } 
-        else return NULL;
-    }        
-    else return NULL;
+            rp_supporting_tokens_set_type(supporting_tokens, env,
+                                          RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN);
+        }
+        else
+            return NULL;
+    }
+    else
+        return NULL;
 
-    child_node = axiom_node_get_first_element(node,env);
-    if(!child_node)
+    child_node = axiom_node_get_first_element(node, env);
+    if (!child_node)
     {
         return NULL;
-    }    
+    }
 
-    if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+    if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
     {
-        child_element = (axiom_element_t*)axiom_node_get_data_element(child_node, env);
-        if(child_element)
+        child_element =
+            (axiom_element_t *) axiom_node_get_data_element(child_node, env);
+        if (child_element)
         {
             policy = neethi_engine_get_policy(env, child_node, child_element);
-            if(!policy)
+            if (!policy)
             {
                 return NULL;
             }
-            normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
-            alternatives = neethi_policy_get_alternatives(normalized_policy, env);
+            normalized_policy =
+                neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+            alternatives =
+                neethi_policy_get_alternatives(normalized_policy, env);
             neethi_policy_free(policy, env);
             policy = NULL;
-            component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);            
-            all = (neethi_all_t *)neethi_operator_get_value(component ,env);
+            component =
+                (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+                                                            0);
+            all = (neethi_all_t *) neethi_operator_get_value(component, env);
             supporting_tokens_process_alternatives(env, all, supporting_tokens);
 
-            assertion = neethi_assertion_create_with_args(
-                    env, (void *)rp_supporting_tokens_free, supporting_tokens, ASSERTION_TYPE_SUPPORTING_TOKENS);
-            
+            assertion =
+                neethi_assertion_create_with_args(env,
+                                                  (void *)
+                                                  rp_supporting_tokens_free,
+                                                  supporting_tokens,
+                                                  ASSERTION_TYPE_SUPPORTING_TOKENS);
+
             neethi_policy_free(normalized_policy, env);
             normalized_policy = NULL;
-                        
+
             return assertion;
         }
-        else return NULL;
+        else
+            return NULL;
     }
-    else return NULL;
+    else
+        return NULL;
 }
 
 axis2_status_t AXIS2_CALL
 supporting_tokens_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_supporting_tokens_t *supporting_tokens)
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_supporting_tokens_t * supporting_tokens)
 {
     neethi_operator_t *operator = NULL;
     axutil_array_list_t *arraylist = NULL;
     neethi_assertion_t *assertion = NULL;
-    neethi_assertion_type_t type;    
+    neethi_assertion_type_t type;
     void *value = NULL;
 
     int i = 0;
 
     arraylist = neethi_all_get_policy_components(all, env);
 
-    for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+    for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
     {
-        operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
-        assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
+        operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+                                                              i);
+        assertion =
+            (neethi_assertion_t *) neethi_operator_get_value(operator, env);
         value = neethi_assertion_get_value(assertion, env);
         type = neethi_assertion_get_type(assertion, env);
 
-        if(value)
+        if (value)
         {
-            if(type == ASSERTION_TYPE_ALGORITHM_SUITE)
+            if (type == ASSERTION_TYPE_ALGORITHM_SUITE)
             {
                 rp_algorithmsuite_t *algorithmsuite = NULL;
-                algorithmsuite = (rp_algorithmsuite_t *)neethi_assertion_get_value(
-                        assertion, env);
-                if(algorithmsuite)
+                algorithmsuite =
+                    (rp_algorithmsuite_t *)
+                    neethi_assertion_get_value(assertion, env);
+                if (algorithmsuite)
                 {
-                    rp_supporting_tokens_set_algorithmsuite(
-                            supporting_tokens, env, algorithmsuite);
+                    rp_supporting_tokens_set_algorithmsuite(supporting_tokens,
+                                                            env,
+                                                            algorithmsuite);
                 }
-                else return AXIS2_FAILURE;
+                else
+                    return AXIS2_FAILURE;
             }
-            else if(is_token_assertion(env, type))
+            else if (is_token_assertion(env, type))
             {
                 rp_property_t *token = NULL;
                 token = rp_property_create(env);
                 rp_token_identifier_set_token(token, assertion, env);
-                rp_supporting_tokens_add_token(supporting_tokens, env, token);                                
+                rp_supporting_tokens_add_token(supporting_tokens, env, token);
             }
-            else return AXIS2_FAILURE;
-        }        
-        else return AXIS2_FAILURE;
+            else
+                return AXIS2_FAILURE;
+        }
+        else
+            return AXIS2_FAILURE;
     }
     return AXIS2_SUCCESS;
 }
 
-
-axis2_bool_t AXIS2_CALL is_token_assertion(
-        const axutil_env_t *env,
-        neethi_assertion_type_t type)
+axis2_bool_t AXIS2_CALL
+is_token_assertion(
+    const axutil_env_t * env,
+    neethi_assertion_type_t type)
 {
 
-    if(type == ASSERTION_TYPE_USERNAME_TOKEN)
+    if (type == ASSERTION_TYPE_USERNAME_TOKEN)
     {
         return AXIS2_TRUE;
     }
-    else if(type == ASSERTION_TYPE_X509_TOKEN)
+    else if (type == ASSERTION_TYPE_X509_TOKEN)
     {
         return AXIS2_TRUE;
     }
-    else return AXIS2_FALSE;
+    else
+        return AXIS2_FALSE;
 }
-

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/token_identifier.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/token_identifier.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/token_identifier.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/token_identifier.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -25,15 +26,13 @@
 
 /*private functions*/
 
-
 /***********************************/
 
-
-AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
 rp_token_identifier_set_token(
-        rp_property_t *token,
-        neethi_assertion_t *assertion,
-        const axutil_env_t *env)
+    rp_property_t * token,
+    neethi_assertion_t * assertion,
+    const axutil_env_t * env)
 {
     void *value = NULL;
     neethi_assertion_type_t type;
@@ -41,26 +40,27 @@
     value = neethi_assertion_get_value(assertion, env);
     type = neethi_assertion_get_type(assertion, env);
 
-    if(value)
+    if (value)
     {
-        if(type == ASSERTION_TYPE_USERNAME_TOKEN)
+        if (type == ASSERTION_TYPE_USERNAME_TOKEN)
         {
             rp_username_token_t *username_token = NULL;
-            username_token = (rp_username_token_t *)value;
-            rp_property_set_value(token, env, username_token, 
-                    RP_PROPERTY_USERNAME_TOKEN);
+            username_token = (rp_username_token_t *) value;
+            rp_property_set_value(token, env, username_token,
+                                  RP_PROPERTY_USERNAME_TOKEN);
             return AXIS2_SUCCESS;
-        }            
-        else if(type == ASSERTION_TYPE_X509_TOKEN)
+        }
+        else if (type == ASSERTION_TYPE_X509_TOKEN)
         {
             rp_x509_token_t *x509_token = NULL;
-            x509_token = (rp_x509_token_t *)value;
-            rp_property_set_value(token, env, x509_token, 
-                    RP_PROPERTY_X509_TOKEN);
+            x509_token = (rp_x509_token_t *) value;
+            rp_property_set_value(token, env, x509_token,
+                                  RP_PROPERTY_X509_TOKEN);
             return AXIS2_SUCCESS;
         }
         else
             return AXIS2_FAILURE;
-    }        
-    else return AXIS2_FAILURE;
+    }
+    else
+        return AXIS2_FAILURE;
 }

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_binding_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_binding_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_binding_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_binding_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -24,21 +25,18 @@
 
 /*private functions*/
 
-axis2_status_t AXIS2_CALL
-transport_binding_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_transport_binding_t *transport_binding);
+axis2_status_t AXIS2_CALL transport_binding_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_transport_binding_t * transport_binding);
 
 /***********************************/
 
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL 
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
 rp_transport_binding_builder_build(
-        const axutil_env_t *env,
-        axiom_node_t *node,
-        axiom_element_t *element)
-
+    const axutil_env_t * env,
+    axiom_node_t * node,
+    axiom_element_t * element)
 {
     rp_transport_binding_t *transport_binding = NULL;
     neethi_policy_t *policy = NULL;
@@ -51,137 +49,157 @@
     neethi_policy_t *normalized_policy = NULL;
 
     transport_binding = rp_transport_binding_create(env);
-    
-    child_node = axiom_node_get_first_element(node,env);
 
-    if(!child_node)
+    child_node = axiom_node_get_first_element(node, env);
+
+    if (!child_node)
     {
         return NULL;
-    }    
+    }
 
-    if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+    if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
     {
-        child_element = (axiom_element_t*)axiom_node_get_data_element(child_node, env);
-        if(child_element)
+        child_element =
+            (axiom_element_t *) axiom_node_get_data_element(child_node, env);
+        if (child_element)
         {
             policy = neethi_engine_get_policy(env, child_node, child_element);
-            if(!policy)
+            if (!policy)
             {
                 return NULL;
             }
-            normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy); 
+            normalized_policy =
+                neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
             neethi_policy_free(policy, env);
             policy = NULL;
-            alternatives = neethi_policy_get_alternatives(
-                    normalized_policy, env);
-            component = (neethi_operator_t *)axutil_array_list_get(
-                    alternatives, env, 0);            
-            all = (neethi_all_t *)neethi_operator_get_value(component ,env);
+            alternatives =
+                neethi_policy_get_alternatives(normalized_policy, env);
+            component =
+                (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+                                                            0);
+            all = (neethi_all_t *) neethi_operator_get_value(component, env);
             transport_binding_process_alternatives(env, all, transport_binding);
 
-            assertion = neethi_assertion_create_with_args(
-                    env, (void *)rp_transport_binding_free, transport_binding, ASSERTION_TYPE_TRANSPORT_BINDING);
-            
+            assertion =
+                neethi_assertion_create_with_args(env,
+                                                  (void *)
+                                                  rp_transport_binding_free,
+                                                  transport_binding,
+                                                  ASSERTION_TYPE_TRANSPORT_BINDING);
+
             neethi_policy_free(normalized_policy, env);
             normalized_policy = NULL;
 
             return assertion;
         }
-        else return NULL;
+        else
+            return NULL;
     }
-    else return NULL;
+    else
+        return NULL;
 }
 
 axis2_status_t AXIS2_CALL
 transport_binding_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_transport_binding_t *transport_binding)
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_transport_binding_t * transport_binding)
 {
 
     neethi_operator_t *operator = NULL;
     axutil_array_list_t *arraylist = NULL;
     neethi_assertion_t *assertion = NULL;
-    neethi_assertion_type_t type;    
+    neethi_assertion_type_t type;
     void *value = NULL;
     rp_binding_commons_t *commons = NULL;
 
     int i = 0;
 
     arraylist = neethi_all_get_policy_components(all, env);
-    commons = rp_binding_commons_create(env);    
+    commons = rp_binding_commons_create(env);
 
-    for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+    for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
     {
-        operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
-        assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
+        operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+                                                              i);
+        assertion =
+            (neethi_assertion_t *) neethi_operator_get_value(operator, env);
         value = neethi_assertion_get_value(assertion, env);
         type = neethi_assertion_get_type(assertion, env);
 
-        if(type == ASSERTION_TYPE_TRANSPORT_TOKEN)
+        if (type == ASSERTION_TYPE_TRANSPORT_TOKEN)
         {
-            rp_property_t *transport_token = NULL;    
-            transport_token = (rp_property_t *)neethi_assertion_get_value(
-                    assertion, env);
-            if(transport_token)
+            rp_property_t *transport_token = NULL;
+            transport_token =
+                (rp_property_t *) neethi_assertion_get_value(assertion, env);
+            if (transport_token)
             {
-                rp_transport_binding_set_transport_token(
-                        transport_binding, env, transport_token);
+                rp_transport_binding_set_transport_token(transport_binding, env,
+                                                         transport_token);
             }
-            else return AXIS2_FAILURE;
+            else
+                return AXIS2_FAILURE;
         }
-        else if(type == ASSERTION_TYPE_ALGORITHM_SUITE)
+        else if (type == ASSERTION_TYPE_ALGORITHM_SUITE)
         {
             rp_algorithmsuite_t *algorithmsuite = NULL;
-            algorithmsuite = (rp_algorithmsuite_t *)neethi_assertion_get_value(
-                    assertion, env);
-            if(algorithmsuite)
+            algorithmsuite =
+                (rp_algorithmsuite_t *) neethi_assertion_get_value(assertion,
+                                                                   env);
+            if (algorithmsuite)
             {
-                rp_binding_commons_set_algorithmsuite(commons, env, algorithmsuite);
-            }                
-            else return AXIS2_FAILURE;
+                rp_binding_commons_set_algorithmsuite(commons, env,
+                                                      algorithmsuite);
+            }
+            else
+                return AXIS2_FAILURE;
         }
-        else if(type == ASSERTION_TYPE_INCLUDE_TIMESTAMP)
+        else if (type == ASSERTION_TYPE_INCLUDE_TIMESTAMP)
         {
             rp_binding_commons_set_include_timestamp(commons, env, AXIS2_TRUE);
         }
-        else if(type == ASSERTION_TYPE_LAYOUT)
+        else if (type == ASSERTION_TYPE_LAYOUT)
         {
             rp_layout_t *layout = NULL;
-            layout = (rp_layout_t *)neethi_assertion_get_value(assertion, env);
-            if(layout)
+            layout = (rp_layout_t *) neethi_assertion_get_value(assertion, env);
+            if (layout)
             {
                 rp_binding_commons_set_layout(commons, env, layout);
-            }                    
-            else return AXIS2_FAILURE;
+            }
+            else
+                return AXIS2_FAILURE;
         }
-        else if(type == ASSERTION_TYPE_SUPPORTING_TOKENS)
+        else if (type == ASSERTION_TYPE_SUPPORTING_TOKENS)
         {
             rp_supporting_tokens_t *supporting_tokens = NULL;
-            supporting_tokens = (rp_supporting_tokens_t *)neethi_assertion_get_value(
-                    assertion, env);
-            if(supporting_tokens)
+            supporting_tokens =
+                (rp_supporting_tokens_t *) neethi_assertion_get_value(assertion,
+                                                                      env);
+            if (supporting_tokens)
             {
                 rp_property_type_t type;
                 type = rp_supporting_tokens_get_type(supporting_tokens, env);
-                if(type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
+                if (type == RP_PROPERTY_SIGNED_SUPPORTING_TOKEN)
                 {
-                    rp_binding_commons_set_signed_supporting_tokens(
-                            commons, env, supporting_tokens);
-                }    
-                else if(type == RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN)
+                    rp_binding_commons_set_signed_supporting_tokens(commons,
+                                                                    env,
+                                                                    supporting_tokens);
+                }
+                else if (type == RP_PROPERTY_SIGNED_ENDORSING_SUPPORTING_TOKEN)
                 {
-                    rp_binding_commons_set_signed_endorsing_supporting_tokens(
-                            commons, env, supporting_tokens);
-                }                       
-                else return AXIS2_FAILURE;
-            }                    
-            else return AXIS2_FAILURE;
+                    rp_binding_commons_set_signed_endorsing_supporting_tokens
+                        (commons, env, supporting_tokens);
+                }
+                else
+                    return AXIS2_FAILURE;
+            }
+            else
+                return AXIS2_FAILURE;
         }
-        else return AXIS2_FAILURE;
+        else
+            return AXIS2_FAILURE;
     }
 
-    rp_transport_binding_set_binding_commons(
-            transport_binding, env, commons);
+    rp_transport_binding_set_binding_commons(transport_binding, env, commons);
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_token_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/transport_token_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -25,21 +26,18 @@
 
 /*private functions*/
 
-axis2_status_t AXIS2_CALL
-transport_token_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_property_t *transport_token);
+axis2_status_t AXIS2_CALL transport_token_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_property_t * transport_token);
 
 /***********************************/
 
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL 
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
 rp_transport_token_builder_build(
-        const axutil_env_t *env,
-        axiom_node_t *node,
-        axiom_element_t *element)
-
+    const axutil_env_t * env,
+    axiom_node_t * node,
+    axiom_element_t * element)
 {
     rp_property_t *transport_token = NULL;
     neethi_policy_t *policy = NULL;
@@ -52,85 +50,100 @@
     neethi_policy_t *normalized_policy = NULL;
 
     transport_token = rp_property_create(env);
-    
-    child_node = axiom_node_get_first_element(node,env);
-    if(!child_node)
+
+    child_node = axiom_node_get_first_element(node, env);
+    if (!child_node)
     {
         return NULL;
-    }    
+    }
 
-    if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+    if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
     {
-        child_element = (axiom_element_t*)axiom_node_get_data_element(child_node, env);
-        if(child_element)
+        child_element =
+            (axiom_element_t *) axiom_node_get_data_element(child_node, env);
+        if (child_element)
         {
             policy = neethi_engine_get_policy(env, child_node, child_element);
-            if(!policy)
+            if (!policy)
             {
                 return NULL;
             }
-            normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy); 
+            normalized_policy =
+                neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
             policy = NULL;
-            alternatives =neethi_policy_get_alternatives(normalized_policy, env);
-            component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);            
-            all = (neethi_all_t *)neethi_operator_get_value(component ,env);
+            alternatives =
+                neethi_policy_get_alternatives(normalized_policy, env);
+            component =
+                (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+                                                            0);
+            all = (neethi_all_t *) neethi_operator_get_value(component, env);
             transport_token_process_alternatives(env, all, transport_token);
 
-            assertion = neethi_assertion_create_with_args(
-                    env, (void *)rp_property_free, transport_token, ASSERTION_TYPE_TRANSPORT_TOKEN);
+            assertion =
+                neethi_assertion_create_with_args(env,
+                                                  (void *) rp_property_free,
+                                                  transport_token,
+                                                  ASSERTION_TYPE_TRANSPORT_TOKEN);
 
             neethi_policy_free(normalized_policy, env);
             normalized_policy = NULL;
 
             return assertion;
         }
-        else return NULL;
+        else
+            return NULL;
     }
-    else return NULL;
+    else
+        return NULL;
 }
 
 axis2_status_t AXIS2_CALL
 transport_token_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_property_t *transport_token)
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_property_t * transport_token)
 {
 
     neethi_operator_t *operator = NULL;
     axutil_array_list_t *arraylist = NULL;
     neethi_assertion_t *assertion = NULL;
-    neethi_assertion_type_t type;    
+    neethi_assertion_type_t type;
     void *value = NULL;
 
     int i = 0;
 
     arraylist = neethi_all_get_policy_components(all, env);
 
-    for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+    for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
     {
-        operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
-        assertion = (neethi_assertion_t *)neethi_operator_get_value(
-                operator, env);
+        operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+                                                              i);
+        assertion =
+            (neethi_assertion_t *) neethi_operator_get_value(operator, env);
         value = neethi_assertion_get_value(assertion, env);
         type = neethi_assertion_get_type(assertion, env);
 
-        if(value)
+        if (value)
         {
-            if(type == ASSERTION_TYPE_HTTPS_TOKEN)
+            if (type == ASSERTION_TYPE_HTTPS_TOKEN)
             {
-                rp_https_token_t *https_token = NULL;    
-                https_token = (rp_https_token_t *)neethi_assertion_get_value(
-                        assertion, env);
-                if(https_token)
+                rp_https_token_t *https_token = NULL;
+                https_token =
+                    (rp_https_token_t *) neethi_assertion_get_value(assertion,
+                                                                    env);
+                if (https_token)
                 {
-                    rp_property_set_value(transport_token, env, 
-                            https_token, RP_PROPERTY_HTTPS_TOKEN);
+                    rp_property_set_value(transport_token, env,
+                                          https_token, RP_PROPERTY_HTTPS_TOKEN);
                 }
-                else return AXIS2_FAILURE;
+                else
+                    return AXIS2_FAILURE;
             }
-            else return AXIS2_FAILURE;
+            else
+                return AXIS2_FAILURE;
         }
-        else return AXIS2_FAILURE;
-    }        
+        else
+            return AXIS2_FAILURE;
+    }
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/username_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/username_token_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/username_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/username_token_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -24,21 +25,18 @@
 
 /*private functions*/
 
-axis2_status_t AXIS2_CALL
-username_token_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_username_token_t *username_token);
+axis2_status_t AXIS2_CALL username_token_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_username_token_t * username_token);
 
 /***********************************/
 
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL 
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
 rp_username_token_builder_build(
-        const axutil_env_t *env,
-        axiom_node_t *node,
-        axiom_element_t *element)
-
+    const axutil_env_t * env,
+    axiom_node_t * node,
+    axiom_element_t * element)
 {
     rp_username_token_t *username_token = NULL;
     neethi_policy_t *policy = NULL;
@@ -61,88 +59,101 @@
     qname = NULL;
 
     rp_username_token_set_inclusion(username_token, env, inclusion_value);
-    
+
     child_node = axiom_node_get_first_element(node, env);
-    if(!child_node)
+    if (!child_node)
     {
         assertion = neethi_assertion_create(env);
         neethi_assertion_set_value(assertion, env,
-                username_token, ASSERTION_TYPE_USERNAME_TOKEN);
+                                   username_token,
+                                   ASSERTION_TYPE_USERNAME_TOKEN);
         return assertion;
-    }        
+    }
 
-    if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+    if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
     {
-        child_element = (axiom_element_t*)axiom_node_get_data_element(
-                child_node, env);
-        if(child_element)
+        child_element =
+            (axiom_element_t *) axiom_node_get_data_element(child_node, env);
+        if (child_element)
         {
             policy = neethi_engine_get_policy(env, child_node, child_element);
-            if(!policy)
+            if (!policy)
             {
                 return NULL;
             }
-            normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+            normalized_policy =
+                neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
             neethi_policy_free(policy, env);
             policy = NULL;
-            alternatives = neethi_policy_get_alternatives(normalized_policy, env);
-            component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);            
-            all = (neethi_all_t *)neethi_operator_get_value(component ,env);
+            alternatives =
+                neethi_policy_get_alternatives(normalized_policy, env);
+            component =
+                (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+                                                            0);
+            all = (neethi_all_t *) neethi_operator_get_value(component, env);
             username_token_process_alternatives(env, all, username_token);
 
-            assertion = neethi_assertion_create_with_args(
-                    env, (void *)rp_username_token_free, username_token, ASSERTION_TYPE_USERNAME_TOKEN);
-            
+            assertion =
+                neethi_assertion_create_with_args(env,
+                                                  (void *)
+                                                  rp_username_token_free,
+                                                  username_token,
+                                                  ASSERTION_TYPE_USERNAME_TOKEN);
+
             neethi_policy_free(normalized_policy, env);
             normalized_policy = NULL;
 
             return assertion;
         }
-        else return NULL;
+        else
+            return NULL;
     }
-    else return NULL;
+    else
+        return NULL;
 }
 
 axis2_status_t AXIS2_CALL
 username_token_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_username_token_t *username_token)
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_username_token_t * username_token)
 {
     neethi_operator_t *operator = NULL;
     axutil_array_list_t *arraylist = NULL;
     neethi_assertion_t *assertion = NULL;
-    neethi_assertion_type_t type;    
+    neethi_assertion_type_t type;
     void *value = NULL;
 
     int i = 0;
 
     arraylist = neethi_all_get_policy_components(all, env);
 
-    for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+    for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
     {
-        operator = (neethi_operator_t *)axutil_array_list_get(
-                arraylist, env, i);
-        assertion = (neethi_assertion_t *)neethi_operator_get_value(
-                operator, env);
+        operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+                                                              i);
+        assertion =
+            (neethi_assertion_t *) neethi_operator_get_value(operator, env);
         value = neethi_assertion_get_value(assertion, env);
         type = neethi_assertion_get_type(assertion, env);
 
-        if(value)
+        if (value)
         {
-            if(type == ASSERTION_TYPE_WSS_USERNAME_TOKEN_10)
+            if (type == ASSERTION_TYPE_WSS_USERNAME_TOKEN_10)
             {
-                rp_username_token_set_useUTprofile10(
-                        username_token, env, AXIS2_TRUE);
+                rp_username_token_set_useUTprofile10(username_token, env,
+                                                     AXIS2_TRUE);
             }
-            else if(type == ASSERTION_TYPE_WSS_USERNAME_TOKEN_11)
+            else if (type == ASSERTION_TYPE_WSS_USERNAME_TOKEN_11)
             {
-                rp_username_token_set_useUTprofile11(
-                        username_token, env, AXIS2_TRUE);
+                rp_username_token_set_useUTprofile11(username_token, env,
+                                                     AXIS2_TRUE);
             }
-            else return AXIS2_FAILURE;
-        }        
-        else return AXIS2_FAILURE;
+            else
+                return AXIS2_FAILURE;
+        }
+        else
+            return AXIS2_FAILURE;
     }
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/wss10_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/wss10_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/wss10_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/wss10_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -24,21 +25,18 @@
 
 /*private functions*/
 
-axis2_status_t AXIS2_CALL
-wss10_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_wss10_t *wss10);
+axis2_status_t AXIS2_CALL wss10_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_wss10_t * wss10);
 
 /***********************************/
 
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL 
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
 rp_wss10_builder_build(
-        const axutil_env_t *env,
-        axiom_node_t *node,
-        axiom_element_t *element)
-
+    const axutil_env_t * env,
+    axiom_node_t * node,
+    axiom_element_t * element)
 {
     rp_wss10_t *wss10 = NULL;
     neethi_policy_t *policy = NULL;
@@ -52,89 +50,96 @@
 
     wss10 = rp_wss10_create(env);
 
-    child_node = axiom_node_get_first_element(node,env);
-    if(!child_node)
+    child_node = axiom_node_get_first_element(node, env);
+    if (!child_node)
     {
         return NULL;
-    }    
-    
-    if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+    }
+
+    if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
     {
-        child_element = (axiom_element_t*)axiom_node_get_data_element(child_node, env);
-        if(child_element)
+        child_element =
+            (axiom_element_t *) axiom_node_get_data_element(child_node, env);
+        if (child_element)
         {
             policy = neethi_engine_get_policy(env, child_node, child_element);
-            if(!policy)
+            if (!policy)
             {
                 return NULL;
             }
-            normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+            normalized_policy =
+                neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
             neethi_policy_free(policy, env);
             policy = NULL;
-            alternatives = neethi_policy_get_alternatives(normalized_policy, env);
-            component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);            
-            all = (neethi_all_t *)neethi_operator_get_value(component ,env);
+            alternatives =
+                neethi_policy_get_alternatives(normalized_policy, env);
+            component =
+                (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+                                                            0);
+            all = (neethi_all_t *) neethi_operator_get_value(component, env);
             wss10_process_alternatives(env, all, wss10);
 
-            assertion = neethi_assertion_create_with_args(
-                    env, (void *)rp_wss10_free, wss10, ASSERTION_TYPE_WSS10);
+            assertion =
+                neethi_assertion_create_with_args(env, (void *) rp_wss10_free,
+                                                  wss10, ASSERTION_TYPE_WSS10);
 
             neethi_policy_free(normalized_policy, env);
             normalized_policy = NULL;
 
             return assertion;
         }
-        else return NULL;
+        else
+            return NULL;
     }
-    else return NULL;
+    else
+        return NULL;
 }
 
 axis2_status_t AXIS2_CALL
 wss10_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_wss10_t *wss10)
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_wss10_t * wss10)
 {
     neethi_operator_t *operator = NULL;
     axutil_array_list_t *arraylist = NULL;
     neethi_assertion_t *assertion = NULL;
-    neethi_assertion_type_t type;    
+    neethi_assertion_type_t type;
     void *value = NULL;
 
     int i = 0;
 
     arraylist = neethi_all_get_policy_components(all, env);
 
-    for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+    for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
     {
-        operator = (neethi_operator_t *)axutil_array_list_get(
-                arraylist, env, i);
-        assertion = (neethi_assertion_t *)neethi_operator_get_value(
-                operator, env);
+        operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+                                                              i);
+        assertion =
+            (neethi_assertion_t *) neethi_operator_get_value(operator, env);
         value = neethi_assertion_get_value(assertion, env);
         type = neethi_assertion_get_type(assertion, env);
 
-        if(type == ASSERTION_TYPE_MUST_SUPPORT_REF_KEY_IDENTIFIER)
+        if (type == ASSERTION_TYPE_MUST_SUPPORT_REF_KEY_IDENTIFIER)
         {
-            rp_wss10_set_must_support_ref_key_identifier(
-                    wss10, env, AXIS2_TRUE);
+            rp_wss10_set_must_support_ref_key_identifier(wss10, env,
+                                                         AXIS2_TRUE);
         }
-        else if(type == ASSERTION_TYPE_MUST_SUPPORT_REF_ISSUER_SERIAL)
+        else if (type == ASSERTION_TYPE_MUST_SUPPORT_REF_ISSUER_SERIAL)
         {
-            rp_wss10_set_must_support_ref_issuer_serial(
-                    wss10, env, AXIS2_TRUE);
+            rp_wss10_set_must_support_ref_issuer_serial(wss10, env, AXIS2_TRUE);
         }
-        else if(type == ASSERTION_TYPE_MUST_SUPPORT_REF_EXTERNAL_URI)
+        else if (type == ASSERTION_TYPE_MUST_SUPPORT_REF_EXTERNAL_URI)
         {
-            rp_wss10_set_must_support_ref_external_uri(
-                    wss10, env, AXIS2_TRUE);
+            rp_wss10_set_must_support_ref_external_uri(wss10, env, AXIS2_TRUE);
         }
-        else if(type == ASSERTION_TYPE_MUST_SUPPORT_REF_EMBEDDED_TOKEN)
+        else if (type == ASSERTION_TYPE_MUST_SUPPORT_REF_EMBEDDED_TOKEN)
         {
-            rp_wss10_set_must_support_ref_embedded_token(
-                    wss10, env, AXIS2_TRUE);
-        }                
-        else return AXIS2_FAILURE;
+            rp_wss10_set_must_support_ref_embedded_token(wss10, env,
+                                                         AXIS2_TRUE);
+        }
+        else
+            return AXIS2_FAILURE;
     }
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/x509_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/x509_token_builder.c?rev=580289&r1=580288&r2=580289&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/x509_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/x509_token_builder.c Fri Sep 28 03:29:16 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -24,21 +25,18 @@
 
 /*private functions*/
 
-axis2_status_t AXIS2_CALL
-x509_token_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_x509_token_t *x509_token);
+axis2_status_t AXIS2_CALL x509_token_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_x509_token_t * x509_token);
 
 /***********************************/
 
-
-AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL 
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
 rp_x509_token_builder_build(
-        const axutil_env_t *env,
-        axiom_node_t *node,
-        axiom_element_t *element)
-
+    const axutil_env_t * env,
+    axiom_node_t * node,
+    axiom_element_t * element)
 {
     rp_x509_token_t *x509_token = NULL;
     neethi_policy_t *policy = NULL;
@@ -51,7 +49,7 @@
     axutil_qname_t *qname = NULL;
     neethi_assertion_t *assertion = NULL;
     neethi_policy_t *normalized_policy = NULL;
-    /*axutil_array_list_t *temp = NULL;*/
+    /*axutil_array_list_t *temp = NULL; */
 
     x509_token = rp_x509_token_create(env);
     qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS, RP_SP_PREFIX);
@@ -62,96 +60,109 @@
     qname = NULL;
 
     rp_x509_token_set_inclusion(x509_token, env, inclusion_value);
-    
+
     child_node = axiom_node_get_first_element(node, env);
-    if(!child_node)
+    if (!child_node)
     {
         return NULL;
-    }    
+    }
 
-    if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+    if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
     {
-        child_element = (axiom_element_t*)axiom_node_get_data_element(child_node, env);
-        if(child_element)
+        child_element =
+            (axiom_element_t *) axiom_node_get_data_element(child_node, env);
+        if (child_element)
         {
             policy = neethi_engine_get_policy(env, child_node, child_element);
-            if(!policy)
+            if (!policy)
             {
                 return NULL;
             }
-            normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+            normalized_policy =
+                neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
             neethi_policy_free(policy, env);
             policy = NULL;
-            alternatives = neethi_policy_get_alternatives(normalized_policy, env);
-            component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);            
-            all = (neethi_all_t *)neethi_operator_get_value(component ,env);
+            alternatives =
+                neethi_policy_get_alternatives(normalized_policy, env);
+            component =
+                (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+                                                            0);
+            all = (neethi_all_t *) neethi_operator_get_value(component, env);
             x509_token_process_alternatives(env, all, x509_token);
-            
-            assertion = neethi_assertion_create_with_args(
-                    env, (void *)rp_x509_token_free, x509_token, ASSERTION_TYPE_X509_TOKEN);
+
+            assertion =
+                neethi_assertion_create_with_args(env,
+                                                  (void *) rp_x509_token_free,
+                                                  x509_token,
+                                                  ASSERTION_TYPE_X509_TOKEN);
 
             neethi_policy_free(normalized_policy, env);
             normalized_policy = NULL;
 
             return assertion;
         }
-        else return NULL;
+        else
+            return NULL;
     }
-    else return NULL;
+    else
+        return NULL;
 }
 
 axis2_status_t AXIS2_CALL
 x509_token_process_alternatives(
-        const axutil_env_t *env,
-        neethi_all_t *all,
-        rp_x509_token_t *x509_token)
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_x509_token_t * x509_token)
 {
     neethi_operator_t *operator = NULL;
     axutil_array_list_t *arraylist = NULL;
     neethi_assertion_t *assertion = NULL;
-    neethi_assertion_type_t type;    
+    neethi_assertion_type_t type;
 
     int i = 0;
 
     arraylist = neethi_all_get_policy_components(all, env);
 
-    for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+    for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
     {
-        operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
-        assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
+        operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+                                                              i);
+        assertion =
+            (neethi_assertion_t *) neethi_operator_get_value(operator, env);
         type = neethi_assertion_get_type(assertion, env);
 
-        if(type == ASSERTION_TYPE_REQUIRE_KEY_IDENTIFIRE_REFERENCE)
+        if (type == ASSERTION_TYPE_REQUIRE_KEY_IDENTIFIRE_REFERENCE)
         {
-            rp_x509_token_set_require_key_identifier_reference(
-                    x509_token, env, AXIS2_TRUE);
+            rp_x509_token_set_require_key_identifier_reference(x509_token, env,
+                                                               AXIS2_TRUE);
         }
-        else if(type == ASSERTION_TYPE_REQUIRE_ISSUER_SERIAL_REFERENCE)
+        else if (type == ASSERTION_TYPE_REQUIRE_ISSUER_SERIAL_REFERENCE)
         {
-            rp_x509_token_set_require_issuer_serial_reference(
-                    x509_token, env, AXIS2_TRUE);
+            rp_x509_token_set_require_issuer_serial_reference(x509_token, env,
+                                                              AXIS2_TRUE);
         }
-        if(type == ASSERTION_TYPE_REQUIRE_EMBEDDED_TOKEN_REFERENCE)
+        if (type == ASSERTION_TYPE_REQUIRE_EMBEDDED_TOKEN_REFERENCE)
         {
-            rp_x509_token_set_require_embedded_token_reference(
-                    x509_token, env, AXIS2_TRUE);
+            rp_x509_token_set_require_embedded_token_reference(x509_token, env,
+                                                               AXIS2_TRUE);
         }
-        else if(type == ASSERTION_TYPE_REQUIRE_THUMBPRINT_REFERENCE)
+        else if (type == ASSERTION_TYPE_REQUIRE_THUMBPRINT_REFERENCE)
         {
-            rp_x509_token_set_require_thumb_print_reference(
-                    x509_token, env, AXIS2_TRUE);
-        }            
-        else if(type == ASSERTION_TYPE_WSS_X509_V1_TOKEN_10)
+            rp_x509_token_set_require_thumb_print_reference(x509_token, env,
+                                                            AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_WSS_X509_V1_TOKEN_10)
         {
-            rp_x509_token_set_token_version_and_type(
-                    x509_token, env, RP_WSS_X509_V1_TOKEN_10);
+            rp_x509_token_set_token_version_and_type(x509_token, env,
+                                                     RP_WSS_X509_V1_TOKEN_10);
         }
-        else if(type == ASSERTION_TYPE_WSS_X509_V3_TOKEN_10)
+        else if (type == ASSERTION_TYPE_WSS_X509_V3_TOKEN_10)
         {
-            rp_x509_token_set_token_version_and_type(
-                    x509_token, env, RP_WSS_X509_V3_TOKEN_10);
+            rp_x509_token_set_token_version_and_type(x509_token, env,
+                                                     RP_WSS_X509_V3_TOKEN_10);
         }
-        else return AXIS2_FAILURE;
+        else
+            return AXIS2_FAILURE;
     }
     return AXIS2_SUCCESS;
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message