ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manj...@apache.org
Subject svn commit: r583385 - in /webservices/axis2/trunk/c/neethi: include/ src/ src/secpolicy/builder/ src/secpolicy/model/
Date Wed, 10 Oct 2007 08:12:26 GMT
Author: manjula
Date: Wed Oct 10 01:12:25 2007
New Revision: 583385

URL: http://svn.apache.org/viewvc?rev=583385&view=rev
Log:
This commit includes processing of wss11 assertions, trust10 assertions and
processing derived keys.

Added:
    webservices/axis2/trunk/c/neethi/include/rp_trust10.h
    webservices/axis2/trunk/c/neethi/include/rp_trust10_builder.h
    webservices/axis2/trunk/c/neethi/include/rp_wss11_builder.h
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/trust10_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/wss11_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/model/trust10.c
Modified:
    webservices/axis2/trunk/c/neethi/include/neethi_assertion.h
    webservices/axis2/trunk/c/neethi/include/rp_builders.h
    webservices/axis2/trunk/c/neethi/include/rp_defines.h
    webservices/axis2/trunk/c/neethi/src/assertion.c
    webservices/axis2/trunk/c/neethi/src/assertion_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/Makefile.am
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/x509_token_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/model/Makefile.am

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=583385&r1=583384&r2=583385&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/neethi_assertion.h (original)
+++ webservices/axis2/trunk/c/neethi/include/neethi_assertion.h Wed Oct 10 01:12:25 2007
@@ -53,6 +53,7 @@
         ASSERTION_TYPE_MUST_SUPPORT_REF_EMBEDDED_TOKEN,
         ASSERTION_TYPE_WSS10,
         ASSERTION_TYPE_WSS11,
+        ASSERTION_TYPE_TRUST10,
         ASSERTION_TYPE_RAMPART_CONFIG,
         ASSERTION_TYPE_ASSYMMETRIC_BINDING,
         ASSERTION_TYPE_SYMMETRIC_BINDING,
@@ -76,6 +77,12 @@
         ASSERTION_TYPE_WSS_X509_V1_TOKEN_10,
         ASSERTION_TYPE_WSS_X509_V3_TOKEN_10,
         ASSERTION_TYPE_SIGNED_ENCRYPTED_PARTS,
+        ASSERTION_TYPE_REQUIRE_DERIVED_KEYS,
+        ASSERTION_TYPE_MUST_SUPPORT_CLIENT_CHALLENGE,
+        ASSERTION_TYPE_MUST_SUPPORT_SERVER_CHALLENGE,
+        ASSERTION_TYPE_REQUIRE_CLIENT_ENTROPY,
+        ASSERTION_TYPE_REQUIRE_SERVER_ENTROPHY,
+        ASSERTION_TYPE_MUST_SUPPORT_ISSUED_TOKENS,
         ASSERTION_TYPE_UNKNOWN
     } neethi_assertion_type_t;
 

Modified: webservices/axis2/trunk/c/neethi/include/rp_builders.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_builders.h?rev=583385&r1=583384&r2=583385&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_builders.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_builders.h Wed Oct 10 01:12:25 2007
@@ -28,6 +28,8 @@
 #include <rp_transport_token_builder.h>
 #include <rp_username_token_builder.h>
 #include <rp_wss10_builder.h>
+#include <rp_wss11_builder.h>
+#include <rp_trust10_builder.h>
 #include <rp_qname_matcher.h>
 #include <rp_https_token_builder.h>
 #include <rp_x509_token_builder.h>

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=583385&r1=583384&r2=583385&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_defines.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_defines.h Wed Oct 10 01:12:25 2007
@@ -58,14 +58,20 @@
 
 #define RP_WSS10 "Wss10"
 #define RP_WSS11 "Wss11"
