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 ma...@apache.org on 2007/05/28 09:21:13 UTC

svn commit: r542133 - in /webservices/rampart/trunk/c: ./ include/ samples/ samples/callback/ samples/client/sec_echo/ samples/keys/ahome/ samples/keys/bhome/ samples/secpolicy/ samples/secpolicy/scenario1/ samples/secpolicy/scenario2/ samples/secpolic...

Author: manjula
Date: Mon May 28 00:21:08 2007
New Revision: 542133

URL: http://svn.apache.org/viewvc?view=rev&rev=542133
Log:
Merging rampart with neethi supported rampart in scratch.

Added:
    webservices/rampart/trunk/c/include/rampart_neethi.h
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/include/rampart_neethi.h
    webservices/rampart/trunk/c/samples/client/sec_echo/echo_helper.c
      - copied, changed from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/echo_helper.c
    webservices/rampart/trunk/c/samples/client/sec_echo/echo_helper.h
      - copied, changed from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/echo_helper.h
    webservices/rampart/trunk/c/samples/keys/ahome/alice_cert.cert
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/keys/ahome/alice_cert.cert
    webservices/rampart/trunk/c/samples/keys/ahome/alice_key.pem
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/keys/ahome/alice_key.pem
    webservices/rampart/trunk/c/samples/keys/ahome/bob_cert.cert
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/keys/ahome/bob_cert.cert
    webservices/rampart/trunk/c/samples/keys/ahome/bob_key.pem
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/keys/ahome/bob_key.pem
    webservices/rampart/trunk/c/samples/keys/bhome/alice_cert.cert
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/keys/bhome/alice_cert.cert
    webservices/rampart/trunk/c/samples/keys/bhome/alice_key.pem
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/keys/bhome/alice_key.pem
    webservices/rampart/trunk/c/samples/keys/bhome/bob_cert.cert
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/keys/bhome/bob_cert.cert
    webservices/rampart/trunk/c/samples/keys/bhome/bob_key.pem
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/keys/bhome/bob_key.pem
    webservices/rampart/trunk/c/samples/secpolicy/scenario1/client-policy.xml
      - copied unchanged from r542107, webservices/axis2/scratch/c/neethi/rampart/samples/secpolicy/scenario1/client-policy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario1/services.xml
      - copied unchanged from r542107, webservices/axis2/scratch/c/neethi/rampart/samples/secpolicy/scenario1/services.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario2/client-policy.xml
      - copied unchanged from r542107, webservices/axis2/scratch/c/neethi/rampart/samples/secpolicy/scenario2/client-policy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario2/services.xml
      - copied unchanged from r542107, webservices/axis2/scratch/c/neethi/rampart/samples/secpolicy/scenario2/services.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario3/client-policy.xml
      - copied unchanged from r542107, webservices/axis2/scratch/c/neethi/rampart/samples/secpolicy/scenario3/client-policy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario3/services.xml
      - copied unchanged from r542107, webservices/axis2/scratch/c/neethi/rampart/samples/secpolicy/scenario3/services.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-policy.xml
      - copied unchanged from r542107, webservices/axis2/scratch/c/neethi/rampart/samples/secpolicy/scenario4/client-policy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario4/services.xml
      - copied unchanged from r542107, webservices/axis2/scratch/c/neethi/rampart/samples/secpolicy/scenario4/services.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario5/client-policy.xml
      - copied unchanged from r542107, webservices/axis2/scratch/c/neethi/rampart/samples/secpolicy/scenario5/client-policy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario5/services.xml
      - copied unchanged from r542107, webservices/axis2/scratch/c/neethi/rampart/samples/secpolicy/scenario5/services.xml
    webservices/rampart/trunk/c/service_xml/
      - copied from r540031, webservices/axis2/scratch/c/neethi/rampart/service_xml/
    webservices/rampart/trunk/c/service_xml/asym_services.xml
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/service_xml/asym_services.xml
    webservices/rampart/trunk/c/service_xml/message-services-sc.xml
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/service_xml/message-services-sc.xml
    webservices/rampart/trunk/c/service_xml/trans_services.xml
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/service_xml/trans_services.xml
    webservices/rampart/trunk/c/src/util/rampart_neethi.c
      - copied unchanged from r540031, webservices/axis2/scratch/c/neethi/rampart/src/util/rampart_neethi.c
Removed:
    webservices/rampart/trunk/c/include/rp_algorithmsuite.h
    webservices/rampart/trunk/c/include/rp_algorithmsuite_builder.h
    webservices/rampart/trunk/c/include/rp_asymmetric_binding.h
    webservices/rampart/trunk/c/include/rp_asymmetric_binding_builder.h
    webservices/rampart/trunk/c/include/rp_binding_commons.h
    webservices/rampart/trunk/c/include/rp_binding_commons_builder.h
    webservices/rampart/trunk/c/include/rp_defines.h
    webservices/rampart/trunk/c/include/rp_element.h
    webservices/rampart/trunk/c/include/rp_header.h
    webservices/rampart/trunk/c/include/rp_https_token.h
    webservices/rampart/trunk/c/include/rp_https_token_builder.h
    webservices/rampart/trunk/c/include/rp_includes.h
    webservices/rampart/trunk/c/include/rp_layout.h
    webservices/rampart/trunk/c/include/rp_layout_builder.h
    webservices/rampart/trunk/c/include/rp_policy_creator.h
    webservices/rampart/trunk/c/include/rp_property.h
    webservices/rampart/trunk/c/include/rp_qname_matcher.h
    webservices/rampart/trunk/c/include/rp_rampart_config.h
    webservices/rampart/trunk/c/include/rp_rampart_config_builder.h
    webservices/rampart/trunk/c/include/rp_secpolicy.h
    webservices/rampart/trunk/c/include/rp_secpolicy_builder.h
    webservices/rampart/trunk/c/include/rp_security_context_token.h
    webservices/rampart/trunk/c/include/rp_security_context_token_builder.h
    webservices/rampart/trunk/c/include/rp_signed_encrypted_elements.h
    webservices/rampart/trunk/c/include/rp_signed_encrypted_elements_builder.h
    webservices/rampart/trunk/c/include/rp_signed_encrypted_items.h
    webservices/rampart/trunk/c/include/rp_signed_encrypted_items_builder.h
    webservices/rampart/trunk/c/include/rp_signed_encrypted_parts.h
    webservices/rampart/trunk/c/include/rp_signed_encrypted_parts_builder.h
    webservices/rampart/trunk/c/include/rp_supporting_tokens.h
    webservices/rampart/trunk/c/include/rp_supporting_tokens_builder.h
    webservices/rampart/trunk/c/include/rp_symmetric_asymmetric_binding_commons.h
    webservices/rampart/trunk/c/include/rp_symmetric_asymmetric_commons_builder.h
    webservices/rampart/trunk/c/include/rp_symmetric_binding.h
    webservices/rampart/trunk/c/include/rp_symmetric_binding_builder.h
    webservices/rampart/trunk/c/include/rp_token_builder.h
    webservices/rampart/trunk/c/include/rp_transport_binding.h
    webservices/rampart/trunk/c/include/rp_transport_binding_builder.h
    webservices/rampart/trunk/c/include/rp_username_token.h
    webservices/rampart/trunk/c/include/rp_username_token_builder.h
    webservices/rampart/trunk/c/include/rp_wss10.h
    webservices/rampart/trunk/c/include/rp_wss10_builder.h
    webservices/rampart/trunk/c/include/rp_wss11.h
    webservices/rampart/trunk/c/include/rp_wss11_builder.h
    webservices/rampart/trunk/c/include/rp_x509_token.h
    webservices/rampart/trunk/c/include/rp_x509_token_builder.h
    webservices/rampart/trunk/c/samples/secpolicy/scenario1/client-incoming-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario1/client-outgoing-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario1/service-incoming-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario1/service-outgoing-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario2/client-incoming-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario2/client-outgoing-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario2/service-incoming-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario2/service-outgoing-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario3/client-incoming-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario3/client-outgoing-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario3/service-incoming-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario3/service-outgoing-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-incoming-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario4/client-outgoing-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario4/service-incoming-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario4/service-outgoing-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario5/client-incoming-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario5/client-outgoing-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario5/service-incoming-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario5/service-outgoing-secpolicy.xml
    webservices/rampart/trunk/c/samples/secpolicy/scenario6/
    webservices/rampart/trunk/c/samples/secpolicy/scenario7/
    webservices/rampart/trunk/c/samples/secpolicy/scenario8/
    webservices/rampart/trunk/c/samples/secpolicy/scenario9/
    webservices/rampart/trunk/c/src/secpolicy/
