axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r687306 - in /webservices/axis2/trunk/c: neethi/include/ neethi/src/ neethi/src/secpolicy/builder/ neethi/src/secpolicy/model/ src/core/deployment/
Date Wed, 20 Aug 2008 12:59:35 GMT
Author: shankar
Date: Wed Aug 20 05:59:34 2008
New Revision: 687306

URL: http://svn.apache.org/viewvc?rev=687306&view=rev
Log:
WS-Security Policy 1.2 and WS-Policy 1.5 support

Modified:
    webservices/axis2/trunk/c/neethi/include/neethi_assertion.h
    webservices/axis2/trunk/c/neethi/include/rp_defines.h
    webservices/axis2/trunk/c/neethi/include/rp_security_context_token.h
    webservices/axis2/trunk/c/neethi/include/rp_security_context_token_builder.h
    webservices/axis2/trunk/c/neethi/include/rp_token.h
    webservices/axis2/trunk/c/neethi/include/rp_x509_token.h
    webservices/axis2/trunk/c/neethi/src/assertion_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/saml_token_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/security_context_token_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/x509_token_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/model/security_context_token.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/model/token.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/model/x509_token.c
    webservices/axis2/trunk/c/src/core/deployment/module_builder.c
    webservices/axis2/trunk/c/src/core/deployment/svc_builder.c

Modified: webservices/axis2/trunk/c/neethi/include/neethi_assertion.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/neethi_assertion.h?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/neethi_assertion.h (original)
+++ webservices/axis2/trunk/c/neethi/include/neethi_assertion.h Wed Aug 20 05:59:34 2008
@@ -52,6 +52,7 @@
         ASSERTION_TYPE_SECURITY_CONTEXT_TOKEN,
         ASSERTION_TYPE_REQUIRE_EXTERNAL_URI,
         ASSERTION_TYPE_SC10_SECURITY_CONTEXT_TOKEN,
+        ASSERTION_TYPE_SC13_SECURITY_CONTEXT_TOKEN,
         ASSERTION_TYPE_ISSUER,
         ASSERTION_TYPE_BOOTSTRAP_POLICY,
         ASSERTION_TYPE_MUST_SUPPORT_REF_KEY_IDENTIFIER,
@@ -91,7 +92,8 @@
 	    ASSERTION_TYPE_WSS_SAML_V11_TOKEN_V11,
 	    ASSERTION_TYPE_WSS_SAML_V20_TOKEN_V11,
         ASSERTION_TYPE_SIGNED_ENCRYPTED_PARTS,
-        ASSERTION_TYPE_REQUIRE_DERIVED_KEYS,
+        ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC10,
+        ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC13,
         ASSERTION_TYPE_MUST_SUPPORT_CLIENT_CHALLENGE,
         ASSERTION_TYPE_MUST_SUPPORT_SERVER_CHALLENGE,
         ASSERTION_TYPE_REQUIRE_CLIENT_ENTROPY,

Modified: webservices/axis2/trunk/c/neethi/include/rp_defines.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_defines.h?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_defines.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_defines.h Wed Aug 20 05:59:34 2008
@@ -191,6 +191,7 @@
 
 #define RP_REQUIRE_EXTERNAL_URI_REFERENCE "RequireExternalUriReference"
 #define RP_SC10_SECURITY_CONTEXT_TOKEN "SC10SecurityContextToken"
+#define RP_SC13_SECURITY_CONTEXT_TOKEN "SC13SecurityContextToken"
 #define RP_BOOTSTRAP_POLICY "BootstrapPolicy"
 #define RP_ISSUER "Issuer"
 

Modified: webservices/axis2/trunk/c/neethi/include/rp_security_context_token.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_security_context_token.h?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_security_context_token.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_security_context_token.h Wed Aug 20 05:59:34 2008
@@ -1,10 +1,11 @@
 
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -25,6 +26,7 @@
 
 #include <rp_includes.h>
 #include <neethi_policy.h>
+#include <rp_token.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -53,16 +55,27 @@
         const axutil_env_t * env,
         axis2_char_t * inclusion);
 
-    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-    rp_security_context_token_get_derivedkeys(
+    AXIS2_EXTERN derive_key_type_t AXIS2_CALL
+    rp_security_context_token_get_derivedkey(
         rp_security_context_token_t * security_context_token,
         const axutil_env_t * env);
 
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rp_security_context_token_set_derivedkeys(
+    rp_security_context_token_set_derivedkey(
         rp_security_context_token_t * security_context_token,
         const axutil_env_t * env,
-        axis2_bool_t derivedkeys);
+        derive_key_type_t derivedkey);
+
+    AXIS2_EXTERN derive_key_version_t AXIS2_CALL
+    rp_security_context_token_get_derivedkey_version(
+        rp_security_context_token_t *security_context_token,
+        const axutil_env_t *env);
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_security_context_token_set_derivedkey_version(
+        rp_security_context_token_t *security_context_token,
+        const axutil_env_t *env,
+        derive_key_version_t version);
 
     AXIS2_EXTERN axis2_bool_t AXIS2_CALL
     rp_security_context_token_get_require_external_uri_ref(

Modified: webservices/axis2/trunk/c/neethi/include/rp_security_context_token_builder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_security_context_token_builder.h?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_security_context_token_builder.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_security_context_token_builder.h Wed Aug 20 05:59:34 2008
@@ -38,6 +38,7 @@
         const axutil_env_t * env,
         axiom_node_t * node,
         axiom_element_t * element, 
+        axis2_char_t *sp_ns_uri,
         axis2_bool_t is_secure_conversation_token);
 
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/neethi/include/rp_token.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_token.h?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_token.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_token.h Wed Aug 20 05:59:34 2008
@@ -39,6 +39,12 @@
         DERIVEKEY_EXPLICIT
     } derive_key_type_t;
 
