You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by ka...@apache.org on 2007/08/01 11:45:32 UTC

svn commit: r561744 - in /webservices/rampart/trunk/c: include/ samples/ samples/client/sec_echo/ samples/client/sec_echo/data/ samples/secpolicy/scenario4/ samples/secpolicy/scenario5/ samples/server/sec_echo/ src/data/ src/omxmlsec/ src/omxmlsec/open...

Author: kaushalye
Date: Wed Aug  1 02:45:30 2007
New Revision: 561744

URL: http://svn.apache.org/viewvc?view=rev&rev=561744
Log:
Adding Rampart out handler to a specific security phase.
Changed the build system in samples to support this.
Changed samples to use more assertions like EncryptSignature and EncryptBeforeSigning
Changed the way of finding attributes based on localname + namespace
Add an axis2.xml for server as well (Need to use a Security Phase)

Added:
    webservices/rampart/trunk/c/samples/server/sec_echo/server_axis2.xml
Modified:
    webservices/rampart/trunk/c/include/oxs_axiom.h
    webservices/rampart/trunk/c/samples/build.sh
    webservices/rampart/trunk/c/samples/client/sec_echo/data/client.axis2.xml
    webservices/rampart/trunk/c/samples/client/sec_echo/echo.c
    webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-policy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario4/services.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario5/client-policy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario5/services.xml
    webservices/rampart/trunk/c/src/data/module.xml
    webservices/rampart/trunk/c/src/omxmlsec/axiom.c
    webservices/rampart/trunk/c/src/omxmlsec/openssl/pkey.c
    webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c
    webservices/rampart/trunk/c/src/omxmlsec/tokens/token_encrypted_data.c
    webservices/rampart/trunk/c/src/util/rampart_context.c
    webservices/rampart/trunk/c/src/util/rampart_signature.c