+#define RP_TRUST10 "Trust10"
 
 #define RP_MUST_SUPPORT_REF_KEY_IDENTIFIER "MustSupportRefKeyIdentifier"
 #define RP_MUST_SUPPORT_REF_ISSUER_SERIAL "MustSupportRefIssuerSerial"
 #define RP_MUST_SUPPORT_REF_EXTERNAL_URI "MustSupportRefExternalURI"
 #define RP_MUST_SUPPORT_REF_EMBEDDED_TOKEN "MustSupportRefEmbeddedToken"
 #define RP_MUST_SUPPORT_REF_THUMBPRINT "MustSupportRefThumbprint"
-#define RP_MUST_SUPPORT_REF_ENCRYPTED_KEY "MustSupportRefEncryptedkey"
+#define RP_MUST_SUPPORT_REF_ENCRYPTED_KEY "MustSupportRefEncryptedKey"
 #define RP_REQUIRE_SIGNATURE_CONFIRMATION "RequireSignatureConfirmation"
+#define RP_MUST_SUPPORT_CLIENT_CHALLENGE "MustSupportClientChallenge"
+#define RP_MUST_SUPPORT_SERVER_CHALLENGE "MustSupportServerChallenge"    
+#define RP_REQUIRE_CLIENT_ENTROPY "RequireClientEntropy"
+#define RP_REQUIRE_SERVER_ENTROPHY "RequireServerEntropy"    
+#define RP_MUST_SUPPORT_ISSUED_TOKENS "MustSupportIssuedTokens"    
 
 #define RP_PROTECTION_TOKEN "ProtectionToken"
 #define RP_ENCRYPTION_TOKEN "EncryptionToken"

Added: webservices/axis2/trunk/c/neethi/include/rp_trust10.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_trust10.h?rev=583385&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_trust10.h (added)
+++ webservices/axis2/trunk/c/neethi/include/rp_trust10.h Wed Oct 10 01:12:25 2007
@@ -0,0 +1,108 @@
+
+/*
+ * 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
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef RP_TRUST10_H
+#define RP_TRUST10_H
+
+/** @defgroup trust10
+ * @ingroup trust10
+ * @{
+ */
+
+#include <rp_includes.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+    typedef struct rp_trust10_t rp_trust10_t;
+
+    AXIS2_EXTERN rp_trust10_t *AXIS2_CALL
+    rp_trust10_create(
+        const axutil_env_t * env);
+
+    AXIS2_EXTERN void AXIS2_CALL
+    rp_trust10_free(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env);
+
+    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+        rp_trust10_get_must_support_client_challenge(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env);
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+        rp_trust10_set_must_support_client_challenge(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env,
+        axis2_bool_t must_support_client_challenge);
+
+    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+    rp_trust10_get_must_support_server_challenge(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env);
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_trust10_set_must_support_server_challenge(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env,
+        axis2_bool_t must_support_server_challenge);
+
+    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+    rp_trust10_get_require_client_entropy(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env);
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_trust10_set_require_client_entropy(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env,
+        axis2_bool_t require_client_entropy);
+
+    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+    rp_trust10_get_require_server_entropy(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env);
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_trust10_set_require_server_entropy(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env,
+        axis2_bool_t require_server_entropy);
+
+    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+    rp_trust10_get_must_support_issued_token(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env);
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_trust10_set_must_support_issued_token(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env,
+        axis2_bool_t must_support_issued_token);
+
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_trust10_increment_ref(
+        rp_trust10_t * trust10,
+        const axutil_env_t * env);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

Added: webservices/axis2/trunk/c/neethi/include/rp_trust10_builder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_trust10_builder.h?rev=583385&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_trust10_builder.h (added)
+++ webservices/axis2/trunk/c/neethi/include/rp_trust10_builder.h Wed Oct 10 01:12:25 2007
@@ -0,0 +1,45 @@
+
+/*
+ * 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
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef RP_TRUST10_BUILDER_H
+#define RP_TRUST10_BUILDER_H
+
+/** @defgroup rp_trust10_builder
+ * @ingroup rp_trust10_builder
+ * @{
+ */
+
+#include <rp_includes.h>
+#include <rp_trust10.h>
+#include <neethi_includes.h>
+#include <neethi_assertion.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+    AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+    rp_trust10_builder_build(
+        const axutil_env_t * env,
+        axiom_node_t * node,
+        axiom_element_t * element);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