+    typedef enum
+    {
+        DERIVEKEY_VERSION_SC10 =0,
+        DERIVEKEY_VERSION_SC13
+    } derive_key_version_t;
+
     typedef struct rp_token_t rp_token_t;
 
     AXIS2_EXTERN rp_token_t *AXIS2_CALL
@@ -99,6 +105,28 @@
         rp_token_t * token,
         const axutil_env_t * env);
 
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_token_set_derive_key_version(
+        rp_token_t *token, 
+        const axutil_env_t *env, 
+        derive_key_version_t version);
+
+    AXIS2_EXTERN derive_key_version_t AXIS2_CALL
+    rp_token_get_derive_key_version(
+        rp_token_t *token, 
+        const axutil_env_t *env);
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_token_set_inclusion(
+        rp_token_t *token, 
+        const axutil_env_t *env, 
+        axis2_char_t *inclusion);
+
+    AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+    rp_token_get_inclusion(
+        rp_token_t *token, 
+        const axutil_env_t *env);
+
 
 #ifdef __cplusplus
 }

Modified: webservices/axis2/trunk/c/neethi/include/rp_x509_token.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_x509_token.h?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_x509_token.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_x509_token.h Wed Aug 20 05:59:34 2008
@@ -1,10 +1,11 @@
 
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -24,6 +25,7 @@
  */
 
 #include <rp_includes.h>
+#include <rp_token.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -52,16 +54,27 @@
         const axutil_env_t * env,
         axis2_char_t * inclusion);
 
-    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-    rp_x509_token_get_derivedkeys(
+    AXIS2_EXTERN derive_key_type_t AXIS2_CALL
+    rp_x509_token_get_derivedkey(
         rp_x509_token_t * x509_token,
         const axutil_env_t * env);
 
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rp_x509_token_set_derivedkeys(
+    rp_x509_token_set_derivedkey(
         rp_x509_token_t * x509_token,
         const axutil_env_t * env,
-        axis2_bool_t derivedkeys);
+        derive_key_type_t derivedkeys);
+
+    AXIS2_EXTERN derive_key_version_t AXIS2_CALL
+    rp_x509_token_get_derivedkey_version(
+        rp_x509_token_t *x509_token,
+        const axutil_env_t *env);
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_x509_token_set_derivedkey_version(
+        rp_x509_token_t *x509_token,
+        const axutil_env_t *env,
+        derive_key_version_t version);
 
     AXIS2_EXTERN axis2_bool_t AXIS2_CALL
     rp_x509_token_get_require_key_identifier_reference(

Modified: webservices/axis2/trunk/c/neethi/src/assertion_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/assertion_builder.c?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/assertion_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/assertion_builder.c Wed Aug 20 05:59:34 2008
@@ -97,11 +97,11 @@
         }
         else if(!axutil_strcmp(localname, RP_SECURITY_CONTEXT_TOKEN))
         {
-            return rp_security_context_token_builder_build(env, node, element, AXIS2_FALSE);
+            return rp_security_context_token_builder_build(env, node, element, ns, AXIS2_FALSE);
         }
         else if(!axutil_strcmp(localname, RP_SECURE_CONVERSATION_TOKEN))
         {
-            return rp_security_context_token_builder_build(env, node, element, AXIS2_TRUE);
+            return rp_security_context_token_builder_build(env, node, element, ns, AXIS2_TRUE);
         }
         else if(!axutil_strcmp(localname, RP_ENCRYPT_BEFORE_SIGNING))
         {
@@ -366,7 +366,18 @@
         {
             neethi_assertion_t *assertion = NULL;
             assertion = neethi_assertion_create(env);
-            neethi_assertion_set_value(assertion, env, NULL, ASSERTION_TYPE_REQUIRE_DERIVED_KEYS);
+            if(!axutil_strcmp(ns, RP_SP_NS_11))
+            {
+                /* derived key should be as defined in WS-SecConversation 1.0 */
+                neethi_assertion_set_value(
+                    assertion, env, NULL, ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC10);
+            }
+            else
+            {
+                /* derived key should be as defined in WS-SecConversation 1.3 */
+                neethi_assertion_set_value(
+                    assertion, env, NULL, ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC13);
+            }
             return assertion;
         }
         else if(!axutil_strcmp(localname, RP_REQUIRE_EXTERNAL_URI_REFERENCE))
@@ -384,6 +395,14 @@
                 ASSERTION_TYPE_SC10_SECURITY_CONTEXT_TOKEN);
             return assertion;
         }
+        else if(!axutil_strcmp(localname, RP_SC13_SECURITY_CONTEXT_TOKEN))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL, 
+                ASSERTION_TYPE_SC13_SECURITY_CONTEXT_TOKEN);
+            return assertion;
+        }
         else if(!axutil_strcmp(localname, RP_ISSUER))
         {
             neethi_assertion_t *assertion = NULL;

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c Wed Aug 20 05:59:34 2008
@@ -28,7 +28,7 @@
 	neethi_all_t *all= NULL;
 	axutil_array_list_t *alternatives= NULL;
 	neethi_operator_t *component= NULL;
-	axis2_char_t *inclusoin_value= NULL;
+	axis2_char_t *inclusion_value= NULL;
 	axutil_qname_t *qname= NULL;
 	axiom_node_t *issuer_node= NULL;
 	axiom_element_t *issuer_ele= NULL;
@@ -42,15 +42,22 @@
 
 	issued_token = rp_issued_token_create(env);
 	qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS_11, RP_SP_PREFIX);
