You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ma...@apache.org on 2007/03/26 07:23:43 UTC

svn commit: r522422 - in /webservices/axis2/trunk/c/rampart: include/rampart_context.h src/util/rampart_context.c src/util/username_token.c

Author: manjula
Date: Sun Mar 25 22:23:42 2007
New Revision: 522422

URL: http://svn.apache.org/viewvc?view=rev&rev=522422
Log:
Modifying the logic in calling paswword callback function
to pass a void parameter.

Modified:
    webservices/axis2/trunk/c/rampart/include/rampart_context.h
    webservices/axis2/trunk/c/rampart/src/util/rampart_context.c
    webservices/axis2/trunk/c/rampart/src/util/username_token.c

Modified: webservices/axis2/trunk/c/rampart/include/rampart_context.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart_context.h?view=diff&rev=522422&r1=522421&r2=522422
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart_context.h (original)
+++ webservices/axis2/trunk/c/rampart/include/rampart_context.h Sun Mar 25 22:23:42 2007
@@ -225,6 +225,11 @@
             rampart_context_t *rampart_context,
             const axis2_env_t *env);
 
+    AXIS2_EXTERN void* AXIS2_CALL
+    rampart_context_get_ctx(
+            rampart_context_t *rampart_context,
+            const axis2_env_t *env);
+    
     AXIS2_EXTERN int AXIS2_CALL
     rampart_context_get_ttl(
             rampart_context_t *rampart_context,

Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_context.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_context.c?view=diff&rev=522422&r1=522421&r2=522422
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_context.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_context.c Sun Mar 25 22:23:42 2007
@@ -47,6 +47,10 @@
 
     axis2_bool_t require_timestamp;
     axis2_bool_t require_ut;
+
+    /*This is used in callback functions.*/
+    void *ctx;
+
             
 };
 
@@ -146,6 +150,7 @@
     rampart_context->authenticate_with_digest = NULL;
     rampart_context->require_ut = AXIS2_FALSE;
     rampart_context->require_timestamp = AXIS2_FALSE;
+    rampart_context->ctx = NULL;
 
     return rampart_context;
 }
@@ -309,6 +314,7 @@
     AXIS2_PARAM_CHECK(env->error,pwcb_function,AXIS2_FAILURE);
 
     rampart_context->pwcb_function = pwcb_function;
+    rampart_context->ctx = ctx;
     return AXIS2_SUCCESS;
 }
 
@@ -454,6 +460,16 @@
     AXIS2_ENV_CHECK(env, NULL);
 
     return rampart_context->pwcb_function;
+}
+
+AXIS2_EXTERN void* AXIS2_CALL
+rampart_context_get_ctx(
+            rampart_context_t *rampart_context,
+            const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+
+    return rampart_context->ctx;
 }
 
 AXIS2_EXTERN int AXIS2_CALL

Modified: webservices/axis2/trunk/c/rampart/src/util/username_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/username_token.c?view=diff&rev=522422&r1=522421&r2=522422
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/username_token.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/username_token.c Sun Mar 25 22:23:42 2007
@@ -94,8 +94,15 @@
     {
         password_function = rampart_context_get_pwcb_function(rampart_context,env);
         if(password_function)
+        {            
+            param = rampart_context_get_ctx(rampart_context,env);
+            if(!param)
+            {
+                AXIS2_LOG_INFO(env->log, "[rampart][rampart_usernametoken] Param is not set.");
+                return AXIS2_FAILURE;
+            }            
             password = (*password_function)(env,username,param);
-
+        }
         else
         {
             password_callback = rampart_context_get_password_callback(rampart_context,env);
@@ -104,7 +111,6 @@
                 AXIS2_LOG_INFO(env->log, "[rampart][rampart_usernametoken] password callback module is not loaded. ERROR");
                 return AXIS2_FAILURE;
             }
-
             password = rampart_callback_password(env, password_callback,username);
         }
     }
@@ -454,11 +460,18 @@
         
         /*If not then check the call  back function*/
         if(!password_from_svr)
-        {            
+        {           
             password_function = rampart_context_get_pwcb_function(rampart_context,env);
             if(password_function)
+            {
+                param = rampart_context_get_ctx(rampart_context,env);
+                if(!param)
+                {
+                    AXIS2_LOG_INFO(env->log,"[rampart][rampart_usernametoken] Param is NULL");
+                    return AXIS2_FAILURE;
+                }
                 password_from_svr = (*password_function)(env,username,param);
-
+            }
             else
             {    
                 password_callback = rampart_context_get_password_callback(rampart_context,env);



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