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 2007/03/22 13:50:09 UTC

svn commit: r521241 [2/2] - in /webservices/axis2/trunk/c/rampart: include/ src/omxmlsec/ src/util/

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=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/username_token.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/username_token.c Thu Mar 22 05:50:04 2007
@@ -31,32 +31,9 @@
 #include <rampart_sec_processed_result.h>
 #include <rampart_authn_provider.h>
 #include <oxs_axiom.h>
-typedef struct rampart_username_token_impl
-{
-    rampart_username_token_t username_token;
-}
-rampart_username_token_impl_t;
-
-/** Interface to implementation conversion macro */
-#define AXIS2_INTF_TO_IMPL(username_token) ((rampart_username_token_impl_t *)username_token)
-
-/*************************** Function headers *********************************/
-/** private functions */
-static void
-rampart_username_token_init_ops(
-    rampart_username_token_t *username_token);
-/**
- * Get the password for given outflow security configuration
- * @param env pointer to environment struct
- * @param ctx axis2 context
- * @param Outflow security parameter
- * @return password
- */
 
 /** public functions*/
-axis2_status_t AXIS2_CALL
-rampart_username_token_free(rampart_username_token_t *username_token,
-        const axis2_env_t *env);
+
 /*
 axis2_status_t AXIS2_CALL
 rampart_username_token_build(rampart_username_token_t *username_token,
@@ -67,90 +44,11 @@
         axiom_namespace_t *sec_ns_obj);
 */
 
-axis2_status_t AXIS2_CALL
-rampart_username_token_build(rampart_username_token_t *username_token,
-        const axis2_env_t *env,
-        rampart_context_t *rampart_context,
-        axiom_node_t *sec_node,
-        axiom_namespace_t *sec_ns_obj);
 
 
 
 axis2_status_t AXIS2_CALL
-rampart_username_token_validate(rampart_username_token_t *username_token,
-        const axis2_env_t *env,
-        axis2_msg_ctx_t *msg_ctx,
-        axiom_node_t *ut_node,
-        rampart_context_t *rampart_context);
-
-/************************* End of function headers ****************************/
-static void
-rampart_username_token_init_ops(
-    rampart_username_token_t *username_token)
-{
-    username_token->ops->free = rampart_username_token_free;
-    username_token->ops->build = rampart_username_token_build;
-    username_token->ops->validate = rampart_username_token_validate;
-}
-
-
-rampart_username_token_t *AXIS2_CALL
-rampart_username_token_create(
-    const axis2_env_t *env)
-{
-    rampart_username_token_impl_t *username_token_impl = NULL;
-
-    AXIS2_ENV_CHECK(env, NULL);
-
-    username_token_impl = (rampart_username_token_impl_t *) AXIS2_MALLOC(env->allocator,
-            sizeof(rampart_username_token_impl_t));
-
-    if (! username_token_impl)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-
-    username_token_impl->username_token.ops = AXIS2_MALLOC(env->allocator,
-            sizeof(rampart_username_token_ops_t));
-    if (! username_token_impl->username_token.ops)
-    {
-        rampart_username_token_free(&(username_token_impl->username_token), env);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-
-    rampart_username_token_init_ops(&(username_token_impl->username_token));
-
-    return &(username_token_impl->username_token);
-
-}
-
-axis2_status_t AXIS2_CALL
-rampart_username_token_free(rampart_username_token_t *username_token,
-        const axis2_env_t *env)
-{
-    rampart_username_token_impl_t *username_token_impl = NULL;
-
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    username_token_impl = AXIS2_INTF_TO_IMPL(username_token);
-
-    if (username_token->ops)
-    {
-        AXIS2_FREE(env->allocator, username_token->ops);
-        username_token->ops = NULL;
-    }
-    if (username_token_impl)
-    {
-        AXIS2_FREE(env->allocator, username_token_impl);
-        username_token_impl = NULL;
-    }
-    return AXIS2_SUCCESS;
-
-}
-
-axis2_status_t AXIS2_CALL
-rampart_username_token_build(rampart_username_token_t *username_token,
+rampart_username_token_build(
         const axis2_env_t *env,
         rampart_context_t *rampart_context,
         axiom_node_t *sec_node,
@@ -170,8 +68,7 @@
     axiom_element_t *created_ele = NULL;
     axiom_namespace_t *wsu_ns_obj = NULL;
     axiom_attribute_t *om_attr = NULL;
-    axis2_char_t *password = NULL;
-    rampart_username_token_impl_t *username_token_impl = NULL;
+    axis2_char_t *password = NULL;    
     axis2_char_t *username = NULL;
     rampart_callback_t *password_callback = NULL;
 /*  axis2_bool_t isdigest = AXIS2_FALSE;*/
@@ -180,8 +77,7 @@
     void *param = NULL;
     
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    username_token_impl = AXIS2_INTF_TO_IMPL(username_token);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);    
 
     /*Directly call the password from callback module*/
 
@@ -342,7 +238,7 @@
 }
 
 axis2_status_t AXIS2_CALL
-rampart_username_token_validate(rampart_username_token_t *username_token,
+rampart_username_token_validate(
         const axis2_env_t *env,
         axis2_msg_ctx_t *msg_ctx,
         axiom_node_t *ut_node,
@@ -359,7 +255,6 @@
     axis2_char_t *password_from_svr = NULL;
     axis2_char_t *password_to_compare = NULL;
     axis2_ctx_t *ctx = NULL;
-    rampart_username_token_impl_t *username_token_impl = NULL;
     rampart_authn_provider_status_t auth_status= RAMPART_AUTHN_PROVIDER_GENERAL_ERROR ;
     axiom_element_t *ut_ele = NULL;
     password_callback_fn password_function = NULL;
@@ -369,7 +264,6 @@
     axis2_char_t *password_type_pol = NULL; 
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    username_token_impl = AXIS2_INTF_TO_IMPL(username_token);
 
     ut_ele = AXIOM_NODE_GET_DATA_ELEMENT(ut_node, env);
     if(!ut_ele)



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