-
-	inclusoin_value = axiom_element_get_attribute_value(element, env, qname);
-
+	inclusion_value = axiom_element_get_attribute_value(element, env, qname);
 	axutil_qname_free(qname, env);
 	qname = NULL;
 
-	if (inclusoin_value) 
+    if(!inclusion_value)
+    {
+        /* we can try whether WS-SP1.2 specific inclusion value */
+        qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS_12, RP_SP_PREFIX);
+        inclusion_value = axiom_element_get_attribute_value(element, env, qname);
+        axutil_qname_free(qname, env);
+        qname = NULL;
+    }
+
+	if (inclusion_value) 
 	{
-		rp_issued_token_set_inclusion(issued_token, env, inclusoin_value);
+		rp_issued_token_set_inclusion(issued_token, env, inclusion_value);
 	}
 
 	qname = axutil_qname_create(env, RP_ISSUER, RP_SP_NS_11, RP_SP_PREFIX);
@@ -147,7 +154,7 @@
 				env);
 		type = neethi_assertion_get_type(assertion, env);
 
-		if (type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS) 
+		if (type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC10) 
 		{
 			rp_issued_token_set_derivedkeys(issued_token, env, AXIS2_TRUE);
 		} 

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/saml_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/saml_token_builder.c?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/saml_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/saml_token_builder.c Wed Aug 20 05:59:34 2008
@@ -42,12 +42,19 @@
     
     saml_token = rp_saml_token_create(env);
     qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS_11, RP_SP_PREFIX);
-
     inclusion_value = axiom_element_get_attribute_value(element, env, qname);
-
     axutil_qname_free(qname, env);
     qname = NULL;
 
+    if(!inclusion_value)
+    {
+        /* we can try whether WS-SP1.2 specific inclusion value */
+        qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS_12, RP_SP_PREFIX);
+        inclusion_value = axiom_element_get_attribute_value(element, env, qname);
+        axutil_qname_free(qname, env);
+        qname = NULL;
+    }
+
     rp_saml_token_set_inclusion(saml_token, env, inclusion_value);
     
     child_node = axiom_node_get_first_element(node, env);
@@ -122,7 +129,7 @@
             (neethi_assertion_t *) neethi_operator_get_value(operator, env);
         type = neethi_assertion_get_type(assertion, env);
         
-        if(type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS)
+        if(type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC10)
         {
             rp_saml_token_set_derivedkeys(saml_token, env, AXIS2_TRUE);
         }

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/security_context_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/security_context_token_builder.c?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/security_context_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/security_context_token_builder.c Wed Aug 20 05:59:34 2008
@@ -36,6 +36,7 @@
     const axutil_env_t *env,
     axiom_node_t *node,
     axiom_element_t *element,
+    axis2_char_t *sp_ns_uri,
     axis2_bool_t is_secure_conversation_token)
 {
     rp_security_context_token_t *security_context_token = NULL;
@@ -52,15 +53,25 @@
     neethi_policy_t *normalized_policy = NULL;
 
     security_context_token = rp_security_context_token_create(env);
-    qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS_11, RP_SP_PREFIX);
-
+    qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, sp_ns_uri, RP_SP_PREFIX);
     inclusion_value = axiom_element_get_attribute_value(element, env, qname);
-
     axutil_qname_free(qname, env);
     qname = NULL;
 
     rp_security_context_token_set_inclusion(security_context_token, env, inclusion_value);
-    rp_security_context_token_set_is_secure_conversation_token(security_context_token, env, is_secure_conversation_token);
+    rp_security_context_token_set_is_secure_conversation_token(
+        security_context_token, env, is_secure_conversation_token);
+
+    if(!axutil_strcmp(sp_ns_uri, RP_SP_NS_11))
+    {
+        rp_security_context_token_set_sc10_security_context_token(
+            security_context_token, env, AXIS2_TRUE);
+    }
+    else
+    {
+        rp_security_context_token_set_sc10_security_context_token(
+            security_context_token, env, AXIS2_FALSE);
+    }
 
     child_node = axiom_node_get_first_element(node, env);
     if (!child_node)
@@ -89,7 +100,7 @@
                             axis2_char_t *ns = NULL;
                             axutil_qname_t *node_qname = NULL;
 