Modified: webservices/rampart/trunk/c/include/oxs_axiom.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/oxs_axiom.h?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/include/oxs_axiom.h (original)
+++ webservices/rampart/trunk/c/include/oxs_axiom.h Wed Aug  1 02:45:30 2007
@@ -37,6 +37,16 @@
 {
 #endif
 
+    /**
+     * Adds an attribute to a particular node
+     * @param env Environment. MUST NOT be NULL
+     * @param node the node where the attibute will be added
+     * @param attribute_ns the the ns_prefix of the attribute
+     * @param attribute_ns_uri the uri of the attribute
+     * @param attribute the localname  of the attribute
+     * @param value the value of the attribute
+     * @return  AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
     oxs_axiom_add_attribute(const axutil_env_t *env,
                             axiom_node_t* node,
@@ -44,6 +54,15 @@
                             axis2_char_t* attribute_ns_uri,
                             axis2_char_t* attribute,
                             axis2_char_t* value);
+    /**
+     * Adds an attribute to a particular node
+     * @param env Environment. MUST NOT be NULL,
+     * @param parent the root element defining start of the search
+     * @param localname the local part of the qname
+     * @param ns_uri uri part of the qname
+     * @param prefix the prefix part of the qname
+     * @return the number of children found
+     */
 
     AXIS2_EXTERN int AXIS2_CALL
     oxs_axiom_get_number_of_children_with_qname(const axutil_env_t *env,
@@ -54,11 +73,24 @@
 
     /**
      * Traverse thru the node and its children. Check if the localname is equal to the given name
-     * */
+     * @param env Environment. MUST NOT be NULL,
+     * @param node the node to be searched
+     * @param localname the local name of the node to be searched
+     * @return the node if found, else NULL
+     */
+
     AXIS2_EXTERN axiom_node_t* AXIS2_CALL
     oxs_axiom_get_node_by_local_name(const axutil_env_t *env,
                                      axiom_node_t *node,
                                      axis2_char_t *local_name);
+    /**
+     * Traverse thru the node and its children. Check if the node has a particular id as in @attr
+     * @param env Environment. MUST NOT be NULL,
+     * @param node the node to be searched
+     * @param attr the attribute name of the node
+     * @param val the attribute value of the node
+     * @return the node if found, else NULL
+     */
 
     AXIS2_EXTERN axiom_node_t* AXIS2_CALL
     oxs_axiom_get_node_by_id(const axutil_env_t *env,
@@ -66,6 +98,14 @@
                              axis2_char_t *attr,
                              axis2_char_t *val);
 
+    /**
+     * Traverse thru the node and its children. Check if the node has a particular id as in @attr
+     * @param env Environment. MUST NOT be NULL,
+     * @param node the node to be searched
+     * @param attr the attribute name of the node
+     * @param val the attribute value of the node
+     * @return the node if found, else NULL
+     */
     AXIS2_EXTERN axis2_char_t* AXIS2_CALL
     oxs_axiom_get_attribute_value_of_node_by_name(const axutil_env_t *env,
             axiom_node_t *node,

Modified: webservices/rampart/trunk/c/samples/build.sh
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/build.sh?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/samples/build.sh (original)
+++ webservices/rampart/trunk/c/samples/build.sh Wed Aug  1 02:45:30 2007
@@ -8,4 +8,6 @@
 cd ../../secpolicy
 sh deploy.sh scenario5
 cd ../
+echo "Copying server's axis2.xml to " $AXIS2C_HOME
+cp server/sec_echo/server_axis2.xml $AXIS2C_HOME/axis2.xml
 echo "samples successfuly build. To run echo client cd to client/sec_echo and run update_n_run.sh"

Modified: webservices/rampart/trunk/c/samples/client/sec_echo/data/client.axis2.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/client/sec_echo/data/client.axis2.xml?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/samples/client/sec_echo/data/client.axis2.xml (original)
+++ webservices/rampart/trunk/c/samples/client/sec_echo/data/client.axis2.xml Wed Aug  1 02:45:30 2007
@@ -1,4 +1,5 @@
 <axisconfig name="Axis2/C">
+    <!--THIS IS A SAMPLE AXIS2.XML (CLIENT'S) TO TRY RAMPART-C SAMPLES-->
     <!-- ================================================= -->
     <!-- Parameters -->
     <!-- ================================================= -->
@@ -115,6 +116,7 @@
         <!--phase name="userphase1"/-->
         <!--system predefined phase-->
         <phase name="MessageOut"/>
+        <phase name="Security"/>
     </phaseOrder>
     <phaseOrder type="INfaultflow">
         <!-- User defined phases could be added here -->
@@ -126,6 +128,7 @@
         <!--phase name="RMPhase"/-->
         <!--phase name="userphase1"/-->
         <phase name="MessageOut"/>
+        <phase name="Security"/>
     </phaseOrder>
 </axisconfig>
 

Modified: webservices/rampart/trunk/c/samples/client/sec_echo/echo.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/client/sec_echo/echo.c?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/samples/client/sec_echo/echo.c (original)
+++ webservices/rampart/trunk/c/samples/client/sec_echo/echo.c Wed Aug  1 02:45:30 2007
@@ -32,21 +32,20 @@
 {
     const axutil_env_t *env = NULL;
     const axis2_char_t *address = NULL;
+    const axis2_char_t *client_home = NULL;
+    axis2_char_t *file_name = NULL;
     axis2_endpoint_ref_t* endpoint_ref = NULL;
     axis2_options_t *options = NULL;
-    const axis2_char_t *client_home = NULL;
     axis2_svc_client_t* svc_client = NULL;
     axiom_node_t *payload = NULL;
     axiom_node_t *ret_node = NULL;
     axis2_status_t status = AXIS2_FAILURE;
     neethi_policy_t *policy = NULL;
-    axis2_char_t *file_name = NULL;
 	
 	/* Set up the environment */
     env = axutil_env_create_all("echo.log", AXIS2_LOG_LEVEL_TRACE);
 
-
-    /* Set end point reference of echo service */
+    /* Set end-point-reference of echo service */
     address = "http://localhost:9090/axis2/services/echo";
     if (argc > 2)
     {
@@ -63,74 +62,45 @@
         return 0;
     }
 
-
-    /* Create EPR with given address */
+    /* Create end-point-reference with given address */
     endpoint_ref = axis2_endpoint_ref_create(env, address);
 
     /* Setup options */
     options = axis2_options_create(env);
     axis2_options_set_to(options, env, endpoint_ref);
-    /*axis2_options_set_action(options, env,
-            "http://ws.apache.org/axis2/c/samples/sec_echo");*/
     axis2_options_set_action(options, env,
             "http://example.com/ws/2004/09/policy/Test/EchoRequest");
 
-
-
-    /*
-     * Set security params. If you need to enable dynamic settings uncomment
-     * following code section.
-     */
-
-
+    /*If the client home is not specified, use the AXIS2C_HOME*/
     if (!client_home)
     {
         client_home = AXIS2_GETENV("AXIS2C_HOME");
         printf("\nNo client_home specified. Using default %s", client_home);
     }
 
-
-    /* Set up deploy folder. It is from the deploy folder, the configuration is picked up
-     * using the axis2.xml file.
-     * In this sample client_home points to the Axis2/C default deploy folder. The client_home can 
-     * be different from this folder on your system. For example, you may have a different folder 
-     * (say, my_client_folder) with its own axis2.xml file. my_client_folder/modules will have the 
-     * modules that the client uses
-     */
-    /*    if (!client_home)
-            client_home = "../../deploy";
-    */
-
     /* Create service client */
     printf("client_home= %s", client_home);
     svc_client = axis2_svc_client_create(env, client_home);
     if (!svc_client)
     {
         printf("Error creating service client\n");
-        /*AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Stub invoke FAILED: Error code:"
-                " %d :: %s", env->error->error_number,
-                axutil_error_get_message(env->error));*/
         return -1;
     }
 
     /* Set service client options */
     axis2_svc_client_set_options(svc_client, env, options);
 
-    /*status = echo_helper_set_policy(svc_client, client_home, env);*/
-
+    /*We need to specify the client's policy file location*/
     if(client_home)
     {
         file_name = axutil_stracat(env, client_home, AXIS2_PATH_SEP_STR);
         file_name = axutil_stracat(env, file_name, "policy.xml" );
-    }
-    else
-    {
+    }else{
         printf("Client Home not Specified\n");
         printf("echo client invoke FAILED!\n");
         return 0;
     }
-       
-
+    /*Create the policy, from file*/   
     policy = neethi_util_create_policy_from_file(env, file_name);
 
     if(!policy)
@@ -149,21 +119,21 @@
     
     /* Build the SOAP request message payload using OM API.*/
     payload = build_om_payload_for_echo_svc(env);
+    
+    /*If not engaged in the client's axis2.xml, uncomment this line*/
     /*axis2_svc_client_engage_module(svc_client, env, "rampart");*/
+    
     /* Send request */
     ret_node = axis2_svc_client_send_receive(svc_client, env, payload);
 
     if (ret_node){
         axis2_char_t *om_str = NULL;
         om_str = axiom_node_to_string(ret_node, env);
-        if (om_str)
+        if (om_str){
             printf("\nReceived OM : %s\n", om_str);
+        }
         printf("\necho client invoke SUCCESSFUL!\n");
     }else{
-        /*AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Stub invoke FAILED: Error code:"
-                " %d :: %s", env->error->error_number,
-                axutil_error_get_message(env->error));*/
-
         if (axis2_svc_client_get_last_response_has_fault(svc_client, env))
         {
             axiom_soap_envelope_t *soap_envelope = NULL;
@@ -193,12 +163,6 @@
         axis2_svc_client_free(svc_client, env);
         svc_client = NULL;
     }
-    /*    if (endpoint_ref)
-        {
-            axis2_endpoint_ref_free(endpoint_ref, env);
-            endpoint_ref = NULL;
-        }
-    */
     if (env)
     {
         axutil_env_free((axutil_env_t *) env);
@@ -219,8 +183,8 @@
     axiom_namespace_t *ns1 = NULL;
     axis2_char_t *om_str = NULL;
 
-    ns1 = axiom_namespace_create(env, /*"http://ws.apache.org/axis2/c/samples"*/ "http://example.com/ws/2004/09/policy", "ns1");
-    echo_om_ele = axiom_element_create(env, NULL, /*"echoString"*/"echoIn", ns1, &echo_om_node);
+    ns1 = axiom_namespace_create(env, "http://ws.apache.org/rampart/c/samples", "ns1");
+    echo_om_ele = axiom_element_create(env, NULL, "echoIn", ns1, &echo_om_node);
     
     
     text_om_ele = axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);

Modified: webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-policy.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-policy.xml?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-policy.xml (original)
+++ webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-policy.xml Wed Aug  1 02:45:30 2007
@@ -42,6 +42,7 @@
             </sp:Wss10>
             <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                 <sp:Body/>
+                <sp:Header Namespace="http://www.w3.org/2005/08/addressing"/>
             </sp:SignedParts>
             <rampc:RampartConfig xmlns:rampc="http://ws.apache.org/rampart/c/policy">
                 <rampc:User>Alice</rampc:User>

Modified: webservices/rampart/trunk/c/samples/secpolicy/scenario4/services.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/scenario4/services.xml?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/samples/secpolicy/scenario4/services.xml (original)
+++ webservices/rampart/trunk/c/samples/secpolicy/scenario4/services.xml Wed Aug  1 02:45:30 2007
@@ -58,6 +58,7 @@
                 </sp:Wss10>
                 <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                     <sp:Body/>
+                    <sp:Header Namespace="http://www.w3.org/2005/08/addressing"/>
                 </sp:SignedParts>
                 <rampc:RampartConfig xmlns:rampc="http://ws.apache.org/rampart/c/policy">
                     <rampc:User>Bob</rampc:User>

Modified: webservices/rampart/trunk/c/samples/secpolicy/scenario5/client-policy.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/scenario5/client-policy.xml?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/samples/secpolicy/scenario5/client-policy.xml (original)
+++ webservices/rampart/trunk/c/samples/secpolicy/scenario5/client-policy.xml Wed Aug  1 02:45:30 2007
@@ -33,7 +33,7 @@
                     </sp:Layout>
                     <sp:IncludeTimestamp/>
                     <sp:EncryptSignature/>
-                    <!--sp:EncryptBeforeSigning/-->
+                    <sp:EncryptBeforeSigning/>
                 </wsp:Policy>
             </sp:AsymmetricBinding>
             <sp:SignedSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
@@ -53,6 +53,7 @@
             </sp:EncryptedParts>
             <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                 <sp:Body/>
+                <sp:Header Namespace="http://www.w3.org/2005/08/addressing"/>
             </sp:SignedParts>
             <rampc:RampartConfig xmlns:rampc="http://ws.apache.org/rampart/c/policy">
                 <rampc:User>Alice</rampc:User>

Modified: webservices/rampart/trunk/c/samples/secpolicy/scenario5/services.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/scenario5/services.xml?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/samples/secpolicy/scenario5/services.xml (original)
+++ webservices/rampart/trunk/c/samples/secpolicy/scenario5/services.xml Wed Aug  1 02:45:30 2007
@@ -49,7 +49,7 @@
                         </sp:Layout>
                         <sp:IncludeTimestamp/>
                         <sp:EncryptSignature/>
-                        <!--sp:EncryptBeforeSigning/-->
+                        <sp:EncryptBeforeSigning/>
                     </wsp:Policy>
                 </sp:AsymmetricBinding>
                 <sp:SignedSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">

Added: webservices/rampart/trunk/c/samples/server/sec_echo/server_axis2.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/server/sec_echo/server_axis2.xml?view=auto&rev=561744
==============================================================================
--- webservices/rampart/trunk/c/samples/server/sec_echo/server_axis2.xml (added)
+++ webservices/rampart/trunk/c/samples/server/sec_echo/server_axis2.xml Wed Aug  1 02:45:30 2007
@@ -0,0 +1,111 @@
+<axisconfig name="Axis2/C">
+    <!--THIS IS A SAMPLE AXIS2.XML (SERVER) TO TRY RAMPART-C SAMPLES-->
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <!-- Uncomment following to enable MTOM support -->
+    <!--parameter name="enableMTOM" locked="false">true</parameter-->
+    <parameter name="enableREST" locked="false">true</parameter>
+
+    <!-- Uncomment following to persist op_ctx, useful with RM -->
+    <!--parameter name="persistOperationContext" locked="false">true</parameter-->
+
+    <!--if you want to extract the service archive file and work with that please uncomment this-->
+    <!--else , it wont extract archive file or does not take into consideration if someone drop-->
+    <!--exploded directory into /service directory-->
+    <!--<parameter name="extractServiceArchive" locked="false">true</parameter>-->
+
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!-- This is the Deafult Message Receiver for the Request Response style Operations -->
+    <!--messageReceiver mep="INOUT" class="axis2_receivers"/-->
+
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <transportReceiver name="http" class="axis2_http_receiver">
+        <parameter name="port" locked="false">6060</parameter>
+    </transportReceiver>
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <transportSender name="http" class="axis2_http_sender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+        <!--parameter name="Transfer-Encoding">chunked</parameter-->
+        <!--parameter name="PROXY" proxy_host="127.0.0.1" proxy_port="8080" locked="true"/-->
+    </transportSender>
+    <!-- Uncomment this one with the appropriate papameters to enable the XMPP transport Sender-->
+    <!--transportSender name="xmpp" class="axis2_xmpp_sender">
+        <parameter name="PROTOCOL" locked="false">XMPP</parameter>
+    </transportSender-->
+    <!-- Uncomment this one with the appropriate papameters to enable the TCP transport Sender-->
+    <!--transportSender name="tcp" class="axis2_tcp_sender">
+        <parameter name="PROTOCOL" locked="false">TCP</parameter>
+    </transportSender-->
+
+    <!--
+    <transportSender name="https" class="axis2_http_sender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+    </transportSender>
+    <parameter name="SERVER_CERT">/path/to/ca/certificate</parameter>
+    <parameter name="KEY_FILE">/path/to/client/certificate/chain/file</parameter>
+    <parameter name="SSL_PASSPHRASE">passphrase</parameter>
+    -->
+
+
+    <!-- ================================================= -->
+    <!-- Global Modules  -->
+    <!-- ================================================= -->
+    <!-- Comment this to disable Addressing -->
+    <module ref="addressing"/>
+
+
+    <!--Configuring module , providing paramters for modules whether they refer or not-->
+    <!--<moduleConfig name="addressing">-->
+    <!--<parameter name="addressingPara" locked="false">N/A</parameter>-->
+    <!--</moduleConfig>-->
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="inflow">
+        <!-- System pre defined phases       -->
+        <phase name="Transport"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch"/>
+        <phase name="PostDispatch"/>
+        <!-- End system pre defined phases       -->
+        <!-- After PostDispatch phase, module or service author can add any phase as required  -->
+        <!-- User defined phases could be added here -->
+        <!--phase name="userphase1"/-->
+        <!--phase name="RMPhase"/-->
+        <!--phase name="SavanPhase"/-->
+    </phaseOrder>
+    <phaseOrder type="outflow">
+        <!-- User defined phases could be added here -->
+        <!--phase name="RMPhase"/-->
+        <!--phase name="SavanPhase"/-->
+        <!--phase name="userphase1"/-->
+        <!--system predefined phase-->
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+    <phaseOrder type="INfaultflow">
+        <!-- User defined phases could be added here -->
+        <!--phase name="userphase1"/-->
+        <!--phase name="RMPhase"/-->
+        <!--phase name="SavanPhase"/-->
+    </phaseOrder>
+    <phaseOrder type="Outfaultflow">
+        <!-- User defined phases could be added here -->
+        <!--phase name="RMPhase"/-->
+        <!--phase name="SavanPhase"/-->
+        <!--phase name="userphase1"/-->
+        <phase name="MessageOut"/>
+    </phaseOrder>
+</axisconfig>
+

Modified: webservices/rampart/trunk/c/src/data/module.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/data/module.xml?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/src/data/module.xml (original)
+++ webservices/rampart/trunk/c/src/data/module.xml Wed Aug  1 02:45:30 2007
@@ -7,7 +7,7 @@
 
     <outflow>
         <handler name="RampartOutHandler" class="mod_rampart">
-            <order phase="MessageOut"/>
+            <order phase="Security"/>
         </handler>
     </outflow>
 

Modified: webservices/rampart/trunk/c/src/omxmlsec/axiom.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/axiom.c?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/axiom.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/axiom.c Wed Aug  1 02:45:30 2007
@@ -177,24 +177,15 @@
     axutil_qname_t *qname = NULL;
 
     ele = axiom_node_get_data_element(node, env);
-    /*Interop FIX*/
-    /*attribute_value = axiom_element_get_attribute_value_by_name(ele, env, attribute_name);*/
-    qname = axutil_qname_create(env, attribute_name, OXS_WSU_XMLNS, NULL);    
-    /*attribute_value = axiom_element_get_attribute_value(ele ,env, qname);*/
+    qname = axutil_qname_create(env, attribute_name, OXS_WSU_XMLNS, NULL);
     attribute_value = oxs_axiom_get_attribute_val_of_node_by_qname(env, node, qname);
-    /*if(!attribute_value){
-        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
-                  "Cannot find %s attribute", attribute_name);
-        return NULL;
-        
-    }*/
     return attribute_value;
 }
 
 AXIS2_EXTERN axis2_char_t* AXIS2_CALL
 oxs_axiom_get_attribute_val_of_node_by_qname(const axutil_env_t *env,
-    axiom_node_t *node,
-    axutil_qname_t *qname)
+        axiom_node_t *node,
+        axutil_qname_t *qname)
 {
     /*Qname might NOT contain the prefix*/
     axiom_element_t *ele = NULL;
@@ -210,7 +201,7 @@
         return NULL;
     }
     /*Get localname of the qname*/
-    local_name =  axutil_qname_get_localpart(qname, env); 
+    local_name =  axutil_qname_get_localpart(qname, env);
     /*Get nsuri of the qname*/
     ns_uri = axutil_qname_get_uri(qname, env);
     if(!ns_uri){
@@ -227,23 +218,23 @@
             axis2_char_t *this_attr_name = NULL;
             axis2_char_t *this_attr_ns_uri = NULL;
             axiom_namespace_t *attr_ns = NULL;
- 
+
             om_attr = (axiom_attribute_t*)attr;
             this_attr_name = axiom_attribute_get_localname(om_attr, env);
             attr_ns = axiom_attribute_get_namespace(om_attr, env);
             if(attr_ns){
-                this_attr_ns_uri = axiom_namespace_get_uri(attr_ns, env);  
+                this_attr_ns_uri = axiom_namespace_get_uri(attr_ns, env);
             }else{
                 this_attr_ns_uri = "";
             }
             if(0 == axutil_strcmp(local_name, this_attr_name) && 0 == axutil_strcmp(ns_uri, this_attr_ns_uri)){
                 /*Got it !!!*/
                 return axiom_attribute_get_value(om_attr, env);
-            } 
+            }
         }
-        
+
     }
-    
+
     return NULL;
 }
 
@@ -349,7 +340,7 @@
     }
     axiom_xml_reader_free(reader, env);
     reader = NULL;