Added: webservices/axis2/trunk/c/neethi/include/rp_wss11_builder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_wss11_builder.h?rev=583385&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_wss11_builder.h (added)
+++ webservices/axis2/trunk/c/neethi/include/rp_wss11_builder.h Wed Oct 10 01:12:25 2007
@@ -0,0 +1,45 @@
+
+/*
+ * 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
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef RP_WSS11_BUILDER_H
+#define RP_WSS11_BUILDER_H
+
+/** @defgroup rp_wss11_builder
+ * @ingroup rp_wss11_builder
+ * @{
+ */
+
+#include <rp_includes.h>
+#include <rp_wss11.h>
+#include <neethi_includes.h>
+#include <neethi_assertion.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+    AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+    rp_wss11_builder_build(
+        const axutil_env_t * env,
+        axiom_node_t * node,
+        axiom_element_t * element);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

Modified: webservices/axis2/trunk/c/neethi/src/assertion.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/assertion.c?rev=583385&r1=583384&r2=583385&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/assertion.c (original)
+++ webservices/axis2/trunk/c/neethi/src/assertion.c Wed Oct 10 01:12:25 2007
@@ -22,6 +22,8 @@
 #include <rp_layout.h>
 #include <rp_algorithmsuite.h>
 #include <rp_wss10.h>
+#include <rp_wss11.h>
+#include <rp_trust10.h>
 #include <rp_supporting_tokens.h>
 #include <rp_username_token.h>
 #include <rp_asymmetric_binding.h>
@@ -143,6 +145,14 @@
     if (type == ASSERTION_TYPE_WSS10)
     {
         rp_wss10_increment_ref((rp_wss10_t *) value, env);
+    }
+    if (type == ASSERTION_TYPE_WSS11)
+    {
+        rp_wss11_increment_ref((rp_wss11_t *) value, env); 
+    }
+    if (type == ASSERTION_TYPE_TRUST10)
+    {
+        rp_trust10_increment_ref((rp_trust10_t *) value, env); 
     }
     if (type == ASSERTION_TYPE_SUPPORTING_TOKENS)
     {

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=583385&r1=583384&r2=583385&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/assertion_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/assertion_builder.c Wed Oct 10 01:12:25 2007
@@ -342,6 +342,25 @@
         else
             return NULL;
     }
+    else if (axutil_strcmp(localname, RP_WSS11) == 0)
+    {
+        if (rp_match_secpolicy_qname(env, RP_WSS11, node, element))
+        {
+            return rp_wss11_builder_build(env, node, element);
+        }
+        else
+            return NULL;
+    }
+    else if (axutil_strcmp(localname, RP_TRUST10) == 0)
+    {
+        if (rp_match_secpolicy_qname(env, RP_TRUST10, node, element))
+        {
+            return rp_trust10_builder_build(env, node, element);
+        }
+        else
+            return NULL;
+    }
+    
     else if (axutil_strcmp(localname, RP_INCLUDE_TIMESTAMP) == 0)
     {
         if (rp_match_secpolicy_qname(env, RP_INCLUDE_TIMESTAMP, node, element))
@@ -476,6 +495,139 @@
         else
             return NULL;
     }
