You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ka...@apache.org on 2006/11/20 09:17:53 UTC

svn commit: r477100 - in /webservices/axis2/trunk/c/rampart: samples/client/echo/echo.c src/handlers/rampart_out_handler.c src/util/Makefile.am src/util/timestamp_token.c

Author: kaushalye
Date: Mon Nov 20 00:17:52 2006
New Revision: 477100

URL: http://svn.apache.org/viewvc?view=rev&rev=477100
Log:
1. Fixed JIRA       AXIS2C-411
2. If user needs to send only the Created element in the Timestamp specify a negative value for timeToLive.



Modified:
    webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c
    webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c
    webservices/axis2/trunk/c/rampart/src/util/Makefile.am
    webservices/axis2/trunk/c/rampart/src/util/timestamp_token.c

Modified: webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c?view=diff&rev=477100&r1=477099&r2=477100
==============================================================================
--- webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c (original)
+++ webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c Mon Nov 20 00:17:52 2006
@@ -107,7 +107,7 @@
     AXIS2_OPTIONS_SET_PROPERTY(options, env, RAMPART_ACTION_PW_CALLBACK_CLASS , pw_cb_property);
 
     time_to_live_property = axis2_property_create(env);
-    AXIS2_PROPERTY_SET_VALUE(time_to_live_property, env, "420");
+    AXIS2_PROPERTY_SET_VALUE(time_to_live_property, env, "-420");
     AXIS2_OPTIONS_SET_PROPERTY(options, env, RAMPART_ACTION_TIME_TO_LIVE, time_to_live_property);
 #endif
 
@@ -170,7 +170,8 @@
 
     if (svc_client)
     {
-        AXIS2_SVC_CLIENT_FREE(svc_client, env);
+        /*TODO check the double free. After Samisa's modifications*/
+        /*AXIS2_SVC_CLIENT_FREE(svc_client, env);*/
         svc_client = NULL;
     }
     return 0;

Modified: webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c?view=diff&rev=477100&r1=477099&r2=477100
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c (original)
+++ webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c Mon Nov 20 00:17:52 2006
@@ -247,13 +247,15 @@
 
                     AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler]  building Timestamp Token");
                     ttl_str = RAMPART_ACTIONS_GET_TIME_TO_LIVE(actions, env);
-                    ttl = atoi(RAMPART_ACTIONS_GET_TIME_TO_LIVE(actions, env));
-                    if (ttl <= 0)
-                    {
+                    /*Check for the ttl. If not specified use the default*/
+                    if(!ttl_str){
                         AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler]  Using default timeToLive value %s",
                                 RAMPART_TIMESTAMP_TOKEN_DEFAULT_TIME_TO_LIVE);
                         ttl = RAMPART_TIMESTAMP_TOKEN_DEFAULT_TIME_TO_LIVE;
+                    }else{
+                        ttl = atoi(RAMPART_ACTIONS_GET_TIME_TO_LIVE(actions, env));
                     }
+
                     timestamp_token = rampart_timestamp_token_create(env);
                     status = RAMPART_TIMESTAMP_TOKEN_BUILD(timestamp_token, env,
                             ctx, sec_node, sec_ns_obj, ttl);

Modified: webservices/axis2/trunk/c/rampart/src/util/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/Makefile.am?view=diff&rev=477100&r1=477099&r2=477100
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/Makefile.am (original)
+++ webservices/axis2/trunk/c/rampart/src/util/Makefile.am Mon Nov 20 00:17:52 2006
@@ -4,7 +4,7 @@
 
 librampart_util_la_SOURCES = rampart_action.c rampart_crypto_util.c \
 							rampart_util.c rampart_handler_util.c username_token.c  timestamp_token.c \
-							rampart_encryption.c rampart_sec_header_processor.c
+							rampart_encryption.c 
 
 
 librampart_util_la_LIBADD  = -lssl \

Modified: webservices/axis2/trunk/c/rampart/src/util/timestamp_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/timestamp_token.c?view=diff&rev=477100&r1=477099&r2=477100
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/timestamp_token.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/timestamp_token.c Mon Nov 20 00:17:52 2006
@@ -162,6 +162,11 @@
             AXIOM_ELEMENT_SET_TEXT(created_ele, env, created_val, created_node);
         }
         /*Then we build Expires element*/
+        /*If ttl<0 then we dont build the expires element.*/
+        if(ttl<0){
+            AXIS2_LOG_INFO(env->log, " [rampart][ts] ttl is %d which is less then zero. Thus we do not build the expires element. ");
+            return AXIS2_SUCCESS;
+        }
         expires_ele = axiom_element_create(env, ts_node, RAMPART_SECURITY_TIMESTAMP_EXPIRES, wsu_ns_obj,
                 &expires_node);
 



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