-    
+
     return node;
 }
 

Modified: webservices/rampart/trunk/c/src/omxmlsec/openssl/pkey.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/openssl/pkey.c?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/openssl/pkey.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/openssl/pkey.c Wed Aug  1 02:45:30 2007
@@ -80,10 +80,9 @@
 )
 {
     AXIS2_ENV_CHECK(env, NULL);
-
     return pkey->name ;
-
 }
+
 int AXIS2_CALL
 openssl_pkey_get_size(
     const openssl_pkey_t *pkey,
@@ -91,9 +90,9 @@
 )
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
     return sizeof(pkey->key) ;
 }
+
 int AXIS2_CALL
 openssl_pkey_get_type(
     const openssl_pkey_t *pkey,
@@ -101,7 +100,6 @@
 )
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
     return pkey->type ;
 }
 

Modified: webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c Wed Aug  1 02:45:30 2007
@@ -54,38 +54,22 @@
     }
     else
     {
-        oxs_error(env, ERROR_LOCATION, OXS_ERROR_DECRYPT_FAILED,
-                  "New line removed buffer creation failed.");
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_DECRYPT_FAILED, "New line removed buffer creation failed.");
         return AXIS2_FAILURE;
     }
-    /*First we need to base64 decode*/
-    /*  EVP_ENCODE_CTX ctx;*/
-    /*  int len = 0;*/
-    /*  int ret = 0;*/
 
     decode_len = axutil_base64_decode_len(formatted_buf );
     buff = AXIS2_MALLOC(env->allocator, decode_len);