+    else if (axutil_strcmp(localname, RP_MUST_SUPPORT_REF_THUMBPRINT) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_MUST_SUPPORT_REF_THUMBPRINT, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                       ASSERTION_TYPE_MUST_SUPPORT_REF_THUMBPRINT);
+            return assertion;
+        }
+        else
+            return NULL;
+    }    
+    else if (axutil_strcmp(localname, RP_MUST_SUPPORT_REF_ENCRYPTED_KEY) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_MUST_SUPPORT_REF_ENCRYPTED_KEY, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                       ASSERTION_TYPE_MUST_SUPPORT_REF_ENCRYPTED_KEY);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+    else if (axutil_strcmp(localname, RP_REQUIRE_SIGNATURE_CONFIRMATION) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_REQUIRE_SIGNATURE_CONFIRMATION, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                      ASSERTION_TYPE_REQUIRE_SIGNATURE_CONFIRMATION);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+
+    else if (axutil_strcmp(localname, RP_MUST_SUPPORT_CLIENT_CHALLENGE) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_MUST_SUPPORT_CLIENT_CHALLENGE, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                      ASSERTION_TYPE_MUST_SUPPORT_CLIENT_CHALLENGE);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+
+    else if (axutil_strcmp(localname, RP_MUST_SUPPORT_SERVER_CHALLENGE) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_MUST_SUPPORT_SERVER_CHALLENGE, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                      ASSERTION_TYPE_MUST_SUPPORT_SERVER_CHALLENGE);
+            return assertion;
+        }
+        else
+            return NULL;
+    }        
+
+    else if (axutil_strcmp(localname, RP_REQUIRE_CLIENT_ENTROPY) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_REQUIRE_CLIENT_ENTROPY, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                      ASSERTION_TYPE_REQUIRE_CLIENT_ENTROPY);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+
+    else if (axutil_strcmp(localname, RP_REQUIRE_SERVER_ENTROPHY) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_REQUIRE_SERVER_ENTROPHY, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                      ASSERTION_TYPE_REQUIRE_SERVER_ENTROPHY);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+
+    else if (axutil_strcmp(localname, RP_MUST_SUPPORT_ISSUED_TOKENS) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_MUST_SUPPORT_ISSUED_TOKENS, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                      ASSERTION_TYPE_MUST_SUPPORT_ISSUED_TOKENS);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+
+    else if (axutil_strcmp(localname, RP_REQUIRE_DERIVED_KEYS) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_REQUIRE_DERIVED_KEYS, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                       ASSERTION_TYPE_REQUIRE_DERIVED_KEYS);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+
     else
     {
         AXIS2_ERROR_SET(env->error,

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/Makefile.am?rev=583385&r1=583384&r2=583385&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/Makefile.am (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/Makefile.am Wed Oct 10 01:12:25
2007
@@ -11,7 +11,7 @@
 						   asymmetric_binding_builder.c x509_token_builder.c initiator_token_builder.c \
 						   recipient_token_builder.c signed_encrypted_parts_builder.c secpolicy_builder.c \
 						   symmetric_binding_builder.c protection_token_builder.c signature_token_builder.c
\
-						   encryption_token_builder.c
+						   encryption_token_builder.c wss11_builder.c trust10_builder.c
 
 librp_builder_la_LIBADD  = ../../../../axiom/src/om/libaxis2_axiom.la \
 				../../../../util/src/libaxutil.la

Added: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/trust10_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/trust10_builder.c?rev=583385&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/trust10_builder.c (added)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/trust10_builder.c Wed Oct 10 01:12:25
2007
@@ -0,0 +1,148 @@
+
+/*
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <rp_trust10_builder.h>
+#include <neethi_operator.h>
+#include <neethi_policy.h>
+#include <neethi_exactlyone.h>
+#include <neethi_all.h>
+#include <neethi_engine.h>
+
+/*private functions*/
+
+axis2_status_t AXIS2_CALL trust10_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_trust10_t * trust10);
+
+/***********************************/
+
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+rp_trust10_builder_build(
+    const axutil_env_t * env,
+    axiom_node_t * node,
+    axiom_element_t * element)
+{
+    rp_trust10_t *trust10 = NULL;
+    neethi_policy_t *policy = NULL;
+    axiom_node_t *child_node = NULL;
+    axiom_element_t *child_element = NULL;
+    axutil_array_list_t *alternatives = NULL;
+    neethi_operator_t *component = NULL;
+    neethi_all_t *all = NULL;
+    neethi_assertion_t *assertion = NULL;
+    neethi_policy_t *normalized_policy = NULL;
+
+    trust10 = rp_trust10_create(env);
+
+    child_node = axiom_node_get_first_element(node, env);
+    if (!child_node)
+    {
+        return NULL;
+    }
+
+    if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+    {
+        child_element =
+            (axiom_element_t *) axiom_node_get_data_element(child_node, env);
+        if (child_element)
+        {
+            policy = neethi_engine_get_policy(env, child_node, child_element);
+            if (!policy)
+            {
+                return NULL;
+            }
+            normalized_policy =
+                neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+            neethi_policy_free(policy, env);
+            policy = NULL;
+            alternatives =
+                neethi_policy_get_alternatives(normalized_policy, env);
+            component =
+                (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+                                                            0);
+            all = (neethi_all_t *) neethi_operator_get_value(component, env);
+            trust10_process_alternatives(env, all, trust10);
+
+            assertion =
+                neethi_assertion_create_with_args(env, (void *) rp_trust10_free,
+                                                  trust10, ASSERTION_TYPE_TRUST10);
+
+            neethi_policy_free(normalized_policy, env);
+            normalized_policy = NULL;
+
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+    else
+        return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+trust10_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_trust10_t * trust10)
+{
+    neethi_operator_t *operator = NULL;
+    axutil_array_list_t *arraylist = NULL;
+    neethi_assertion_t *assertion = NULL;
+    neethi_assertion_type_t type;
+    void *value = NULL;
+
+    int i = 0;
+
+    arraylist = neethi_all_get_policy_components(all, env);
+
+    for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
+    {
+        operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+                                                              i);
+        assertion =
+            (neethi_assertion_t *) neethi_operator_get_value(operator, env);
+        value = neethi_assertion_get_value(assertion, env);
+        type = neethi_assertion_get_type(assertion, env);
+
+        if (type == ASSERTION_TYPE_MUST_SUPPORT_CLIENT_CHALLENGE)
+        {
+            rp_trust10_set_must_support_client_challenge(trust10, env, AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_MUST_SUPPORT_SERVER_CHALLENGE)
+        {
+            rp_trust10_set_must_support_server_challenge(trust10, env, AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_REQUIRE_CLIENT_ENTROPY)
+        {
+            rp_trust10_set_require_client_entropy(trust10, env, AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_REQUIRE_SERVER_ENTROPHY)
+        {
+            rp_trust10_set_require_server_entropy(trust10, env,
+                                                         AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_MUST_SUPPORT_ISSUED_TOKENS)
+        {
+            rp_trust10_set_must_support_issued_token(trust10, env, AXIS2_TRUE);
+        }    
+        else
+            return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}

Added: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/wss11_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/wss11_builder.c?rev=583385&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/wss11_builder.c (added)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/wss11_builder.c Wed Oct 10 01:12:25
2007
@@ -0,0 +1,158 @@
+
+/*
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <rp_wss11_builder.h>
+#include <neethi_operator.h>
+#include <neethi_policy.h>
+#include <neethi_exactlyone.h>
+#include <neethi_all.h>
+#include <neethi_engine.h>
+
+/*private functions*/
+
+axis2_status_t AXIS2_CALL wss11_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_wss11_t * wss11);
+
+/***********************************/
+
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+rp_wss11_builder_build(
+    const axutil_env_t * env,
+    axiom_node_t * node,
+    axiom_element_t * element)
+{
+    rp_wss11_t *wss11 = NULL;
+    neethi_policy_t *policy = NULL;
+    axiom_node_t *child_node = NULL;
+    axiom_element_t *child_element = NULL;
+    axutil_array_list_t *alternatives = NULL;
+    neethi_operator_t *component = NULL;
+    neethi_all_t *all = NULL;
+    neethi_assertion_t *assertion = NULL;
+    neethi_policy_t *normalized_policy = NULL;
+
+    wss11 = rp_wss11_create(env);
+
+    child_node = axiom_node_get_first_element(node, env);
+    if (!child_node)
+    {
+        return NULL;
+    }
+
+    if (axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+    {
+        child_element =
+            (axiom_element_t *) axiom_node_get_data_element(child_node, env);
+        if (child_element)
+        {
+            policy = neethi_engine_get_policy(env, child_node, child_element);
+            if (!policy)
+            {
+                return NULL;
+            }
+            normalized_policy =
+                neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+            neethi_policy_free(policy, env);
+            policy = NULL;
+            alternatives =
+                neethi_policy_get_alternatives(normalized_policy, env);
+            component =
+                (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+                                                            0);
+            all = (neethi_all_t *) neethi_operator_get_value(component, env);
+            wss11_process_alternatives(env, all, wss11);
+
+            assertion =
+                neethi_assertion_create_with_args(env, (void *) rp_wss11_free,
+                                                  wss11, ASSERTION_TYPE_WSS11);
+
+            neethi_policy_free(normalized_policy, env);
+            normalized_policy = NULL;
+
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+    else
+        return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+wss11_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_wss11_t * wss11)
+{
+    neethi_operator_t *operator = NULL;
+    axutil_array_list_t *arraylist = NULL;
+    neethi_assertion_t *assertion = NULL;
+    neethi_assertion_type_t type;
+    void *value = NULL;
+
+    int i = 0;
+
+    arraylist = neethi_all_get_policy_components(all, env);
+
+    for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
+    {
+        operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
+                                                              i);
+        assertion =
+            (neethi_assertion_t *) neethi_operator_get_value(operator, env);
+        value = neethi_assertion_get_value(assertion, env);
+        type = neethi_assertion_get_type(assertion, env);
+
+        if (type == ASSERTION_TYPE_MUST_SUPPORT_REF_KEY_IDENTIFIER)
+        {
+            rp_wss11_set_must_support_ref_key_identifier(wss11, env,
+                                                         AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_MUST_SUPPORT_REF_ISSUER_SERIAL)
+        {
+            rp_wss11_set_must_support_ref_issuer_serial(wss11, env, AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_MUST_SUPPORT_REF_EXTERNAL_URI)
+        {
+            rp_wss11_set_must_support_ref_external_uri(wss11, env, AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_MUST_SUPPORT_REF_EMBEDDED_TOKEN)
+        {
+            rp_wss11_set_must_support_ref_embedded_token(wss11, env,
+                                                         AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_MUST_SUPPORT_REF_THUMBPRINT)
+        {
+            rp_wss11_set_must_support_must_support_ref_thumbprint(wss11, env, AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_MUST_SUPPORT_REF_ENCRYPTED_KEY)
+        {
+            rp_wss11_set_must_support_ref_encryptedkey(wss11, env, AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_REQUIRE_SIGNATURE_CONFIRMATION)
+        {
+            rp_wss11_set_require_signature_confirmation(wss11, env,
+                                                         AXIS2_TRUE);
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}

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=583385&r1=583384&r2=583385&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 Oct 10
01:12:25 2007
@@ -131,6 +131,12 @@
             (neethi_assertion_t *) neethi_operator_get_value(operator, env);
         type = neethi_assertion_get_type(assertion, env);
 
+        if(type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS)
+        {
+            rp_x509_token_set_derivedkeys(x509_token, env, 
+                                         AXIS2_TRUE);
+        }    
+
         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/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/Makefile.am?rev=583385&r1=583384&r2=583385&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/Makefile.am (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/Makefile.am Wed Oct 10 01:12:25 2007
@@ -7,7 +7,8 @@
 							property.c rampart_config.c secpolicy.c security_context_token.c \
 							signed_encrypted_elements.c signed_encrypted_parts.c signed_encrypted_items.c \
 							supporting_tokens.c symmetric_asymmetric_binding_commons.c \
-							symmetric_binding.c transport_binding.c ut.c wss10.c wss11.c x509_token.c
+							symmetric_binding.c transport_binding.c ut.c wss10.c wss11.c x509_token.c \
+							trust10.c
 
 
 librp_model_la_LIBADD  = ../../../../util/src/libaxutil.la

Added: webservices/axis2/trunk/c/neethi/src/secpolicy/model/trust10.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/trust10.c?rev=583385&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/trust10.c (added)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/trust10.c Wed Oct 10 01:12:25 2007
@@ -0,0 +1,205 @@
+
+/*
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <rp_trust10.h>
+
+struct rp_trust10_t
+{
+    axis2_bool_t must_support_client_challenge;
+    axis2_bool_t must_support_server_challenge;
+    axis2_bool_t require_client_entropy;
+    axis2_bool_t require_server_entropy;
+    axis2_bool_t must_support_issued_token;
+    int ref;
+};
+
+AXIS2_EXTERN rp_trust10_t *AXIS2_CALL
+rp_trust10_create(
+    const axutil_env_t * env)
+{
+    rp_trust10_t *trust10 = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    trust10 = (rp_trust10_t *) AXIS2_MALLOC(env->allocator, sizeof(rp_trust10_t));
+
+    if (trust10 == NULL)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    trust10->must_support_client_challenge = AXIS2_FALSE;
+    trust10->must_support_server_challenge = AXIS2_FALSE;
+    trust10->require_client_entropy = AXIS2_FALSE;
+    trust10->require_server_entropy = AXIS2_FALSE;
+    trust10->must_support_issued_token = AXIS2_FALSE;
+    trust10->ref = 0;
+
+    return trust10;
+
+}
+
+AXIS2_EXTERN void AXIS2_CALL
+rp_trust10_free(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    if (trust10)
+    {
+        if (--(trust10->ref) > 0)
+        {
+            return;
+        }
+
+        AXIS2_FREE(env->allocator, trust10);
+        trust10 = NULL;
+    }
+    return;
+}
+
+/* Implementations */
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_trust10_get_must_support_client_challenge(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+    return trust10->must_support_client_challenge;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_trust10_set_must_support_client_challenge(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env,
+    axis2_bool_t must_support_client_challenge)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, must_support_client_challenge,
+                      AXIS2_FAILURE);
+    trust10->must_support_client_challenge = must_support_client_challenge;
+
+    return AXIS2_SUCCESS;
+
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_trust10_get_must_support_server_challenge(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+    return trust10->must_support_server_challenge;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_trust10_set_must_support_server_challenge(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env,
+    axis2_bool_t must_support_server_challenge)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, must_support_server_challenge,
+                      AXIS2_FAILURE);
+    trust10->must_support_server_challenge = must_support_server_challenge;
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_trust10_get_require_client_entropy(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+    return trust10->require_client_entropy;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_trust10_set_require_client_entropy(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env,
+    axis2_bool_t require_client_entropy)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, require_client_entropy, AXIS2_FAILURE);
+    trust10->require_client_entropy = require_client_entropy;
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_trust10_get_require_server_entropy(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+    return trust10->require_server_entropy;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_trust10_set_require_server_entropy(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env,
+    axis2_bool_t require_server_entropy)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, require_server_entropy, AXIS2_FAILURE);
+    trust10->require_server_entropy = require_server_entropy;
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_trust10_get_must_support_issued_token(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+
+    return trust10->must_support_issued_token;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_trust10_set_must_support_issued_token(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env,
+    axis2_bool_t must_support_issued_token)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, must_support_issued_token, AXIS2_FAILURE);
+    trust10->must_support_issued_token = must_support_issued_token;
+
+    return AXIS2_SUCCESS;
+}
+
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_trust10_increment_ref(
+    rp_trust10_t * trust10,
+    const axutil_env_t * env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    trust10->ref++;
+    return AXIS2_SUCCESS;
+}



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


Mime
View raw message