-                            node_qname = axiom_element_get_qname(element, env, node);
+                            node_qname = axiom_element_get_qname(child_element, env, child_node);
                             if(!node_qname)
                             {
                                 AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
@@ -177,10 +188,17 @@
             (neethi_assertion_t *) neethi_operator_get_value(operator, env);
         type = neethi_assertion_get_type(assertion, env);
 
-        if(type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS)
+        if(type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC10)
         {
-            rp_security_context_token_set_derivedkeys(security_context_token, env, 
-                                         AXIS2_TRUE);
+            rp_security_context_token_set_derivedkey(security_context_token, env, DERIVEKEY_NEEDED);
+            rp_security_context_token_set_derivedkey_version(
+                security_context_token, env, DERIVEKEY_VERSION_SC10);
+        }   
+        else if(type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC13)
+        {
+            rp_security_context_token_set_derivedkey(security_context_token, env, DERIVEKEY_NEEDED);
+            rp_security_context_token_set_derivedkey_version(
+                security_context_token, env, DERIVEKEY_VERSION_SC13);
         }    
         else if(type == ASSERTION_TYPE_REQUIRE_EXTERNAL_URI)
         {
@@ -192,6 +210,11 @@
             rp_security_context_token_set_sc10_security_context_token(security_context_token, env,
                                                      AXIS2_TRUE);
         }
+        else if(type == ASSERTION_TYPE_SC13_SECURITY_CONTEXT_TOKEN)
+        {
+            rp_security_context_token_set_sc10_security_context_token(security_context_token, env,
+                                                     AXIS2_FALSE);
+        }
         else if(type == ASSERTION_TYPE_ISSUER)
         {
             axis2_char_t *issuer = NULL;

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/x509_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/x509_token_builder.c?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/x509_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/x509_token_builder.c Wed Aug 20 05:59:34 2008
@@ -51,12 +51,19 @@
 
     x509_token = rp_x509_token_create(env);
     qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS_11, RP_SP_PREFIX);
-
     inclusion_value = axiom_element_get_attribute_value(element, env, qname);
-
     axutil_qname_free(qname, env);
     qname = NULL;
 
+    if(!inclusion_value)
+    {
+        /* we can try whether WS-SP1.2 specific inclusion value */
+        qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS_12, RP_SP_PREFIX);
+        inclusion_value = axiom_element_get_attribute_value(element, env, qname);
+        axutil_qname_free(qname, env);
+        qname = NULL;
+    }
+
     rp_x509_token_set_inclusion(x509_token, env, inclusion_value);
 
     child_node = axiom_node_get_first_element(node, env);
@@ -129,11 +136,16 @@
             (neethi_assertion_t *) neethi_operator_get_value(operator, env);
         type = neethi_assertion_get_type(assertion, env);
 
-        if(type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS)
+        if(type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC10)
+        {
+            rp_x509_token_set_derivedkey(x509_token, env, DERIVEKEY_NEEDED);
+            rp_x509_token_set_derivedkey_version(x509_token, env, DERIVEKEY_VERSION_SC10);
+        }  
+        else if(type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS_SC13)
         {
-            rp_x509_token_set_derivedkeys(x509_token, env, 
-                                         AXIS2_TRUE);
-        }    
+            rp_x509_token_set_derivedkey(x509_token, env, DERIVEKEY_NEEDED);
+            rp_x509_token_set_derivedkey_version(x509_token, env, DERIVEKEY_VERSION_SC13);
+        }
         else if (type == ASSERTION_TYPE_REQUIRE_KEY_IDENTIFIRE_REFERENCE)
         {
             rp_x509_token_set_require_key_identifier_reference(x509_token, env,

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/model/security_context_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/security_context_token.c?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/security_context_token.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/security_context_token.c Wed Aug 20 05:59:34 2008
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -20,11 +19,9 @@
 
 struct rp_security_context_token_t
 {
-    axis2_char_t *inclusion;
-    axis2_bool_t derivedkeys;
+    rp_token_t *token;
     axis2_bool_t require_external_uri_ref;
     axis2_bool_t sc10_security_context_token;
-    axis2_char_t *issuer;
     neethi_policy_t *bootstrap_policy;
     axis2_bool_t is_secure_conversation_token;
     int ref;
@@ -36,29 +33,34 @@
 {
     rp_security_context_token_t *security_context_token = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
-
-    security_context_token =
-        (rp_security_context_token_t *) AXIS2_MALLOC(env->allocator,
-                                                     sizeof
-                                                     (rp_security_context_token_t));
+    security_context_token = (rp_security_context_token_t *) 
+        AXIS2_MALLOC(env->allocator, sizeof(rp_security_context_token_t));
 
-    if (security_context_token == NULL)
+    if(!security_context_token)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "[neethi] Security context token assertion creation failed. Insufficient memory");
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    security_context_token->inclusion = RP_INCLUDE_ALWAYS;
-    security_context_token->derivedkeys = AXIS2_FALSE;
+
+    security_context_token->ref = 0;
     security_context_token->require_external_uri_ref = AXIS2_FALSE;
     security_context_token->sc10_security_context_token = AXIS2_FALSE;
     security_context_token->bootstrap_policy = NULL;
-    security_context_token->issuer = NULL;
     security_context_token->is_secure_conversation_token = AXIS2_FALSE;
-    security_context_token->ref = 0;
 
-    return security_context_token;
+    security_context_token->token = rp_token_create(env);
+    if(!security_context_token->token)
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "[neethi] Security context token assertion creation failed.");
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        rp_security_context_token_free(security_context_token, env);
+        return NULL;
+    }
 
+    return security_context_token;
 }
 
 AXIS2_EXTERN void AXIS2_CALL
@@ -66,8 +68,6 @@
     rp_security_context_token_t * security_context_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
     if (security_context_token)
     {
         if (--(security_context_token->ref) > 0)
@@ -80,10 +80,10 @@
             neethi_policy_free(security_context_token->bootstrap_policy, env);
         }
 
+        rp_token_free(security_context_token->token, env);
         AXIS2_FREE(env->allocator, security_context_token);
         security_context_token = NULL;
     }
-    return;
 }
 
 /* Implementations */
@@ -93,9 +93,7 @@
     rp_security_context_token_t * security_context_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
-    return security_context_token->inclusion;
+    return rp_token_get_inclusion(security_context_token->token, env);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -104,34 +102,41 @@
     const axutil_env_t * env,
     axis2_char_t * inclusion)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, inclusion, AXIS2_FAILURE);
-
-    security_context_token->inclusion = inclusion;
-    return AXIS2_SUCCESS;
+    return rp_token_set_inclusion(security_context_token->token, env, inclusion);
 }
 
-AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-rp_security_context_token_get_derivedkeys(
+AXIS2_EXTERN derive_key_type_t AXIS2_CALL
+rp_security_context_token_get_derivedkey(
     rp_security_context_token_t * security_context_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
-    return security_context_token->derivedkeys;
+    return rp_token_get_derivedkey_type(security_context_token->token, env);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-rp_security_context_token_set_derivedkeys(
+rp_security_context_token_set_derivedkey(
     rp_security_context_token_t * security_context_token,
     const axutil_env_t * env,
-    axis2_bool_t derivedkeys)
+    derive_key_type_t derivedkey)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, derivedkeys, AXIS2_FAILURE);
+    return rp_token_set_derivedkey_type(security_context_token->token, env, derivedkey);
+}
 
-    security_context_token->derivedkeys = derivedkeys;
-    return AXIS2_SUCCESS;
+AXIS2_EXTERN derive_key_version_t AXIS2_CALL
+rp_security_context_token_get_derivedkey_version(
+    rp_security_context_token_t *security_context_token,
+    const axutil_env_t *env)
+{
+    return rp_token_get_derive_key_version(security_context_token->token, env);
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_security_context_token_set_derivedkey_version(
+    rp_security_context_token_t *security_context_token,
+    const axutil_env_t *env,
+    derive_key_version_t version)
+{
+    return rp_token_set_derive_key_version(security_context_token->token, env, version);
 }
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
@@ -139,8 +144,6 @@
     rp_security_context_token_t * security_context_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
     return security_context_token->require_external_uri_ref;
 }
 
@@ -150,11 +153,7 @@
     const axutil_env_t * env,
     axis2_bool_t require_external_uri_ref)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, require_external_uri_ref, AXIS2_FAILURE);
-
     security_context_token->require_external_uri_ref = require_external_uri_ref;
-
     return AXIS2_SUCCESS;
 }
 
@@ -163,9 +162,7 @@
     rp_security_context_token_t * security_context_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
-    return security_context_token->require_external_uri_ref;
+    return security_context_token->sc10_security_context_token;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -174,22 +171,16 @@
     const axutil_env_t * env,
     axis2_bool_t sc10_security_context_token)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, sc10_security_context_token, AXIS2_FAILURE);
-
-    security_context_token->sc10_security_context_token =
-        sc10_security_context_token;
-
+    security_context_token->sc10_security_context_token = sc10_security_context_token;
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN axis2_char_t *AXIS2_CALL
 rp_security_context_token_get_issuer(
-         rp_security_context_token_t *security_context_token, 
-         const axutil_env_t *env)
+     rp_security_context_token_t *security_context_token, 
+     const axutil_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    return security_context_token->issuer;
+    return rp_token_get_issuer(security_context_token->token, env);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -198,19 +189,14 @@
     const axutil_env_t * env,
     axis2_char_t *issuer)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, issuer, AXIS2_FAILURE);
-
-    security_context_token->issuer = issuer;
-    return AXIS2_SUCCESS;
+    return rp_token_set_issuer(security_context_token->token, env, issuer);
 }
 
 AXIS2_EXTERN neethi_policy_t *AXIS2_CALL
 rp_security_context_token_get_bootstrap_policy(
-         rp_security_context_token_t *security_context_token, 
-         const axutil_env_t *env)
+     rp_security_context_token_t *security_context_token, 
+     const axutil_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     return security_context_token->bootstrap_policy;
 }
 
@@ -220,19 +206,15 @@
     const axutil_env_t * env,
     neethi_policy_t *bootstrap_policy)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, bootstrap_policy, AXIS2_FAILURE);
-
     security_context_token->bootstrap_policy = bootstrap_policy;
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
 rp_security_context_token_get_is_secure_conversation_token(
-         rp_security_context_token_t *security_context_token, 
-         const axutil_env_t *env)
+     rp_security_context_token_t *security_context_token, 
+     const axutil_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     return security_context_token->is_secure_conversation_token;
 }
 
@@ -242,8 +224,6 @@
     const axutil_env_t * env,
     axis2_bool_t is_secure_conversation_token)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-  
     security_context_token->is_secure_conversation_token = is_secure_conversation_token;
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/model/token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/token.c?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/token.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/token.c Wed Aug 20 05:59:34 2008
@@ -21,9 +21,11 @@
 struct rp_token_t
 {
     axis2_char_t *issuer;
-    axis2_bool_t is_issuer_name; /* shows whether 'issuer' points to issuer name or end point */
+    axis2_char_t *inclusion;
     axiom_node_t *claim;
+    axis2_bool_t is_issuer_name; /* shows whether 'issuer' points to issuer name or end point */
     derive_key_type_t derive_key;
+    derive_key_version_t derive_key_version;
     int ref;
 };
 
@@ -41,10 +43,12 @@
             "[neethi] Token creation failed. Insufficient memory");
         return NULL;
     }
-    token->issuer = RP_INCLUDE_ALWAYS;
+    token->issuer = NULL;
     token->is_issuer_name = AXIS2_FALSE;
     token->claim = NULL;
     token->derive_key = DERIVEKEY_NONE;
+    token->derive_key_version = DERIVEKEY_VERSION_SC13;
+    token->inclusion = RP_INCLUDE_ALWAYS_SP12;
     token->ref = 0;
 
     return token;