-
     ilen = axutil_strlen(formatted_buf);
-
     decoded_len = axutil_base64_decode_binary(buff,formatted_buf);
     if (decoded_len < 0)
     {
-        oxs_error(env, ERROR_LOCATION, OXS_ERROR_DECRYPT_FAILED,
-                  "axutil_base64_decode_binary failed");
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_DECRYPT_FAILED, "axutil_base64_decode_binary failed");
         return AXIS2_FAILURE;
     }
 
-    /*  EVP_DecodeInit(&ctx);
-        EVP_DecodeUpdate(&ctx, (unsigned char*)buff, &len,
-                       (unsigned char*)b64_encoded_buf, ilen);
-        EVP_DecodeFinal(&ctx, (unsigned char*)buff, &ret);
-        ret += len;
-    */
     if ((mem = BIO_new_mem_buf(buff, ilen)) == NULL)
     {
-        /*oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
-                "BIO memeory allocation failure");*/
         return AXIS2_FAILURE;
     }
 
@@ -97,13 +81,10 @@
     buff = NULL;
 
     if (*cert == NULL){
-        /*oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
-                "Certificate is NULL");*/
         return AXIS2_FAILURE;
     }
 
     return AXIS2_SUCCESS;
-
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL

Modified: webservices/rampart/trunk/c/src/omxmlsec/tokens/token_encrypted_data.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/tokens/token_encrypted_data.c?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/tokens/token_encrypted_data.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/tokens/token_encrypted_data.c Wed Aug  1 02:45:30 2007
@@ -21,7 +21,7 @@
 #include <oxs_token_encrypted_data.h>
 #include <axiom_attribute.h>
 #include <axiom_element.h>
