Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 13818 invoked from network); 28 Sep 2007 10:32:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Sep 2007 10:32:23 -0000 Received: (qmail 93072 invoked by uid 500); 28 Sep 2007 10:32:10 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 92813 invoked by uid 500); 28 Sep 2007 10:32:09 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 92790 invoked by uid 500); 28 Sep 2007 10:32:09 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 92785 invoked by uid 99); 28 Sep 2007 10:32:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Sep 2007 03:32:09 -0700 X-ASF-Spam-Status: No, hits=-98.8 required=10.0 tests=ALL_TRUSTED,DNS_FROM_DOB,RCVD_IN_DOB X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Sep 2007 10:32:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B21EC1A985C; Fri, 28 Sep 2007 03:31:34 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: axis2-cvs@ws.apache.org From: samisa@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070928103134.B21EC1A985C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 #include #include @@ -24,176 +24,182 @@ #include #include -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