Modified:
    webservices/rampart/trunk/c/   (props changed)
    webservices/rampart/trunk/c/configure.ac
    webservices/rampart/trunk/c/include/rampart_constants.h
    webservices/rampart/trunk/c/include/rampart_context.h
    webservices/rampart/trunk/c/samples/build.sh
    webservices/rampart/trunk/c/samples/callback/pwcb.c
    webservices/rampart/trunk/c/samples/client/sec_echo/Makefile.am
    webservices/rampart/trunk/c/samples/client/sec_echo/deploy_client_repo.sh
    webservices/rampart/trunk/c/samples/client/sec_echo/echo.c
    webservices/rampart/trunk/c/samples/client/sec_echo/update_n_run.sh
    webservices/rampart/trunk/c/samples/keys/ahome/Makefile.am
    webservices/rampart/trunk/c/samples/keys/bhome/Makefile.am
    webservices/rampart/trunk/c/samples/secpolicy/deploy.sh
    webservices/rampart/trunk/c/samples/secpolicy/run_all.sh
    webservices/rampart/trunk/c/samples/server/sec_echo/echo.c
    webservices/rampart/trunk/c/samples/server/sec_echo/services.xml
    webservices/rampart/trunk/c/src/Makefile.am
    webservices/rampart/trunk/c/src/core/Makefile.am
    webservices/rampart/trunk/c/src/handlers/Makefile.am
    webservices/rampart/trunk/c/src/handlers/rampart_in_handler.c
    webservices/rampart/trunk/c/src/handlers/rampart_out_handler.c
    webservices/rampart/trunk/c/src/omxmlsec/encryption.c
    webservices/rampart/trunk/c/src/omxmlsec/xml_encryption.c
    webservices/rampart/trunk/c/src/util/Makefile.am
    webservices/rampart/trunk/c/src/util/rampart_context.c
    webservices/rampart/trunk/c/src/util/rampart_encryption.c
    webservices/rampart/trunk/c/src/util/rampart_engine.c
    webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c
    webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c
    webservices/rampart/trunk/c/src/util/rampart_signature.c

Propchange: webservices/rampart/trunk/c/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon May 28 00:21:08 2007
@@ -1 +1 @@
-/webservices/axis2/scratch/c/neethi/rampart:1-529950
+/webservices/axis2/scratch/c/neethi/rampart:1-542122

Modified: webservices/rampart/trunk/c/configure.ac
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/configure.ac?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/configure.ac (original)
+++ webservices/rampart/trunk/c/configure.ac Mon May 28 00:21:08 2007
@@ -102,9 +102,6 @@
     src/omxmlsec/tokens/Makefile \
     src/omxmlsec/openssl/Makefile \
     src/omxmlsec/c14n/Makefile \
-    src/secpolicy/Makefile
-    src/secpolicy/model/Makefile
-    src/secpolicy/builder/Makefile
     src/data/Makefile \
     src/handlers/Makefile \
     src/core/Makefile \

Modified: webservices/rampart/trunk/c/include/rampart_constants.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_constants.h?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_constants.h (original)
+++ webservices/rampart/trunk/c/include/rampart_constants.h Mon May 28 00:21:08 2007
@@ -64,6 +64,8 @@
 #define INFLOW_RAMPART_CONTEXT                      "InflowRampartContext"
 #define OUTFLOW_RAMPART_CONTEXT                     "OutflowRampartContext"
 
+#define RAMPART_CONTEXT                             "RampartContext"
+
 #define IN_MESSAGE_SECURITY                          "InMessageSecurity"
 #define OUT_MESSAGE_SECURITY                         "OutMessageSEcurity"
 #define RAMPART_PASSWORD_TEXT                       "plainText"

Modified: webservices/rampart/trunk/c/include/rampart_context.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_context.h?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_context.h (original)
+++ webservices/rampart/trunk/c/include/rampart_context.h Mon May 28 00:21:08 2007
@@ -431,6 +431,7 @@
         rp_property_t *token,
         int token_type,
         axis2_bool_t server_side,
+        axis2_bool_t is_inpath,
         const axutil_env_t *env);
     /*
         AXIS2_EXTERN axis2_char_t *AXIS2_CALL

Modified: webservices/rampart/trunk/c/samples/build.sh
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/build.sh?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/build.sh (original)
+++ webservices/rampart/trunk/c/samples/build.sh Mon May 28 00:21:08 2007
@@ -6,6 +6,6 @@
 cd client/sec_echo
 sh deploy_client_repo.sh
 cd ../../secpolicy
-sh deploy.sh scenario7
+sh deploy.sh scenario5
 cd ../
 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/callback/pwcb.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/callback/pwcb.c?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/callback/pwcb.c (original)
+++ webservices/rampart/trunk/c/samples/callback/pwcb.c Mon May 28 00:21:08 2007
@@ -50,6 +50,14 @@
     {
         pw = "bobPW";
     }
+    else if (0 == axutil_strcmp(username, "Bob"))
+    {
+        pw = "boB";
+    }
+    else if (0 == axutil_strcmp(username, "Alice"))
+    {
+        pw = "ecilA";
+    }
     /*These are for sample keystores*/
     else if (0 == axutil_strcmp(username, "a"))
     {

Modified: webservices/rampart/trunk/c/samples/client/sec_echo/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/client/sec_echo/Makefile.am?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/client/sec_echo/Makefile.am (original)
+++ webservices/rampart/trunk/c/samples/client/sec_echo/Makefile.am Mon May 28 00:21:08 2007
@@ -5,12 +5,13 @@
 data_DATA= README.txt update_n_run.sh deploy_client_repo.sh
 #samplesdir=$(prefix)/samples/client/echo
 #samples_DATA=echo.c README.txt Makefile.am Makefile.in
-echo_SOURCES = echo.c
+echo_SOURCES = echo.c echo_helper.c
 
 echo_LDADD   = $(LDFLAGS) \
                     -L$(AXIS2C_HOME)/lib \
 					-laxutil \
                     -laxis2_axiom \
+					-lneethi \
                     -laxis2_engine \
                     -laxis2_parser \
                     -lpthread \
@@ -20,6 +21,7 @@
                     $(LIBXML2_LIBS)
 
 INCLUDES = -I$(AXIS2C_HOME)/include/axis2-1.0 \
+		   -I$(AXIS2C_HOME)/include/neethi-0.1 \
             -I ../../../include \
 			@UTILINC@ \
 			@AXIOMINC@

Modified: webservices/rampart/trunk/c/samples/client/sec_echo/deploy_client_repo.sh
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/client/sec_echo/deploy_client_repo.sh?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/client/sec_echo/deploy_client_repo.sh (original)
+++ webservices/rampart/trunk/c/samples/client/sec_echo/deploy_client_repo.sh Mon May 28 00:21:08 2007
@@ -25,7 +25,4 @@
 echo "Copying latest modules to $CLIENT_REPO"
 cp -r $AXIS2C_HOME/modules $CLIENT_REPO/
 
-sed -i 's,AXIS2C_HOME,'$AXIS2C_HOME',g' $CLIENT_REPO/axis2.xml
-sed -i 's,AXIS2C_HOME,'$AXIS2C_HOME',g' $SERVICE_HOME/services.xml
-
 echo "WARNING: Make sure that you have correct configurations in sec_echo/services.xml and $CLIENT_REPO/axis2.xml file."

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=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/client/sec_echo/echo.c (original)
+++ webservices/rampart/trunk/c/samples/client/sec_echo/echo.c Mon May 28 00:21:08 2007
@@ -21,7 +21,7 @@
 #include <axiom_soap.h>
 #include <axis2_client.h>
 #include <rampart_constants.h>
-
+#include "echo_helper.h"
 
 axiom_node_t *
 build_om_payload_for_echo_svc(const axutil_env_t *env);
@@ -37,6 +37,7 @@
     axis2_svc_client_t* svc_client = NULL;
     axiom_node_t *payload = NULL;
     axiom_node_t *ret_node = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
     /* Set up the environment */
     env = axutil_env_create_all("echo.log", AXIS2_LOG_LEVEL_TRACE);
 
@@ -64,8 +65,10 @@
     /* 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://ws.apache.org/axis2/c/samples/sec_echo");
+            "http://example.com/ws/2004/09/policy/Test/EchoRequest");
 
 
 
@@ -108,6 +111,13 @@
     /* Set service client options */
     axis2_svc_client_set_options(svc_client, env, options);
 
+    status = echo_helper_set_policy(svc_client, client_home, env);
+
+    if(status == AXIS2_FAILURE)
+    {
+        printf("policy setting failed\n");
+        return 0;
+    }
 
     /* Build the SOAP request message payload using OM API.*/
     payload = build_om_payload_for_echo_svc(env);
@@ -159,12 +169,12 @@
     axiom_namespace_t *ns1 = NULL;
     axis2_char_t *om_str = NULL;
 
-    ns1 = axiom_namespace_create(env, "http://ws.apache.org/axis2/c/samples", "ns1");
-    echo_om_ele = axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
+    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"*/"EchoRequest", ns1, &echo_om_node);
     
     
     text_om_ele = axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);
