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 ka...@apache.org on 2006/09/12 08:28:28 UTC

svn commit: r442479 - /webservices/axis2/trunk/c/rampart/src/util/username_token.c

Author: kaushalye
Date: Mon Sep 11 23:28:27 2006
New Revision: 442479

URL: http://svn.apache.org/viewvc?view=rev&rev=442479
Log:
Committing changes made in username token

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

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=442479&r1=442478&r2=442479
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/username_token.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/username_token.c Mon Sep 11 23:28:27 2006
@@ -389,15 +389,6 @@
     axis2_qname_t *qname = NULL;
     rampart_username_token_impl_t *username_token_impl = NULL;
 
-    /*TODO*/
-    /*
-    R4222 Any USERNAME_TOKEN MUST NOT have more than one PASSWORD.
-    R4201 Any PASSWORD MUST specify a Type attribute.
-    R4212 [summary] If no noce or created specified those should be avoided from the concatenation
-    R4223 Any USERNAME_TOKEN MUST NOT have more than one CREATED.
-    R4225 Any USERNAME_TOKEN MUST NOT have more than one NONCE
-    */
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     username_token_impl = AXIS2_INTF_TO_IMPL(username_token);
 
@@ -407,7 +398,8 @@
         AXIS2_LOG_INFO(env->log," Cannot find sec_node.. :(");
         return AXIS2_FAILURE;
     }
-    
+   
+
     sec_ele = AXIOM_NODE_GET_DATA_ELEMENT(sec_node, env);
     if(!sec_ele)
     {
@@ -415,8 +407,6 @@
         return AXIS2_FAILURE;
     }
 
-    /*TODO Get sec_ele with QNAME*/
-
     qname = axis2_qname_create(env,
                                  RAMPART_SECURITY_USERNAMETOKEN,
                                  RAMPART_WSSE_XMLNS,
@@ -431,6 +421,23 @@
         }
     }
 
+    /*Check: Any USERNAME_TOKEN MUST NOT have more than one PASSWORD*/
+    if(1 >  oxs_axiom_get_number_of_children_with_qname( env, ut_node, RAMPART_SECURITY_USERNAMETOKEN_PASSWORD, NULL, NULL))
+    {
+        return AXIS2_FAILURE;
+    }
+    
+    /*Check: Any USERNAME_TOKEN MUST NOT have more than one CREATED*/
+    if(1 >  oxs_axiom_get_number_of_children_with_qname( env, ut_node, RAMPART_SECURITY_USERNAMETOKEN_CREATED, NULL, NULL))
+    {
+        return AXIS2_FAILURE;
+    }
+ 
+    /*Check: Any USERNAME_TOKEN MUST NOT have more than one NONCE*/
+    if(1 >  oxs_axiom_get_number_of_children_with_qname( env, ut_node, RAMPART_SECURITY_USERNAMETOKEN_NONCE, NULL, NULL))
+    {
+        return AXIS2_FAILURE;
+    }
 
     /*Get children of UsernameToken element*/
     children = AXIOM_ELEMENT_GET_CHILD_ELEMENTS(ut_ele, env, ut_node);



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