@@ -87,6 +91,42 @@
     return AXIS2_SUCCESS;
 }
 
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_token_set_derive_key_version(
+    rp_token_t *token, 
+    const axutil_env_t *env, 
+    derive_key_version_t version)
+{
+    token->derive_key_version = version;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN derive_key_version_t AXIS2_CALL
+rp_token_get_derive_key_version(
+    rp_token_t *token, 
+    const axutil_env_t *env)
+{
+    return token->derive_key_version;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_token_set_inclusion(
+    rp_token_t *token, 
+    const axutil_env_t *env, 
+    axis2_char_t *inclusion)
+{
+    token->inclusion = inclusion;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_token_get_inclusion(
+    rp_token_t *token, 
+    const axutil_env_t *env)
+{
+    return token->inclusion;
+}
+
 AXIS2_EXTERN derive_key_type_t AXIS2_CALL
 rp_token_get_derivedkey_type(
     rp_token_t * token,

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/model/x509_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/x509_token.c?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/x509_token.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/x509_token.c Wed Aug 20 05:59:34 2008
@@ -20,8 +20,7 @@
 
 struct rp_x509_token_t
 {
-    axis2_char_t *inclusion;
-    axis2_bool_t derivedkeys;
+    rp_token_t *token;
     axis2_bool_t require_key_identifier_reference;
     axis2_bool_t require_issuer_serial_reference;
     axis2_bool_t require_embedded_token_reference;
@@ -36,25 +35,29 @@
     const axutil_env_t * env)
 {
     rp_x509_token_t *x509_token = NULL;
+    x509_token = (rp_x509_token_t *) AXIS2_MALLOC(env->allocator, sizeof(rp_x509_token_t));
 
-    AXIS2_ENV_CHECK(env, NULL);
-
-    x509_token = (rp_x509_token_t *) AXIS2_MALLOC(env->allocator,
-                                                  sizeof(rp_x509_token_t));
-
-    if (x509_token == NULL)
+    if (!x509_token)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "[neethi] X509 token assertion creation failed. Insufficient memory");
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    x509_token->inclusion = RP_INCLUDE_ALWAYS;
-    x509_token->derivedkeys = AXIS2_FALSE;
     x509_token->require_key_identifier_reference = AXIS2_FALSE;
     x509_token->require_issuer_serial_reference = AXIS2_FALSE;
     x509_token->require_embedded_token_reference = AXIS2_FALSE;
     x509_token->require_thumb_print_reference = AXIS2_FALSE;
     x509_token->token_version_and_type = RP_WSS_X509_V3_TOKEN_10;
     x509_token->ref = 0;
+
+    x509_token->token = rp_token_create(env);
+    if(!x509_token->token)
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[neethi] X509 token assertion creation failed.");
+        rp_x509_token_free(x509_token, env);
+        return NULL;
+    }
     return x509_token;
 }
 
@@ -63,18 +66,17 @@
     rp_x509_token_t * x509_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
     if (x509_token)
     {
         if (--(x509_token->ref) > 0)
         {
             return;
         }
+
+        rp_token_free(x509_token->token, env);
         AXIS2_FREE(env->allocator, x509_token);
         x509_token = NULL;
     }
-    return;
 }
 
 /* Implementations */
@@ -84,9 +86,7 @@
     rp_x509_token_t * x509_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, NULL);
-
-    return x509_token->inclusion;
+    return rp_token_get_inclusion(x509_token->token, env);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -95,35 +95,41 @@
     const axutil_env_t * env,
     axis2_char_t * inclusion)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, inclusion, AXIS2_FAILURE);
-
-    x509_token->inclusion = inclusion;
-
-    return AXIS2_SUCCESS;
+    return rp_token_set_inclusion(x509_token->token, env, inclusion);
 }
 
-AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-rp_x509_token_get_derivedkeys(
+AXIS2_EXTERN derive_key_type_t AXIS2_CALL
+rp_x509_token_get_derivedkey(
     rp_x509_token_t * x509_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
-
-    return x509_token->derivedkeys;
+    return rp_token_get_derivedkey_type(x509_token->token, env);
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-rp_x509_token_set_derivedkeys(
+rp_x509_token_set_derivedkey(
     rp_x509_token_t * x509_token,
     const axutil_env_t * env,
-    axis2_bool_t derivedkeys)
+    derive_key_type_t derivedkeys)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, derivedkeys, AXIS2_FALSE);
-    x509_token->derivedkeys = derivedkeys;
+    return rp_token_set_derivedkey_type(x509_token->token, env, derivedkeys);
+}
 
-    return AXIS2_SUCCESS;
+AXIS2_EXTERN derive_key_version_t AXIS2_CALL
+rp_x509_token_get_derivedkey_version(
+    rp_x509_token_t *x509_token,
+    const axutil_env_t *env)
+{
+    return rp_token_get_derive_key_version(x509_token->token, env);
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_x509_token_set_derivedkey_version(
+    rp_x509_token_t *x509_token,
+    const axutil_env_t *env,
+    derive_key_version_t version)
+{
+    return rp_token_set_derive_key_version(x509_token->token, env, version);
 }
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
@@ -131,8 +137,6 @@
     rp_x509_token_t * x509_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
-
     return x509_token->require_key_identifier_reference;
 }
 
@@ -142,14 +146,8 @@
     const axutil_env_t * env,
     axis2_bool_t require_key_identifier_reference)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, require_key_identifier_reference,
-                      AXIS2_FAILURE);
-    x509_token->require_key_identifier_reference =
-        require_key_identifier_reference;
-
+    x509_token->require_key_identifier_reference = require_key_identifier_reference;
     return AXIS2_SUCCESS;
-
 }
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
@@ -157,8 +155,6 @@
     rp_x509_token_t * x509_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