-    axiom_element_set_text(text_om_ele, env, "echo5\n", text_om_node);
+    axiom_element_set_text(text_om_ele, env, "Hello", text_om_node);
 
     om_str = axiom_node_to_string(echo_om_node, env);
     if (om_str){

Copied: webservices/rampart/trunk/c/samples/client/sec_echo/echo_helper.c (from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/echo_helper.c)
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/client/sec_echo/echo_helper.c?view=diff&rev=542133&p1=webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/echo_helper.c&r1=540031&p2=webservices/rampart/trunk/c/samples/client/sec_echo/echo_helper.c&r2=542133
==============================================================================
--- webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/echo_helper.c (original)
+++ webservices/rampart/trunk/c/samples/client/sec_echo/echo_helper.c Mon May 28 00:21:08 2007
@@ -11,6 +11,7 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 echo_helper_set_policy(axis2_svc_client_t* svc_client,
+    const axis2_char_t *client_home,    
     const axutil_env_t *env)
 {
 
@@ -22,8 +23,17 @@
     axis2_svc_t *svc = NULL;
     axis2_desc_t *desc = NULL;
     axis2_policy_include_t *policy_include = NULL;
+    axis2_char_t *file_name = NULL;
 
-    reader = axiom_xml_reader_create_for_file(env, "policy.xml", NULL);
+    if(client_home)
+    {
+        file_name = axutil_stracat(env, client_home, "policy.xml" );
+            
+    }
+    else
+        return AXIS2_FAILURE;
+
+    reader = axiom_xml_reader_create_for_file(env, file_name, NULL);
 
     if (!reader)
     {

Copied: webservices/rampart/trunk/c/samples/client/sec_echo/echo_helper.h (from r540031, webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/echo_helper.h)
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/client/sec_echo/echo_helper.h?view=diff&rev=542133&p1=webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/echo_helper.h&r1=540031&p2=webservices/rampart/trunk/c/samples/client/sec_echo/echo_helper.h&r2=542133
==============================================================================
--- webservices/axis2/scratch/c/neethi/rampart/samples/client/sec_echo/echo_helper.h (original)
+++ webservices/rampart/trunk/c/samples/client/sec_echo/echo_helper.h Mon May 28 00:21:08 2007
@@ -22,6 +22,7 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 echo_helper_set_policy(axis2_svc_client_t* svc_client,
+    const axis2_char_t *client_home,                
     const axutil_env_t *env);
 
 

Modified: webservices/rampart/trunk/c/samples/client/sec_echo/update_n_run.sh
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/client/sec_echo/update_n_run.sh?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/client/sec_echo/update_n_run.sh (original)
+++ webservices/rampart/trunk/c/samples/client/sec_echo/update_n_run.sh Mon May 28 00:21:08 2007
@@ -1,6 +1,6 @@
 #!/bin/bash
 #If your client repository is different, change the value.
-CLIENT_REPO="$AXIS2C_HOME/client_repo"
+CLIENT_REPO="$AXIS2C_HOME/client_repo/"
 
 #INSTALL MODULE to make sure that both server and client have the same module.
 echo "Copying latest module to client_repo"

Modified: webservices/rampart/trunk/c/samples/keys/ahome/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/keys/ahome/Makefile.am?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/keys/ahome/Makefile.am (original)
+++ webservices/rampart/trunk/c/samples/keys/ahome/Makefile.am Mon May 28 00:21:08 2007
@@ -1,2 +1,2 @@
 resdir=$(prefix)/bin/samples/rampart/keys/ahome
-res_DATA= a_key.pem  a_req.pem b_cert.cert a_cert.cert
+res_DATA= a_key.pem  a_req.pem b_cert.cert a_cert.cert alice_key.pem alice_cert.cert bob_cert.cert

Modified: webservices/rampart/trunk/c/samples/keys/bhome/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/keys/bhome/Makefile.am?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/keys/bhome/Makefile.am (original)
+++ webservices/rampart/trunk/c/samples/keys/bhome/Makefile.am Mon May 28 00:21:08 2007
@@ -1,2 +1,2 @@
 resdir=$(prefix)/bin/samples/rampart/keys/bhome
-res_DATA= a_cert.cert  b_key.pem  b_req.pem  b_cert.cert
+res_DATA= a_cert.cert  b_key.pem  b_req.pem  b_cert.cert alice_cert.cert bob_cert.cert bob_key.pem

Modified: webservices/rampart/trunk/c/samples/secpolicy/deploy.sh
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/deploy.sh?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/secpolicy/deploy.sh (original)
+++ webservices/rampart/trunk/c/samples/secpolicy/deploy.sh Mon May 28 00:21:08 2007
@@ -10,22 +10,17 @@
 
 #COPYING THE RELEVENT POLICY FILES TO CLIENT AND SERVER
 
-#copy client policy files to CLIENT_REPO
+#copy client policy file to CLIENT_REPO
 echo "Copying client policy files to $CLIENT_REPO"
-cp $1/client-outgoing-secpolicy.xml $CLIENT_REPO/outgoing-secpolicy.xml
-cp $1/client-incoming-secpolicy.xml $CLIENT_REPO/incoming-secpolicy.xml
+cp $1/client-policy.xml $CLIENT_REPO/policy.xml
 
 echo "replacing username in policy files."
-sed -i 's,AXIS2C_HOME,'$AXIS2C_HOME',g' $CLIENT_REPO/outgoing-secpolicy.xml
-sed -i 's,AXIS2C_HOME,'$AXIS2C_HOME',g' $CLIENT_REPO/incoming-secpolicy.xml
+sed -i 's,AXIS2C_HOME,'$AXIS2C_HOME',g' $CLIENT_REPO/policy.xml
 
+#copy services.xml to SERVICE_HOME
+echo "Copying services.xml to $SERVICE_HOME"
+cp $1/services.xml $SERVICE_HOME/services.xml
 
-#copy service policy files to SERVICE_HOME
-echo "Copying service policy files to $SERVICE_HOME"
-cp $1/service-outgoing-secpolicy.xml $SERVICE_HOME/outgoing-secpolicy.xml
-cp $1/service-incoming-secpolicy.xml $SERVICE_HOME/incoming-secpolicy.xml
-
-echo "replacing username in policy files."
-sed -i 's,AXIS2C_HOME,'$AXIS2C_HOME',g' $SERVICE_HOME/outgoing-secpolicy.xml
-sed -i 's,AXIS2C_HOME,'$AXIS2C_HOME',g' $SERVICE_HOME/incoming-secpolicy.xml
+echo "replacing username in Configuration files."
+sed -i 's,AXIS2C_HOME,'$AXIS2C_HOME',g' $SERVICE_HOME/services.xml
 

Modified: webservices/rampart/trunk/c/samples/secpolicy/run_all.sh
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/secpolicy/run_all.sh?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/secpolicy/run_all.sh (original)
+++ webservices/rampart/trunk/c/samples/secpolicy/run_all.sh Mon May 28 00:21:08 2007
@@ -4,7 +4,7 @@
 _PORT=9090
 _SLEEP=2
 #You may change these to scenarios u need to run
-_LST="1 2 3 4 5 6 7 8"
+_LST="1 2 3 4 5"
 
 if [ $# -eq 1 ]
 then

Modified: webservices/rampart/trunk/c/samples/server/sec_echo/echo.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/server/sec_echo/echo.c?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/server/sec_echo/echo.c (original)
+++ webservices/rampart/trunk/c/samples/server/sec_echo/echo.c Mon May 28 00:21:08 2007
@@ -51,7 +51,7 @@
 
     text_om_ele = axiom_element_create(env, echo_om_node, "LocalName", NULL, &text_om_node);
 
-    axiom_element_set_text(text_om_ele, env, text, text_om_node);
+    axiom_element_set_text(echo_om_ele, env, text, echo_om_node);
 
     return echo_om_node;
 }

Modified: webservices/rampart/trunk/c/samples/server/sec_echo/services.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/server/sec_echo/services.xml?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/samples/server/sec_echo/services.xml (original)
+++ webservices/rampart/trunk/c/samples/server/sec_echo/services.xml Mon May 28 00:21:08 2007
@@ -6,14 +6,80 @@
    </description>
     <!--Rampart configurations START -->
     <module ref="rampart"/>
-    <parameter name="OutflowSecurityPolicy">AXIS2C_HOME/services/sec_echo/outgoing-secpolicy.xml</parameter>
-    <parameter name="InflowSecurityPolicy">AXIS2C_HOME/services/sec_echo/incoming-secpolicy.xml</parameter>
-    
+
     <!--Rampart configurations END -->
 
     <operation name="echoString">
             <!--messageReceiver class="axis2_receivers" /-->
-        <parameter name="wsamapping" >http://ws.apache.org/axis2/c/samples/sec_echo</parameter>
+            <parameter name="wsamapping">http://example.com/ws/2004/09/policy/Test/EchoRequest</parameter>
     </operation>
 
+    <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+        <wsp:ExactlyOne>
+            <wsp:All>
+                <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+                    <wsp:Policy>
+                        <sp:InitiatorToken>
+                            <wsp:Policy>
+                                <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
+                                    <wsp:Policy>
+                                        <sp:WssX509V3Token10/>
+                                    </wsp:Policy>
+                                </sp:X509Token>
+                            </wsp:Policy>
+                        </sp:InitiatorToken>
+                        <sp:RecipientToken>
+                            <wsp:Policy>
+                                <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+                                    <wsp:Policy>
+                                        <sp:WssX509V3Token10/>
+                                    </wsp:Policy>
+                                </sp:X509Token>
+                            </wsp:Policy>
+                        </sp:RecipientToken>
+                        <sp:AlgorithmSuite>
+                            <wsp:Policy>
+                                <sp:Basic256Rsa15/>
+                            </wsp:Policy>
+                        </sp:AlgorithmSuite>
+                        <sp:Layout>
+                            <wsp:Policy>
+                                <sp:Strict/>
+                            </wsp:Policy>
+                        </sp:Layout>
+                        <sp:IncludeTimestamp/>
+                        <!--sp:EncryptBeforeSigning/-->
+                    </wsp:Policy>
+                </sp:AsymmetricBinding>
+                <!--sp:SignedSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+                <wsp:Policy>
+                    <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Always"/>
+                </wsp:Policy>
+                </sp:SignedSupportingTokens-->
+                <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+                    <wsp:Policy>
+                        <sp:MustSupportRefKeyIdentifier/>
+                        <sp:MustSupportRefEmbeddedToken/>
+                        <sp:MustSupportRefIssuerSerial/>
+                    </wsp:Policy>
+                </sp:Wss10>
+                <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+                    <sp:Body/>
+                </sp:EncryptedParts-->
+                <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+                    <sp:Body/>
+                </sp:SignedParts>
+                <rampc:RampartConfig xmlns:rampc="http://ws.apache.org/rampart/c/policy">
+                    <rampc:User>Alice</rampc:User>
+                    <rampc:TimeToLive>360</rampc:TimeToLive>
+                    <rampc:EncryptionUser>b</rampc:EncryptionUser>
+                    <rampc:PasswordType>Digest</rampc:PasswordType>
+                    <rampc:PasswordCallbackClass>AXIS2C_HOME/bin/samples/rampart/callback/libpwcb.so</rampc:PasswordCallbackClass>
+                    <rampc:ReceiverCertificate>AXIS2C_HOME/bin/samples/rampart/keys/bhome/alice_cert.cert</rampc:ReceiverCertificate>
+                    <rampc:Certificate>AXIS2C_HOME/bin/samples/rampart/keys/bhome/bob_cert.cert</rampc:Certificate>
+                    <rampc:PrivateKey>AXIS2C_HOME/bin/samples/rampart/keys/bhome/bob_key.pem</rampc:PrivateKey>
+                </rampc:RampartConfig>
+            </wsp:All>
+        </wsp:ExactlyOne>
+    </wsp:Policy>
 </service>

Modified: webservices/rampart/trunk/c/src/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/Makefile.am?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/Makefile.am (original)
+++ webservices/rampart/trunk/c/src/Makefile.am Mon May 28 00:21:08 2007
@@ -1 +1 @@
-SUBDIRS = omxmlsec secpolicy handlers util core data 
+SUBDIRS = omxmlsec handlers util core data 

Modified: webservices/rampart/trunk/c/src/core/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/core/Makefile.am?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/core/Makefile.am (original)
+++ webservices/rampart/trunk/c/src/core/Makefile.am Mon May 28 00:21:08 2007
@@ -8,10 +8,9 @@
 libmod_rampart_la_LIBADD  = ../handlers/librampart_handlers.la \
 			    ../util/librampart_util.la \
 			    ../omxmlsec/libomxmlsec.la \
-				../secpolicy/model/librp_model.la \
-				../secpolicy/builder/librp_builder.la \
 				${AXIS2C_HOME}/lib
 
 INCLUDES = -I$(top_builddir)/include \
+			-I$(AXIS2C_HOME)/include/neethi-0.1 \
 			-I ../../include \
 			@AXIS2INC@

Modified: webservices/rampart/trunk/c/src/handlers/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/handlers/Makefile.am?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/handlers/Makefile.am (original)
+++ webservices/rampart/trunk/c/src/handlers/Makefile.am Mon May 28 00:21:08 2007
@@ -5,4 +5,5 @@
 								rampart_in_handler.c
 INCLUDES = -I$(top_builddir)/include \
 			-I ../../include \
+			-I $(AXIS2C_HOME)/include/neethi-0.1 \
 			@AXIS2INC@

Modified: webservices/rampart/trunk/c/src/handlers/rampart_in_handler.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/handlers/rampart_in_handler.c?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/handlers/rampart_in_handler.c (original)
+++ webservices/rampart/trunk/c/src/handlers/rampart_in_handler.c Mon May 28 00:21:08 2007
@@ -33,11 +33,8 @@
 #include <rampart_util.h>
 #include <rampart_sec_header_processor.h>
 #include <rampart_sec_processed_result.h>
-#include <rp_policy_creator.h>
-#include <rp_secpolicy_builder.h>
 #include <rampart_context.h>
-#include <rampart_engine.h>
-
+#include <rampart_neethi.h>
 /*************************** Function headers *********************************/
 
 axis2_status_t AXIS2_CALL
@@ -112,14 +109,27 @@
     }
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "SOAP header found");
 
-    sec_node = rampart_get_security_token(env, msg_ctx, soap_header);
-    
-    if(!sec_node)
+    rampart_context = rampart_neethi_build_configuration(env, msg_ctx, AXIS2_TRUE);
+
+    if(!rampart_context)
     {
-        AXIS2_LOG_INFO(env->log, 
-		    "[rampart][rampart_in_handler] No security header element.");
+        AXIS2_LOG_INFO(env->log, "[rampart][rampart_in_handler] ramaprt_context creation failed.");
         return AXIS2_FAILURE;
     }
+    
+    sec_node = rampart_get_security_token(env, msg_ctx, soap_header);
+
+    if((rampart_context_get_binding_type(rampart_context,env)) != RP_BINDING_TRANSPORT)
+    {
+        /*sec_node = rampart_get_security_token(env, msg_ctx, soap_header);*/
+    
+        if(!sec_node)
+        {
+            AXIS2_LOG_INFO(env->log, 
+		        "[rampart][rampart_in_handler] No security header element.");
+            return AXIS2_FAILURE;
+        }
+    }
 
     status = rampart_set_security_processed_results_property(env, msg_ctx);
     
@@ -128,11 +138,16 @@
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
 				"[rampart][rampart_in_handler] Unable to set the security processed results");
     }