-
+#include <oxs_utility.h>
 
 
 AXIS2_EXTERN axiom_node_t* AXIS2_CALL
@@ -65,7 +65,9 @@
     else
     {
         /*TODO Get a unique value for this*/
-        id_attr = axiom_attribute_create(env, OXS_ATTR_ID, "EncDataId-54321", wsu_ns_obj);
+        axis2_char_t *id = NULL;
+        id = oxs_util_generate_id(env, (axis2_char_t*)OXS_ENCDATA_ID);
+        id_attr = axiom_attribute_create(env, OXS_ATTR_ID, id, wsu_ns_obj);
         ret = axiom_element_add_attribute(encrypted_data_ele, env, id_attr, encrypted_data_node);
     }
 

Modified: webservices/rampart/trunk/c/src/util/rampart_context.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_context.c?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_context.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_context.c Wed Aug  1 02:45:30 2007
@@ -973,8 +973,7 @@
         axutil_array_list_t *soap_header_blocks = NULL;
         int i = 0;
         soap_header_blocks = axiom_soap_header_get_header_blocks_with_namespace_uri(soap_header,env,namespace);
-        if(!soap_header_blocks)
-        {
+        if(!soap_header_blocks){
             AXIS2_LOG_INFO(env->log, "[rampart][rampart_context] Header cannot find with namespace %s",namespace);
             return AXIS2_SUCCESS;
         }

Modified: webservices/rampart/trunk/c/src/util/rampart_signature.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_signature.c?view=diff&rev=561744&r1=561743&r2=561744
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_signature.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_signature.c Wed Aug  1 02:45:30 2007
@@ -277,7 +277,7 @@
             axutil_array_list_add(tr_list, env, tr);
             oxs_sign_part_set_transforms(sign_part, env, tr_list);
             /*oxs_axiom_add_attribute(env, node_to_sign, OXS_WSU, RAMPART_WSU_XMLNS,OXS_ATTR_ID,id);*/
-            oxs_axiom_add_attribute(env, node_to_sign, "u", RAMPART_WSU_XMLNS,OXS_ATTR_ID, id);
+            oxs_axiom_add_attribute(env, node_to_sign, RAMPART_WSU, RAMPART_WSU_XMLNS,OXS_ATTR_ID, id);
             oxs_sign_part_set_node(sign_part, env, node_to_sign);
             oxs_sign_part_set_digest_mtd(sign_part, env, digest_method);
             axutil_array_list_add(sign_parts, env, sign_part);