-
     return x509_token->require_issuer_serial_reference;
 }
 
@@ -168,14 +164,8 @@
     const axutil_env_t * env,
     axis2_bool_t require_issuer_serial_reference)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, require_issuer_serial_reference,
-                      AXIS2_FAILURE);
-    x509_token->require_issuer_serial_reference =
-        require_issuer_serial_reference;
-
+    x509_token->require_issuer_serial_reference = require_issuer_serial_reference;
     return AXIS2_SUCCESS;
-
 }
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
@@ -183,8 +173,6 @@
     rp_x509_token_t * x509_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
-
     return x509_token->require_embedded_token_reference;
 }
 
@@ -194,12 +182,7 @@
     const axutil_env_t * env,
     axis2_bool_t require_embedded_token_reference)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, require_embedded_token_reference,
-                      AXIS2_FAILURE);
-    x509_token->require_embedded_token_reference =
-        require_embedded_token_reference;
-
+    x509_token->require_embedded_token_reference = require_embedded_token_reference;
     return AXIS2_SUCCESS;
 }
 
@@ -208,8 +191,6 @@
     rp_x509_token_t * x509_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
-
     return x509_token->require_thumb_print_reference;
 }
 
@@ -219,10 +200,7 @@
     const axutil_env_t * env,
     axis2_bool_t require_thumb_print_reference)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, require_thumb_print_reference, AXIS2_FAILURE);
     x509_token->require_thumb_print_reference = require_thumb_print_reference;
-
     return AXIS2_SUCCESS;
 }
 
@@ -231,8 +209,6 @@
     rp_x509_token_t * x509_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, NULL);
-
     return x509_token->token_version_and_type;
 }
 
@@ -242,9 +218,6 @@
     const axutil_env_t * env,
     axis2_char_t * token_version_and_type)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, token_version_and_type, AXIS2_FAILURE);
-
     x509_token->token_version_and_type = token_version_and_type;
     return AXIS2_SUCCESS;
 }
@@ -254,7 +227,6 @@
     rp_x509_token_t * x509_token,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     x509_token->ref++;
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/src/core/deployment/module_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/deployment/module_builder.c?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/deployment/module_builder.c (original)
+++ webservices/axis2/trunk/c/src/core/deployment/module_builder.c Wed Aug 20 05:59:34 2008
@@ -483,14 +483,18 @@
 
         /* processing <wsp:Policy> .. </..> elements */
 
-        qpolicy =
-            axutil_qname_create(env, NEETHI_POLICY, NEETHI_NAMESPACE, NULL);
-        itr =
-            axiom_element_get_children_with_qname(op_element, env, qpolicy,
-                                                  op_node);
+        qpolicy = axutil_qname_create(env, NEETHI_POLICY, NEETHI_NAMESPACE, NULL);
+        itr = axiom_element_get_children_with_qname(op_element, env, qpolicy, op_node);
         axutil_qname_free(qpolicy, env);
         qpolicy = NULL;
 
+        if(!axiom_children_qname_iterator_has_next(itr, env))
+        {
+            qpolicy = axutil_qname_create(env, NEETHI_POLICY, NEETHI_POLICY_15_NAMESPACE, NULL);
+            itr = axiom_element_get_children_with_qname(op_element, env, qpolicy, op_node);
+            axutil_qname_free(qpolicy, env);
+            qpolicy = NULL;
+        }
         if (itr)
         {
             axis2_process_policy_elements(env, AXIS2_MODULE_OPERATION_POLICY, itr,
@@ -498,14 +502,19 @@
         }
 
         /* processing <wsp:PolicyReference> .. </..> elements */
-        qpolicy =
-            axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_NAMESPACE, NULL);
-        itr =
-            axiom_element_get_children_with_qname(op_element, env, qpolicy,
-                                                  op_node);
+        qpolicy = axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_NAMESPACE, NULL);
+        itr = axiom_element_get_children_with_qname(op_element, env, qpolicy, op_node);
         axutil_qname_free(qpolicy, env);
         qpolicy = NULL;
 
+        if(!axiom_children_qname_iterator_has_next(itr, env))
+        {
+            qpolicy = axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_POLICY_15_NAMESPACE, NULL);
+            itr = axiom_element_get_children_with_qname(op_element, env, qpolicy, op_node);
+            axutil_qname_free(qpolicy, env);
+            qpolicy = NULL;
+        }
+
         if (itr)
         {
             axis2_process_policy_reference_elements(env, AXIS2_POLICY_REF, itr,

Modified: webservices/axis2/trunk/c/src/core/deployment/svc_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/deployment/svc_builder.c?rev=687306&r1=687305&r2=687306&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/deployment/svc_builder.c (original)
+++ webservices/axis2/trunk/c/src/core/deployment/svc_builder.c Wed Aug 20 05:59:34 2008
@@ -465,10 +465,16 @@
        processing <wsp:Policy> .. </..> elements
      */
     qpolicy = axutil_qname_create(env, NEETHI_POLICY, NEETHI_NAMESPACE, NULL);
-    itr = axiom_element_get_children_with_qname(svc_element, env,
-                                                qpolicy, svc_node);
+    itr = axiom_element_get_children_with_qname(svc_element, env, qpolicy, svc_node);
     axutil_qname_free(qpolicy, env);
     qpolicy = NULL;
+    if(!axiom_children_qname_iterator_has_next(itr, env))
+    {
+        qpolicy = axutil_qname_create(env, NEETHI_POLICY, NEETHI_POLICY_15_NAMESPACE, NULL);
+        itr = axiom_element_get_children_with_qname(svc_element, env, qpolicy, svc_node);
+        axutil_qname_free(qpolicy, env);
+        qpolicy = NULL;
+    }
 
     if (itr)
     {
@@ -477,14 +483,18 @@
     }
 
     /* processing <wsp:PolicyReference> .. </..> elements */
-    qpolicy =
-        axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_NAMESPACE, NULL);
-    itr =
-        axiom_element_get_children_with_qname(svc_element, env, qpolicy,
-                                              svc_node);
+    qpolicy = axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_NAMESPACE, NULL);
+    itr = axiom_element_get_children_with_qname(svc_element, env, qpolicy, svc_node);
     axutil_qname_free(qpolicy, env);
     qpolicy = NULL;
 