+    /*rampart_context = rampart_neethi_build_configuration(env, msg_ctx, AXIS2_TRUE);*/
 
-    rampart_context = rampart_engine_init(env,msg_ctx,AXIS2_TRUE);
+/*  rampart_context = rampart_engine_init(env,msg_ctx,AXIS2_TRUE);*/
+/*
     if(!rampart_context)
+    {        
+        AXIS2_LOG_INFO(env->log, "[rampart][rampart_in_handler] ramaprt_context creation failed.");
         return AXIS2_FAILURE;
-
+    }
+*/
     status = rampart_shp_process_message(env, msg_ctx, rampart_context, 
 						soap_envelope, sec_node);
     
@@ -140,7 +155,7 @@
     {
         AXIS2_LOG_INFO(env->log,
             "[rampart][rampart_in_handler] Security Header processing failed.");
-        rampart_engine_shutdown(env,rampart_context);
+  /*    rampart_engine_shutdown(env,rampart_context);*/
         return status;
     }        
             
@@ -148,7 +163,7 @@
     /*We do not need rampart context to be freed in the server side*/
     if(!serverside){
     /*This method will free the rampart_context*/
-        status = rampart_engine_shutdown(env, rampart_context);
+/*      status = rampart_engine_shutdown(env, rampart_context);*/
     }        
     
     return status;

Modified: webservices/rampart/trunk/c/src/handlers/rampart_out_handler.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/handlers/rampart_out_handler.c?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/handlers/rampart_out_handler.c (original)
+++ webservices/rampart/trunk/c/src/handlers/rampart_out_handler.c Mon May 28 00:21:08 2007
@@ -29,11 +29,8 @@
 #include <rampart_timestamp_token.h>
 #include <rampart_encryption.h>
 #include <rampart_sec_header_builder.h>
-#include <rp_policy_creator.h>
-#include <rp_secpolicy_builder.h>
 #include <rampart_context.h>
-#include <rampart_engine.h>
-
+#include <rampart_neethi.h>
 /*********************** Function headers *********************************/
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -124,16 +121,25 @@
             return AXIS2_SUCCESS;
         }
 
-        rampart_context = rampart_engine_init(env,msg_ctx,AXIS2_FALSE);
+        rampart_context = rampart_neethi_build_configuration(env, msg_ctx, AXIS2_FALSE);
+
         if(!rampart_context)
+        {
+            AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler] ramaprt_context creation failed.");
             return AXIS2_FAILURE;
+        }
 
+/*
+        rampart_context = rampart_engine_init(env,msg_ctx,AXIS2_FALSE);
+        if(!rampart_context)
+            return AXIS2_FAILURE;
+*/
         /*We call the security header builder*/
         status = rampart_shb_build_message(env, msg_ctx, rampart_context, soap_envelope);
         if(AXIS2_FAILURE == status){
                 AXIS2_LOG_INFO(env->log,
                     "[rampart][rampart_out_handler] Security header building failed ERROR");
-                rampart_engine_shutdown(env,rampart_context);
+              /* rampart_engine_shutdown(env,rampart_context);*/
                 return AXIS2_FAILURE;
         }
         /*status = rampart_engine_shutdown(env,rampart_context);*/

Modified: webservices/rampart/trunk/c/src/omxmlsec/encryption.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/encryption.c?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/encryption.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/encryption.c Mon May 28 00:21:08 2007
@@ -130,12 +130,14 @@
         unsigned char *decoded_data = NULL;/*Can be binary*/
         int decoded_len = -1;
         int enclen = -1;
+        int x=-1;
         oxs_buffer_t *decoded_buf = NULL;
 
         decoded_buf = oxs_buffer_create(env);
 
         /*First we need to base64 decode*/