+    if(!axiom_children_qname_iterator_has_next(itr, env))
+    {
+        qpolicy = axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_POLICY_15_NAMESPACE, NULL);
+        itr = axiom_element_get_children_with_qname(svc_element, env, qpolicy, svc_node);
+        axutil_qname_free(qpolicy, env);
+        qpolicy = NULL;
+    }
     if (itr)
     {
         axis2_process_policy_reference_elements(env, AXIS2_POLICY_REF, itr,
@@ -638,14 +648,19 @@
 
         /* processing <wsp:Policy> .. </..> elements */
 
-        qpolicy =
-            axutil_qname_create(env, NEETHI_POLICY, NEETHI_NAMESPACE, NULL);
-        itr =
-            axiom_element_get_children_with_qname(op_element, env, qpolicy,
-                                                  op_node);
+        qpolicy = axutil_qname_create(env, NEETHI_POLICY, NEETHI_NAMESPACE, NULL);
+        itr = axiom_element_get_children_with_qname(op_element, env, qpolicy, op_node);
         axutil_qname_free(qpolicy, env);
         qpolicy = NULL;
 
+        if(!axiom_children_qname_iterator_has_next(itr, env))
+        {
+            qpolicy = axutil_qname_create(env, NEETHI_POLICY, NEETHI_POLICY_15_NAMESPACE, NULL);
+            itr = axiom_element_get_children_with_qname(op_element, env, qpolicy, op_node);
+            axutil_qname_free(qpolicy, env);
+            qpolicy = NULL;
+        }
+
         if (itr)
         {
             axis2_process_policy_elements(env, AXIS2_SERVICE_POLICY, itr,
@@ -653,14 +668,19 @@
         }
 
         /* processing <wsp:PolicyReference> .. </..> elements */
-        qpolicy =
-            axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_NAMESPACE, NULL);
-        itr =
-            axiom_element_get_children_with_qname(op_element, env, qpolicy,
-                                                  op_node);
+        qpolicy = axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_NAMESPACE, NULL);
+        itr = axiom_element_get_children_with_qname(op_element, env, qpolicy, op_node);
         axutil_qname_free(qpolicy, env);
         qpolicy = NULL;
 
+        if(!axiom_children_qname_iterator_has_next(itr, env))
+        {
+            qpolicy = axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_POLICY_15_NAMESPACE, NULL);
+            itr = axiom_element_get_children_with_qname(op_element, env, qpolicy, op_node);
+            axutil_qname_free(qpolicy, env);
+            qpolicy = NULL;        
+        }
+
         if (itr)
         {
             axis2_process_policy_reference_elements(env, AXIS2_POLICY_REF, itr,
@@ -752,13 +772,18 @@
 
             /* processing <wsp:Policy> .. </..> elements */
 
-            qpolicy =
-                axutil_qname_create(env, NEETHI_POLICY, NEETHI_NAMESPACE, NULL);
-            itr =
-                axiom_element_get_children_with_qname(element, env, qpolicy,
-                                                      node);
+            qpolicy = axutil_qname_create(env, NEETHI_POLICY, NEETHI_NAMESPACE, NULL);
+            itr = axiom_element_get_children_with_qname(element, env, qpolicy, node);
             axutil_qname_free(qpolicy, env);
             qpolicy = NULL;
+            
+            if(!axiom_children_qname_iterator_has_next(itr, env))
+            {
+                qpolicy = axutil_qname_create(env, NEETHI_POLICY, NEETHI_POLICY_15_NAMESPACE, NULL);
+                itr = axiom_element_get_children_with_qname(element, env, qpolicy, node);
+                axutil_qname_free(qpolicy, env);
+                qpolicy = NULL;
+            }
 
             if (itr)
             {
@@ -770,15 +795,19 @@
             }
 
             /* processing <wsp:PolicyReference> .. </..> elements */
-            qpolicy =
-                axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_NAMESPACE,
-                                    NULL);
-            itr =
-                axiom_element_get_children_with_qname(element, env, qpolicy,
-                                                      node);
+            qpolicy = axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_NAMESPACE, NULL);
+            itr = axiom_element_get_children_with_qname(element, env, qpolicy,node);
             axutil_qname_free(qpolicy, env);
             qpolicy = NULL;
 
+            if(!axiom_children_qname_iterator_has_next(itr, env))
+            {
+                qpolicy = axutil_qname_create(env, NEETHI_REFERENCE, NEETHI_POLICY_15_NAMESPACE, NULL);
+                itr = axiom_element_get_children_with_qname(element, env, qpolicy,node);
+                axutil_qname_free(qpolicy, env);
+                qpolicy = NULL;
+            }
+
             if (itr)
             {
                 axis2_process_policy_reference_elements(env, AXIS2_POLICY_REF,



Mime
View raw message