-        decoded_data = AXIS2_MALLOC(env->allocator, axutil_base64_decode_len((char*)oxs_buffer_get_data(input, env)));
+        x =  axutil_base64_decode_len((const char*)oxs_buffer_get_data(input, env));
+        decoded_data = AXIS2_MALLOC(env->allocator, x);
         decoded_len = axutil_base64_decode_binary(decoded_data, (char*)oxs_buffer_get_data(input, env) );
         if (decoded_len < 0)
         {

Modified: webservices/rampart/trunk/c/src/omxmlsec/xml_encryption.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/xml_encryption.c?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/xml_encryption.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/xml_encryption.c Mon May 28 00:21:08 2007
@@ -351,6 +351,7 @@
     axiom_node_t *cd_node = NULL;
     axiom_node_t *cv_node = NULL;
     axis2_char_t *cipher_val = NULL;
+    axis2_char_t *new_cipher_val = NULL;
     axis2_char_t *sym_algo = NULL;
     axis2_char_t *type = NULL;
     axis2_char_t *id = NULL;
@@ -377,9 +378,13 @@
     cv_node = oxs_axiom_get_first_child_node_by_name(env, cd_node, OXS_NODE_CIPHER_VALUE,OXS_ENC_NS,OXS_XENC);
     cipher_val = oxs_token_get_cipher_value(env, cv_node);
 
+    /*NEW CODE*/
+    new_cipher_val = oxs_util_get_newline_removed_string(env, cipher_val);
+
+    /*eof NEW CODE*/
     /*Create input buffer with cipher data obtained*/
     input_buf = oxs_buffer_create(env);
-    oxs_buffer_populate(input_buf, env, (unsigned char*)cipher_val, axutil_strlen(cipher_val) );
+    oxs_buffer_populate(input_buf, env, (unsigned char*)new_cipher_val, axutil_strlen(new_cipher_val) );
 
     /*Decrypt*/
     oxs_ctx_set_operation(enc_ctx, env, OXS_CTX_OPERATION_DECRYPT);

Modified: webservices/rampart/trunk/c/src/util/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/Makefile.am?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/util/Makefile.am (original)
+++ webservices/rampart/trunk/c/src/util/Makefile.am Mon May 28 00:21:08 2007
@@ -3,10 +3,10 @@
 noinst_LTLIBRARIES = librampart_util.la
 
 librampart_util_la_SOURCES = rampart_crypto_util.c \
-							rampart_util.c rampart_handler_util.c rampart_username_token.c  rampart_timestamp_token.c \
+							rampart_util.c rampart_handler_util.c rampart_username_token.c rampart_timestamp_token.c \
 							rampart_encryption.c rampart_sec_header_processor.c rampart_sec_processed_result.c \
-							rampart_sec_header_builder.c rampart_context.c rampart_engine.c rampart_token_processor.c rampart_signature.c \
-							rampart_token_builder.c rampart_rd_record.c rampart_replay_detector.c
+							rampart_sec_header_builder.c rampart_context.c rampart_token_processor.c rampart_signature.c \
+							rampart_token_builder.c rampart_rd_record.c rampart_replay_detector.c rampart_neethi.c
 
 
 librampart_util_la_LIBADD  = -lssl \
@@ -15,4 +15,5 @@
 
 INCLUDES = -I$(top_builddir)/include \
 			-I ../../include \
+			-I $(AXIS2C_HOME)/include/neethi-0.1 \
 			@AXIS2INC@

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=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_context.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_context.c Mon May 28 00:21:08 2007
@@ -1949,6 +1949,7 @@
     rp_property_t *token,
     int token_type,
     axis2_bool_t server_side,
+    axis2_bool_t is_inpath,
     const axutil_env_t *env)
 {
     axis2_char_t *inclusion = NULL;
@@ -1961,13 +1962,27 @@
         inclusion = rp_x509_token_get_inclusion(x509_token,env);
 
         if(server_side)
-            include = ((axutil_strcmp(inclusion,RP_INCLUDE_ALWAYS)==0)||
-                       (axutil_strcmp(inclusion,RP_INCLUDE_ONCE)==0));
+        {
+            if(is_inpath)
+            {
+                include = ((axutil_strcmp(inclusion,RP_INCLUDE_ALWAYS)==0)||
+                       (axutil_strcmp(inclusion,RP_INCLUDE_ONCE)==0)||
+                       (axutil_strcmp(inclusion,RP_INCLUDE_ALWAYS_TO_RECIPIENT)==0));
+            }
+            else
+                include = (axutil_strcmp(inclusion,RP_INCLUDE_ALWAYS)==0);
+        }
         else
-            include = ((axutil_strcmp(inclusion,RP_INCLUDE_ALWAYS)==0)||
+        {            
+            if(!is_inpath)
+            {    
+                include = ((axutil_strcmp(inclusion,RP_INCLUDE_ALWAYS)==0)||
                        (axutil_strcmp(inclusion,RP_INCLUDE_ONCE)==0)||
                        (axutil_strcmp(inclusion,RP_INCLUDE_ALWAYS_TO_RECIPIENT)==0));
-
+            }
+            else
+                include = (axutil_strcmp(inclusion,RP_INCLUDE_ALWAYS)==0);
+        }
         return include;
     }
     else

Modified: webservices/rampart/trunk/c/src/util/rampart_encryption.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_encryption.c?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_encryption.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_encryption.c Mon May 28 00:21:08 2007
@@ -167,7 +167,7 @@
     /*First we should check whether we include the token in the
      *message.*/
 
-    if(rampart_context_is_token_include(rampart_context,token,token_type,server_side,env))
+    if(rampart_context_is_token_include(rampart_context,token,token_type,server_side,AXIS2_FALSE,env))
     {
         eki = RAMPART_STR_DIRECT_REFERENCE;
     }

Modified: webservices/rampart/trunk/c/src/util/rampart_engine.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_engine.c?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_engine.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_engine.c Mon May 28 00:21:08 2007
@@ -21,303 +21,162 @@
 
 #include <rampart_engine.h>
 #include <axis2_ctx.h>
-#include <rampart_replay_detector.h>
+#include <axis2_svc.h>
+#include <axis2_desc.h>
+#include <axis2_policy_include.h>
+#include <rp_secpolicy_builder.h>
+#include <neethi_policy.h>
+#include <rampart_authn_provider.h>
+#include <rampart_util.h>
+#include <rampart_constants.h>
+#include <rampart_callback.h>
+#include <axis2_msg.h>
+#include <axis2_conf_ctx.h>
+
 /*This method sets all the configurations
  loads required modules and start rampart.*/
 
-rampart_context_t *AXIS2_CALL
-get_rampart_context_with_secpolicy_from_om(
-    rampart_context_t *rampart_context,
-    const axutil_env_t *env);
-
-rampart_context_t *AXIS2_CALL
-build_rampart_context_from_file(
-    const axutil_env_t *env,
-    axis2_char_t *file_name);
-
-rampart_context_t *AXIS2_CALL
-get_rampart_context_in_server_side(
-    const axutil_env_t *env,
-    axis2_msg_ctx_t *msg_ctx,
-    const axis2_char_t *key);
-
-
-AXIS2_EXTERN rampart_context_t* AXIS2_CALL
-rampart_engine_init(const axutil_env_t *env,
-                    axis2_msg_ctx_t *msg_ctx,
-                    axis2_bool_t is_inflow)
+
+AXIS2_EXTERN rampart_context_t *AXIS2_CALL 
+rampart_engine_build_configuration(
+        const axutil_env_t *env,
+        axis2_msg_ctx_t *msg_ctx,
+        axis2_bool_t is_inflow)
 {
 
-    axis2_char_t *file_name = NULL;
+    axis2_svc_t *svc = NULL;
+    axis2_desc_t *desc = NULL;
+    axis2_policy_include_t *policy_include = NULL;
+    neethi_policy_t *service_policy = NULL;
+    rp_secpolicy_t *secpolicy = NULL;
     rampart_context_t *rampart_context = NULL;
-    void *value = NULL;
-
-    /*First we try to load the rampart_context*
-     *This can be set from an extension like PHP
-     So first extract it from such a scenario.*/
+    rampart_callback_t* password_callback_module = NULL;
+    rampart_authn_provider_t *authn_provider = NULL;
+    axis2_char_t *pwcb_module_name = NULL;
+    axis2_char_t *authn_provider_name = NULL;
+    axis2_status_t status = AXIS2_SUCCESS;
+    axis2_op_t *op = NULL;
+    axis2_msg_t *msg = NULL;
+    axis2_conf_ctx_t *conf_ctx = NULL;
+    axis2_ctx_t *ctx = NULL;
+    axutil_property_t *property = NULL;
 
-    if(is_inflow)
+    conf_ctx =  axis2_msg_ctx_get_conf_ctx(msg_ctx,env);
+    if(!conf_ctx)
     {
-        value = rampart_get_rampart_configuration(env,msg_ctx,INFLOW_RAMPART_CONTEXT);
-        if(value)
-        {
-            /*We need a rampart_context*/
-            rampart_context = (rampart_context_t *)value;
-            if(!rampart_context)
-            {
-                AXIS2_LOG_INFO(env->log,"[rampart][rampart_engine] Type in the parameter is not rampart_context");
-                return NULL;
-            }
-            /*We will build sec policy from the axiom representation of the policy. Used in PHP ext*/
-            rampart_context = get_rampart_context_with_secpolicy_from_om(rampart_context,env);
-
-        }else{
-            /*For the performance we will first chk if we have a saved configuration in the conf ctx.[else block]
-             *If not we will extract configurations from the descriptor files*/
-            if(axis2_msg_ctx_get_server_side(msg_ctx,env)) {
-                /*If the server side*/
-                rampart_context =  get_rampart_context_in_server_side(env,msg_ctx,IN_MESSAGE_SECURITY);
-            }else{
-                value = rampart_get_rampart_configuration(env,msg_ctx,RAMPART_INFLOW_SECURITY_POLICY);
-                if(!value){
-                    AXIS2_LOG_INFO(env->log,"[rampart][rampart_engine] Errors in the configurations");
-                    return NULL;
-                }
-                file_name = (axis2_char_t *)value;
-                rampart_context =  build_rampart_context_from_file(env,file_name);
-            }
-        }
-        /*We set our default impl of replay detection function*/
-        rampart_context_set_replay_detect_function(rampart_context, env, rampart_replay_detector_default);
-    }else{
-        /*Outflow*/
-        value = rampart_get_rampart_configuration(env,msg_ctx,OUTFLOW_RAMPART_CONTEXT);
-        if(value)
+        AXIS2_LOG_INFO(env->log, "[rampart][engine] Conf context is NULL ");
+        return NULL;
+    }
+    ctx = axis2_conf_ctx_get_base(conf_ctx,env);
+    if(!ctx)
+    {
+        AXIS2_LOG_INFO(env->log, "[rampart][engine] axis2 context is NULL ");
+        return NULL;
+    }
+    
+    svc =  axis2_msg_ctx_get_svc(msg_ctx,env);
+    if(!svc)
+    {
+        property = axis2_ctx_get_property(ctx, env, RAMPART_CONTEXT);
+        if(property)
+            return (rampart_context_t *)axutil_property_get_value(property,env);
+        else
         {
-            rampart_context = (rampart_context_t *)value;
-            if(!rampart_context)
-            {
-                AXIS2_LOG_INFO(env->log,"[rampart][rampart_engine] Type in the parameter is not rampart_context");
-                return NULL;
-            }
-            rampart_context =  get_rampart_context_with_secpolicy_from_om(rampart_context,env);
-        }else{
-            if(axis2_msg_ctx_get_server_side(msg_ctx,env))
-            {
-                rampart_context = get_rampart_context_in_server_side(env,msg_ctx,OUT_MESSAGE_SECURITY);
-            }
-            else
-            {
-                value = rampart_get_rampart_configuration(env,msg_ctx,RAMPART_OUTFLOW_SECURITY_POLICY);
-                if(!value)
-                {
-                    AXIS2_LOG_INFO(env->log,"[rampart][rampart_engine] Errors in the configurations");
-                    return NULL;
-                }
-                file_name = (axis2_char_t *)value;
-                rampart_context =  build_rampart_context_from_file(env,file_name);
-            }
+            AXIS2_LOG_INFO(env->log, "[rampart][rampart_neethi] Service is NULL.");
+            return NULL;
         }
     }
-
-    return rampart_context;
-}
-
-rampart_context_t *AXIS2_CALL
-get_rampart_context_with_secpolicy_from_om(
-    rampart_context_t *rampart_context,
-    const axutil_env_t *env)
-{
-    axiom_node_t *policy_node = NULL;
-    rp_secpolicy_t *secpolicy = NULL;
-
-    policy_node = rampart_context_get_policy_node(rampart_context,env);
-    if(!policy_node)
+                        
+    op = axis2_msg_ctx_get_op(msg_ctx, env);
+    if(!op)
     {
-        AXIS2_LOG_INFO(env->log,"[rampart][rampart_engine] Policy node is null.");
+        AXIS2_LOG_INFO(env->log, "[rampart][rampart_engine] Operation is NULL.");
         return NULL;
+    }        
+    
+    if(is_inflow)
+    {
+        msg = axis2_op_get_msg(op, env, "in");
     }
-    secpolicy = rp_policy_create_from_om_node(env,policy_node);
-    if(!secpolicy)
+    else
     {
-        AXIS2_LOG_INFO(env->log,"[rampart][rampart_engine] Cannot create policy from the node");
+        msg = axis2_op_get_msg(op, env, "out");
+    }        
+
+    if(!msg)
+    {
+        AXIS2_LOG_INFO(env->log, "[rampart][rampart_engine] Message is NULL.");
         return NULL;
     }
-    rampart_context_set_secpolicy(rampart_context,env,secpolicy);
-    return rampart_context;
-}
-
-rampart_context_t *AXIS2_CALL
-build_rampart_context_from_file(
-    const axutil_env_t *env,
-    axis2_char_t *file_name)
-{
-    rp_secpolicy_t *secpolicy = NULL;
-    rampart_context_t *rampart_context = NULL;
-    rampart_callback_t* password_callback_module = NULL;
-    rampart_authn_provider_t *authn_provider = NULL;
-    axis2_char_t *pwcb_module_name = NULL;
-    axis2_char_t *authn_provider_name = NULL;
-    axis2_status_t status = AXIS2_SUCCESS;
-
-    if(!file_name)
+    
+    /*desc = axis2_svc_get_base(svc, env);*/
+    desc = axis2_msg_get_base(msg, env);
+    if(!desc)
     {
-        AXIS2_LOG_INFO(env->log,
-                       "[rampart][rampart_Engine] No Security in the flow. So nothing to do");
+        AXIS2_LOG_INFO(env->log, "[rampart][rampart_engine] axis2 description is NULL.");
         return NULL;
     }
-    AXIS2_LOG_INFO(env->log, "[rampart][rampart_Engine] Trying to build rampart context from file %s ", file_name);
-
-    secpolicy = rp_policy_create_from_file(env,file_name);
-
-    if(!secpolicy)
+    policy_include = axis2_desc_get_policy_include(desc, env);        
+    
+    if(!policy_include)
     {
-        AXIS2_LOG_INFO(env->log, "[rampart][rampart_Engine] Cannot get policy" );
-        /*No policy so we cant proceed.*/
+        AXIS2_LOG_INFO(env->log, "[rampart][rampart_engine] Policy include is NULL.");
         return NULL;
     }
-    rampart_context = rampart_context_create(env);
+    /*service_policy = axis2_policy_include_get_policy(policy_include, env);*/
+    service_policy = axis2_policy_include_get_effective_policy(policy_include, env);
+    
+    if(!service_policy)
+    {
+        AXIS2_LOG_INFO(env->log, "[rampart][rampart_engine] Policy is NULL.");
+        return NULL;
+    }    
+    secpolicy = rp_secpolicy_builder_build(env, service_policy);
 
-    if(!rampart_context)
+    if(!secpolicy)
     {
-        AXIS2_LOG_INFO(env->log, "[rampart][rampart_Engine]System is out of memory. Cannot get Rampart Context ");
-        /*No policy so we cant proceed.*/
+        AXIS2_LOG_INFO(env->log, "[rampart][rampart_engine] security policy is NULL.");
         return NULL;
     }
-
-    rampart_context_set_secpolicy(rampart_context,env,secpolicy);
+    rampart_context = rampart_context_create(env);
+    
+    rampart_context_set_secpolicy(rampart_context, env, secpolicy);
 
     status = rampart_context_set_user_from_file(rampart_context,env);
-    if(status!=AXIS2_SUCCESS){
+    if(status!=AXIS2_SUCCESS)
         return NULL;
-    }
+
     status = rampart_context_set_ttl_from_file(rampart_context,env);
-    if(status!=AXIS2_SUCCESS){
+    if(status!=AXIS2_SUCCESS)
         return NULL;
-    }
+
     status = rampart_context_set_password_type_from_file(rampart_context,env);
-    if(status!=AXIS2_SUCCESS){
+    if(status!=AXIS2_SUCCESS)
         return NULL;
-    }
-    status = rampart_context_set_rd_val_from_file(rampart_context,env);
-    if(status!=AXIS2_SUCCESS){
-            return NULL;
-    }
+
     pwcb_module_name = rampart_context_get_password_callback_class(rampart_context,env);
 
     if(pwcb_module_name)
     {
         password_callback_module = rampart_load_pwcb_module(env,pwcb_module_name);
-        if(password_callback_module){
+        if(password_callback_module)
             rampart_context_set_password_callback(rampart_context,env,password_callback_module);
-        }            
     }
     authn_provider_name = rampart_context_get_authn_module_name(rampart_context,env);
 
     if(authn_provider_name)
     {
         authn_provider = rampart_load_auth_module(env,authn_provider_name);
-        if(authn_provider){
+        if(authn_provider)
             rampart_context_set_authn_provider(rampart_context,env,authn_provider);
-        }            
     }
-    return rampart_context;
-
-}
-
-rampart_context_t *AXIS2_CALL
-get_rampart_context_in_server_side(
-    const axutil_env_t *env,
-    axis2_msg_ctx_t *msg_ctx,
-    const axis2_char_t *key)
-{
-
-    axis2_conf_ctx_t *conf_ctx = NULL;
-    axis2_ctx_t *ctx = NULL;
-    axutil_property_t *property = NULL;
-
-    conf_ctx =  axis2_msg_ctx_get_conf_ctx(msg_ctx,env);
-    if(!conf_ctx)
-    {
-        AXIS2_LOG_INFO(env->log, "[rampart][engine] Conf context is NULL ");
-        return NULL;
-    }
-    ctx = axis2_conf_ctx_get_base(conf_ctx,env);
-    if(!ctx)
+    if(!axis2_msg_ctx_get_server_side(msg_ctx, env))
     {
-        AXIS2_LOG_INFO(env->log, "[rampart][engine] axis2 context is NULL ");
-        return NULL;
-    }
-    /*Possible Keys : IN_MESSAGE_SECURITY, OUT_MESSAGE_SECURITY*/
-    property = axis2_ctx_get_property(ctx,env,key);
-    if(property)
-    {
-        return (rampart_context_t *)axutil_property_get_value(property,env);
-    }else{
-        /*We cannot find the rampart_context as a property in axis2_ctx. Thus we need to create*/
-        axis2_char_t *file_name = NULL;
-        rampart_context_t *rampart_context = NULL;
-
-        if(axutil_strcmp(key, IN_MESSAGE_SECURITY)==0)
-        {
-            file_name =(axis2_char_t *)rampart_get_rampart_configuration(env,msg_ctx,RAMPART_INFLOW_SECURITY_POLICY);
-            if(file_name)
-            {
-                rampart_context = build_rampart_context_from_file(env,file_name);
-                /*
-                property = axutil_property_create(env);
-                axutil_property_set_value(property,env,rampart_context);
-                */
-                
-                property = axutil_property_create_with_args(env, AXIS2_SCOPE_APPLICATION,
-                            AXIS2_FALSE, (void *)rampart_engine_shutdown, rampart_context );
-                            
-                axis2_ctx_set_property(ctx, env, key, property);
-                return rampart_context;
-            }
-            else
-            {
-                AXIS2_LOG_INFO(env->log,"[rampart][rampart_engine] Errors in the configurations");
-                return NULL;
-            }
-        }
-        else if(axutil_strcmp(key,OUT_MESSAGE_SECURITY)==0)
-        {
-            file_name =(axis2_char_t *)rampart_get_rampart_configuration(env,msg_ctx,RAMPART_OUTFLOW_SECURITY_POLICY);
-            if(file_name)
-            {
-                rampart_context = build_rampart_context_from_file(env,file_name);
-                /*property = axutil_property_create(env);
-                axutil_property_set_value(property,env,rampart_context);*/
-                
-                property = axutil_property_create_with_args(env, AXIS2_SCOPE_APPLICATION,
-                                            AXIS2_FALSE, (void *)rampart_engine_shutdown, rampart_context );
-                axis2_ctx_set_property(ctx,env,key,property);
-                return rampart_context;
-            }
-            else
-            {
-                AXIS2_LOG_INFO(env->log,"[rampart][rampart_engine] Errors in the configurations");
-                return NULL;
-            }
-        }
-        else return NULL;
+        property = axutil_property_create_with_args(env, AXIS2_SCOPE_APPLICATION,
+                                            AXIS2_FALSE, (void *)rampart_context_free, rampart_context);
+        axis2_ctx_set_property(ctx, env, RAMPART_CONTEXT, property);
     }
+    
+    return rampart_context;
 }
 
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-rampart_engine_shutdown(const axutil_env_t *env,
-                        rampart_context_t *rampart_context)
-{
-
-    /*  rp_secpolicy_t *secpolicy = NULL;*/
-    axis2_status_t status = AXIS2_FAILURE;
-
-    /*  secpolicy = rampart_context_get_secpolicy(rampart_context,env);
-        status = rp_secpolicy_free(secpolicy,env);
-        secpolicy = NULL;
-    */
-    status = rampart_context_free(rampart_context,env);
-    rampart_context = NULL;
-    return status;
-}

Modified: webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c Mon May 28 00:21:08 2007
@@ -62,7 +62,7 @@
                           axiom_soap_envelope_t *soap_envelope)
 {
 
-    axis2_status_t status = AXIS2_FAILURE;
+    axis2_status_t status = AXIS2_SUCCESS;
     axiom_soap_header_t *soap_header = NULL;
     axiom_node_t *soap_header_node = NULL;
     axiom_element_t *soap_header_ele = NULL;
@@ -213,9 +213,51 @@
     }
     else if((rampart_context_get_binding_type(rampart_context,env)) == RP_BINDING_TRANSPORT)
     {
-        /*Do Transport Binding specific things */
-        AXIS2_LOG_INFO(env->log, "[rampart][shb] Transport Binding. We do not support yet");
-        return AXIS2_FAILURE;
+        /*Timestamp Inclusion*/
+
+        if(rampart_context_is_include_timestamp(rampart_context,env))
+        {
+            int ttl = -1;
+            AXIS2_LOG_INFO(env->log, "[rampart][shb]  building Timestamp Token");
+            AXIS2_LOG_INFO(env->log, "[rampart][shb]  Using default timeToLive value %d",
+                           RAMPART_TIMESTAMP_TOKEN_DEFAULT_TIME_TO_LIVE);
+            /*ttl = RAMPART_TIMESTAMP_TOKEN_DEFAULT_TIME_TO_LIVE;*/
+            ttl = rampart_context_get_ttl(rampart_context,env);
+
+            status = rampart_timestamp_token_build(env,
+                                                   sec_node, sec_ns_obj, ttl);
+            if (status == AXIS2_FAILURE)
+            {
+                AXIS2_LOG_INFO(env->log, "[rampart][shb] Timestamp Token build failed. ERROR");
+                return AXIS2_FAILURE;
+            }
+        }
+
+        /*Check whether we need username token*/
+        /*User name tokens includes in messages sent from client to server*/
+        if(!axis2_msg_ctx_get_server_side(msg_ctx,env))
+        {
+            if(rampart_context_is_include_username_token(rampart_context,env))
+            {
+
+                /*Now we are passing rampart_context here so inside this method
+                relevant parameters are extracted. */
+
+                AXIS2_LOG_INFO(env->log, "[rampart][shb]  building UsernmaeToken");
+                status =rampart_username_token_build(
+                            env,
+                            rampart_context,
+                            sec_node,
+                            sec_ns_obj);
+                if (status == AXIS2_FAILURE)
+                {
+                    AXIS2_LOG_INFO(env->log, "[rampart][shb] UsernmaeToken build failed. ERROR");
+                    return AXIS2_FAILURE;
+                }
+            }
+            return status;
+        }
+        return status;
     }
     else
         return AXIS2_FAILURE;

Modified: webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c?view=diff&rev=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c Mon May 28 00:21:08 2007
@@ -568,7 +568,7 @@
         AXIS2_LOG_INFO(env->log,"[rampart][shp] We still do not support derived keys");
         return AXIS2_FAILURE;
     }
-    is_include_token = rampart_context_is_token_include(rampart_context,token,token_type,server_side,env);
+    is_include_token = rampart_context_is_token_include(rampart_context,token,token_type,server_side,AXIS2_TRUE,env);
 
     key_info_node = oxs_axiom_get_first_child_node_by_name(env, sig_node,
                     OXS_NODE_KEY_INFO,OXS_DSIG_NS, OXS_DS );
@@ -935,8 +935,40 @@
     }
     else if((rampart_context_get_binding_type(rampart_context,env)) == RP_BINDING_TRANSPORT)
     {
-        AXIS2_LOG_INFO(env->log, "[rampart][shp] We still not support Transport binding.");
-        return AXIS2_FAILURE;
+        axis2_status_t status = AXIS2_FAILURE;
+        
+        status = rampart_shp_process_timestamptoken(env,msg_ctx,rampart_context,sec_node);
+        if(status!=AXIS2_SUCCESS){
+            return status;
+        }
+
+        if( axis2_msg_ctx_get_server_side(msg_ctx, env))
+        {
+            status = rampart_shp_process_usernametoken(env,msg_ctx,rampart_context,sec_node);
+            if(status!=AXIS2_SUCCESS)
+                return status;
+        }
+
+        if(AXIS2_TRUE == need_replay_detection){/*TODO Chk for the policy configuration*/
+            rampart_is_replayed_fn rd_fn = NULL;
+            /*Is replayed*/
+            rd_fn = rampart_context_get_replay_detect_function(rampart_context, env);
+            if(rd_fn){
+                status  = (*rd_fn)(env, msg_ctx, rampart_context);
+                if(status != AXIS2_SUCCESS){
+                    /*Scream .. replayed*/
+                    return AXIS2_FAILURE;
+                }else{
+                    AXIS2_LOG_INFO(env->log, "[rampart][shp] Checked message for replays. Not a replay.");
+                }
+            }else{
+                AXIS2_LOG_INFO(env->log, "[rampart][shp] No replay detection function specified. Nothing to do. ");
+            }
+        }
+        AXIS2_LOG_INFO(env->log, "[rampart][shp] Security header element processing, DONE ");
+        /*Do the action accordingly*/
+        return AXIS2_SUCCESS;
+        
     }
     else
     {

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=542133&r1=542132&r2=542133
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_signature.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_signature.c Mon May 28 00:21:08 2007
@@ -202,7 +202,7 @@
     }
     /*If the requirement is to include the token we should build the binary security
      * token element here.*/
-    if(rampart_context_is_token_include(rampart_context,token,token_type,server_side,env))
+    if(rampart_context_is_token_include(rampart_context,token,token_type,server_side, AXIS2_FALSE, env))
     {
         axis2_char_t *bst_data = NULL;