You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by sh...@apache.org on 2008/10/13 06:41:52 UTC

svn commit: r703913 [1/3] - in /webservices/rampart/trunk/c: ides/Rampart/Rampart/ include/ samples/sct_provider/ src/omxmlsec/ src/secconv/ src/trust/ src/util/

Author: shankar
Date: Sun Oct 12 21:41:51 2008
New Revision: 703913

URL: http://svn.apache.org/viewvc?rev=703913&view=rev
Log:
code cleanup, fixing error messages, adding comments. 

Modified:
    webservices/rampart/trunk/c/ides/Rampart/Rampart/Rampart.vcproj
    webservices/rampart/trunk/c/include/oxs_axiom.h
    webservices/rampart/trunk/c/include/oxs_xml_key_processor.h
    webservices/rampart/trunk/c/include/rampart_authn_provider.h
    webservices/rampart/trunk/c/include/rampart_config.h
    webservices/rampart/trunk/c/include/rampart_constants.h
    webservices/rampart/trunk/c/include/rampart_context.h
    webservices/rampart/trunk/c/include/rampart_crypto_util.h
    webservices/rampart/trunk/c/include/rampart_handler_util.h
    webservices/rampart/trunk/c/include/rampart_policy_validator.h
    webservices/rampart/trunk/c/include/rampart_replay_detector.h
    webservices/rampart/trunk/c/include/rampart_sec_processed_result.h
    webservices/rampart/trunk/c/include/rampart_token_builder.h
    webservices/rampart/trunk/c/include/rampart_token_processor.h
    webservices/rampart/trunk/c/include/rampart_username_token.h
    webservices/rampart/trunk/c/include/rampart_util.h
    webservices/rampart/trunk/c/samples/sct_provider/sct_provider_hash_map.c
    webservices/rampart/trunk/c/samples/sct_provider/sct_provider_stored_key.c
    webservices/rampart/trunk/c/src/omxmlsec/axiom.c
    webservices/rampart/trunk/c/src/omxmlsec/transforms_factory.c
    webservices/rampart/trunk/c/src/omxmlsec/xml_key_processor.c
    webservices/rampart/trunk/c/src/omxmlsec/xml_signature.c
    webservices/rampart/trunk/c/src/secconv/security_context_token.c
    webservices/rampart/trunk/c/src/trust/sts_client.c
    webservices/rampart/trunk/c/src/util/rampart_config.c
    webservices/rampart/trunk/c/src/util/rampart_context.c
    webservices/rampart/trunk/c/src/util/rampart_crypto_util.c
    webservices/rampart/trunk/c/src/util/rampart_encryption.c
    webservices/rampart/trunk/c/src/util/rampart_handler_util.c
    webservices/rampart/trunk/c/src/util/rampart_policy_validator.c
    webservices/rampart/trunk/c/src/util/rampart_replay_detector.c
    webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c
    webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c
    webservices/rampart/trunk/c/src/util/rampart_sec_processed_result.c
    webservices/rampart/trunk/c/src/util/rampart_signature.c
    webservices/rampart/trunk/c/src/util/rampart_token_builder.c
    webservices/rampart/trunk/c/src/util/rampart_token_processor.c
    webservices/rampart/trunk/c/src/util/rampart_username_token.c
    webservices/rampart/trunk/c/src/util/rampart_util.c

Modified: webservices/rampart/trunk/c/ides/Rampart/Rampart/Rampart.vcproj
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/ides/Rampart/Rampart/Rampart.vcproj?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/ides/Rampart/Rampart/Rampart.vcproj (original)
+++ webservices/rampart/trunk/c/ides/Rampart/Rampart/Rampart.vcproj Sun Oct 12 21:41:51 2008
@@ -92,7 +92,7 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-				CommandLine="if not exist $(SolutionDir)deploy\lib\ mkdir $(SolutionDir)deploy\lib&#x0D;&#x0A;copy $(SolutionDir)deploy\modules\rampart\mod_rampart.* $(SolutionDir)deploy\lib\&#x0D;&#x0A;copy ..\..\..\src\data\module.xml $(SolutionDir)deploy\modules\rampart\"
+				CommandLine="if not exist $(SolutionDir)deploy\lib\ mkdir $(SolutionDir)deploy\lib&#x0D;&#x0A;copy $(SolutionDir)deploy\modules\rampart\mod_rampart.* $(SolutionDir)deploy\lib\&#x0D;&#x0A;copy ..\..\..\src\data\module.xml $(SolutionDir)deploy\modules\rampart\&#x0D;&#x0A;"
 			/>
 		</Configuration>
 		<Configuration

Modified: webservices/rampart/trunk/c/include/oxs_axiom.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/oxs_axiom.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/oxs_axiom.h (original)
+++ webservices/rampart/trunk/c/include/oxs_axiom.h Sun Oct 12 21:41:51 2008
@@ -18,7 +18,6 @@
 #ifndef OXS_AXIOM_H
 #define OXS_AXIOM_H
 
-
 /**
   * @file oxs_axiom.h
   * @brief Utility functions related to AXIOM. A place for common code.
@@ -28,9 +27,6 @@
 #include <axutil_env.h>
 #include <axis2_util.h>
 #include <axiom_node.h>
-#include <axiom_util.h>
-#include <axiom_document.h>
-#include <axiom.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -52,14 +48,16 @@
      * @return  AXIS2_SUCCESS on success, else AXIS2_FAILURE
      */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    oxs_axiom_add_attribute(const axutil_env_t *env,
-                            axiom_node_t* node,
-                            axis2_char_t* attribute_ns,
-                            axis2_char_t* attribute_ns_uri,
-                            axis2_char_t* attribute,
-                            axis2_char_t* value);
+    oxs_axiom_add_attribute(
+        const axutil_env_t *env,
+        axiom_node_t* node,
+        axis2_char_t* attribute_ns,
+        axis2_char_t* attribute_ns_uri,
+        axis2_char_t* attribute,
+        axis2_char_t* value);
+
     /**
-     * Adds an attribute to a particular node
+     * Finds the number of childern with given qname
      * @param env Environment. MUST NOT be NULL,
      * @param parent the root element defining start of the search
      * @param localname the local part of the qname
@@ -67,96 +65,155 @@
      * @param prefix the prefix part of the qname
      * @return the number of children found
      */
-
     AXIS2_EXTERN int AXIS2_CALL
-    oxs_axiom_get_number_of_children_with_qname(const axutil_env_t *env,
-            axiom_node_t* parent,
-            axis2_char_t* local_name,
-            axis2_char_t* ns_uri,
-            axis2_char_t* prefix);
+    oxs_axiom_get_number_of_children_with_qname(
+        const axutil_env_t *env,
+        axiom_node_t* parent,
+        axis2_char_t* local_name,
+        axis2_char_t* ns_uri,
+        axis2_char_t* prefix);
 
     /**
-     * Traverse thru the node and its children. Check if the localname is equal to the given name
+     * Traverse thru the node and its descendents. Check if the localname is equal to the given name
      * @param env Environment. MUST NOT be NULL,
      * @param node the node to be searched
      * @param localname the local name of the node to be searched
      * @return the node if found, else NULL
      */
-
     AXIS2_EXTERN axiom_node_t* AXIS2_CALL
-    oxs_axiom_get_node_by_local_name(const axutil_env_t *env,
-                                     axiom_node_t *node,
-                                     axis2_char_t *local_name);
+    oxs_axiom_get_node_by_local_name(
+        const axutil_env_t *env,
+        axiom_node_t *node,
+        axis2_char_t *local_name);
+
     /**
-     * Traverse thru the node and its children. Check if the node has a particular id as in @attr
+     * Traverse thru the node and its descendents. Check if the node has a particular attibure 
+     * value, whose attribute name as in @attr and value as in @val
      * @param env Environment. MUST NOT be NULL,
      * @param node the node to be searched
      * @param attr the attribute name of the node
      * @param val the attribute value of the node
+     * @param ns namespace of the attribute
      * @return the node if found, else NULL
      */
-
     AXIS2_EXTERN axiom_node_t* AXIS2_CALL
-    oxs_axiom_get_node_by_id(const axutil_env_t *env,
-                             axiom_node_t *node,
-                             axis2_char_t *attr,
-                             axis2_char_t *val,
-                             axis2_char_t *ns);
+    oxs_axiom_get_node_by_id(
+        const axutil_env_t *env,
+        axiom_node_t *node,
+        axis2_char_t *attr,
+        axis2_char_t *val,
+        axis2_char_t *ns);
 
     /**
-     * Traverse thru the node and its children. Check if the node has a particular id as in @attr
+     * Traverse thru the node and its descendents. Check if the node has a particular attribute with 
+     * name as in @attr and namespace as in @ns. Returns the attribute value.
      * @param env Environment. MUST NOT be NULL,
      * @param node the node to be searched
-     * @param attr the attribute name of the node
-     * @param val the attribute value of the node
-     * @return the node if found, else NULL
+     * @param attribute_name the attribute name of the node
+     * @param ns namespace of the attribute
+     * @return the attribute value if found, else NULL
      */
     AXIS2_EXTERN axis2_char_t* AXIS2_CALL
-    oxs_axiom_get_attribute_value_of_node_by_name(const axutil_env_t *env,
-            axiom_node_t *node,
-            axis2_char_t *attribute_name,
-            axis2_char_t *ns);
+    oxs_axiom_get_attribute_value_of_node_by_name(
+        const axutil_env_t *env,
+        axiom_node_t *node,
+        axis2_char_t *attribute_name,
+        axis2_char_t *ns);
 
+    /**
+     * Traverse thru the node and its descendents. Check if the node has a particular attribute with 
+     * qname as in @qname. Returns the attribute value.
+     * @param env Environment. MUST NOT be NULL,
+     * @param node the node to be searched
+     * @param qname the qname of the attribute
+     * @return the attribute value if found, else NULL
+     */
     AXIS2_EXTERN axis2_char_t* AXIS2_CALL
-    oxs_axiom_get_attribute_val_of_node_by_qname(const axutil_env_t *env,
-            axiom_node_t *node,
-            axutil_qname_t *qname);
+    oxs_axiom_get_attribute_val_of_node_by_qname(
+        const axutil_env_t *env,
+        axiom_node_t *node,
+        axutil_qname_t *qname);
 
     /**
+     * Check the node and its children. Check if the localname is equal to the given name
      * Note: You may pass the prefix=NULL as the prefix may be different depending on the impl
+     * @param env Environment. MUST NOT be NULL,
+     * @param parent the node to be searched
+     * @param local_name the local name of the node to be searched
+     * @ns_uri namespace uri of the node to be searched
+     * @prefix prefix of the node to be searched. If NULL, node with any prefix will be considered
+     * @return the node if found, else NULL
      */
     AXIS2_EXTERN axiom_node_t* AXIS2_CALL
-    oxs_axiom_get_first_child_node_by_name(const axutil_env_t *env,
-                                           axiom_node_t* parent,
-                                           axis2_char_t* local_name,
-                                           axis2_char_t* ns_uri,
-                                           axis2_char_t* prefix);
-    /*
+    oxs_axiom_get_first_child_node_by_name(
+        const axutil_env_t *env,
+        axiom_node_t* parent,
+        axis2_char_t* local_name,
+        axis2_char_t* ns_uri,
+        axis2_char_t* prefix);
+
+    /**
      * Returns content of a node
-     * 
+     * @param env Environment. MUST NOT be NULL,
+     * @param node the node whose content should be retrieved
+     * @return the content of the node if found, else NULL
      */
     AXIS2_EXTERN axis2_char_t* AXIS2_CALL
-    oxs_axiom_get_node_content(const axutil_env_t *env, axiom_node_t* node);
-
+    oxs_axiom_get_node_content(
+        const axutil_env_t *env, 
+        axiom_node_t* node);
 
-    AXIS2_EXTERN axiom_node_t *AXIS2_CALL
-    oxs_axiom_deserialize_node(const axutil_env_t *env,  axis2_char_t* buffer);
     /**
-    * returns 1 sucess 0 otherwise
-    */
-    AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    oxs_axiom_check_node_name(const axutil_env_t *env, axiom_node_t* node, axis2_char_t* name, axis2_char_t* ns);
+     * Deserialises given buffer and creates the axiom node 
+     * @param env Environment. Must not be NULL
+     * @param buffer representation of serialised node
+     * @return deserialised node if success. NULL otherwise.
+     */
+    AXIS2_EXTERN axiom_node_t *AXIS2_CALL
+    oxs_axiom_deserialize_node(
+        const axutil_env_t *env,  
+        axis2_char_t* buffer);
 
+    /**
+     * Checks whether given node is having same name and namespace as given
+     * @param env Environment. Must not be null
+     * @param node node to be checked for name and namespace
+     * @param name local name to be checked against given node
+     * @param ns namespace to be checked against given node. Can be null. If null, will be omitted
+     * @return AXIS2_TRUE if given name/ns is same as in the node. AXIS2_FALSE otherwise.
+     */
+    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+    oxs_axiom_check_node_name(
+        const axutil_env_t *env, 
+        axiom_node_t* node, 
+        axis2_char_t* name, 
+        axis2_char_t* ns);
 
+    /**
+     * moves the given node before second node.
+     * @param env Environment. Must not be null
+     * @param node_to_move node to be moved
+     * @param node_before node_to_move will be moved before this node
+     * @return status of the operation
+     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    oxs_axiom_interchange_nodes(const axutil_env_t *env,
-                          axiom_node_t *node_to_move,
-                          axiom_node_t *node_before); 
+    oxs_axiom_interchange_nodes(
+        const axutil_env_t *env,
+        axiom_node_t *node_to_move,
+        axiom_node_t *node_before); 
     
+    /**
+     * Adds @child as the first child of @parent
+     * @param env Environment. Must not be null
+     * @param parent parent node
+     * @param child child node which has to be the first child of parent
+     * @return status of the operation
+     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    oxs_axiom_add_as_the_first_child(const axutil_env_t *env,
-                          axiom_node_t *parent,
-                          axiom_node_t *child);
+    oxs_axiom_add_as_the_first_child(
+        const axutil_env_t *env,
+        axiom_node_t *parent,
+        axiom_node_t *child);
 
     /**
 	 * Traverse thru the node and its children. Check if the element has the 
@@ -172,13 +229,13 @@
      */
 	AXIS2_EXTERN axiom_node_t* AXIS2_CALL
 	oxs_axiom_get_first_node_by_name_and_attr_val(
-							 const axutil_env_t *env,
-							 axiom_node_t *node,
-							 axis2_char_t *e_name,
-							 axis2_char_t *e_ns,
-							 axis2_char_t *attr_name,
-							 axis2_char_t *attr_val,
-							 axis2_char_t *attr_ns);
+        const axutil_env_t *env,
+        axiom_node_t *node,
+        axis2_char_t *e_name,
+        axis2_char_t *e_ns,
+        axis2_char_t *attr_name,
+        axis2_char_t *attr_val,
+        axis2_char_t *attr_ns);
 
 	/**
 	 * First find the root of the scope node. Traverse thru the root node and its 
@@ -195,17 +252,24 @@
      */	 
 	AXIS2_EXTERN axiom_node_t * AXIS2_CALL
 	oxs_axiom_get_first_node_by_name_and_attr_val_from_xml_doc(
-							 const axutil_env_t *env,
-							 axiom_node_t *node,
-							 axis2_char_t *e_name,
-							 axis2_char_t *e_ns,
-							 axis2_char_t *attr_name,
-							 axis2_char_t *attr_val,
-							 axis2_char_t *attr_ns);
+        const axutil_env_t *env,
+        axiom_node_t *node,
+        axis2_char_t *e_name,
+        axis2_char_t *e_ns,
+        axis2_char_t *attr_name,
+        axis2_char_t *attr_val,
+        axis2_char_t *attr_ns);
 
+    /**
+     * Clones the given node. 
+     * @param env Environment. Must not be null
+     * @param node node to be cloned
+     * @return cloned node if success. NULL otherwise
+     */
     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
-    oxs_axiom_clone_node(const axutil_env_t *env,
-                             axiom_node_t *node);
+    oxs_axiom_clone_node(
+        const axutil_env_t *env,
+        axiom_node_t *node);
                           
     /** @} */
 #ifdef __cplusplus

Modified: webservices/rampart/trunk/c/include/oxs_xml_key_processor.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/oxs_xml_key_processor.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/oxs_xml_key_processor.h (original)
+++ webservices/rampart/trunk/c/include/oxs_xml_key_processor.h Sun Oct 12 21:41:51 2008
@@ -36,6 +36,7 @@
 #include <axiom_node.h>
 #include <axiom_element.h>
 #include <axutil_qname.h>
+#include <oxs_x509_cert.h>
 
 #ifdef __cplusplus
 extern "C"

Modified: webservices/rampart/trunk/c/include/rampart_authn_provider.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_authn_provider.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_authn_provider.h (original)
+++ webservices/rampart/trunk/c/include/rampart_authn_provider.h Sun Oct 12 21:41:51 2008
@@ -14,7 +14,6 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-#include <axutil_param.h>
 
 #ifndef RAMPART_AUTHN_PROVIDER_H
 #define RAMPART_AUTHN_PROVIDER_H
@@ -29,6 +28,7 @@
 * @{
 */
 
+#include <axutil_param.h>
 #include <axis2_defines.h>
 #include <axutil_error.h>
 #include <axutil_env.h>

Modified: webservices/rampart/trunk/c/include/rampart_config.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_config.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_config.h (original)
+++ webservices/rampart/trunk/c/include/rampart_config.h Sun Oct 12 21:41:51 2008
@@ -1,9 +1,10 @@
 /*
- * 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
  *
@@ -28,7 +29,14 @@
  * @{
  */
 
-#include <rp_includes.h>
+#include <axis2_util.h>
+#include <axis2_defines.h>
+/*#include <axutil_utils_defines.h>*/
+#include <axutil_env.h>
+#include <rampart_saml_token.h>
+#include <rampart_issued_token.h>
+
+/*#include <rp_includes.h>
 #include <rp_secpolicy.h>
 #include <rampart_authn_provider.h>
 #include <axutil_property.h>
@@ -39,8 +47,7 @@
 #include <axis2_msg_ctx.h>
 #include <oxs_key.h>
 #include <axutil_array_list.h>
-#include <rampart_saml_token.h>
-#include <rampart_issued_token.h>
+*/
 
 #ifdef __cplusplus
 extern "C"
@@ -49,187 +56,173 @@
 
     typedef struct rampart_config_t rampart_config_t;
 
-
     /**
-    * Create a rampart_config.rampart_config is the wrapper
-    * @param env pointer to environment struct,Must not be NULL.
-    * @return ramaprt_config_t* on successful creation. Else NULL; 
-    */
+     * Create a rampart_config which can be used to get rampart specific configurations from user
+     * @param env pointer to environment struct,Must not be NULL.
+     * @return ramaprt_config_t* on successful creation. Else NULL; 
+     */
     AXIS2_EXTERN rampart_config_t *AXIS2_CALL
-    rampart_config_create(const axutil_env_t *env);
-
+    rampart_config_create(
+        const axutil_env_t *env);
 
     /**
-    * Frees a rampart_config.
-    * @param rampart_config the rampart_config
-    * @param env pointer to environment struct,Must not be NULL.
-    */
-
+     * Frees a rampart_config.
+     * @param rampart_config the rampart_config
+     * @param env pointer to environment struct,Must not be NULL.
+     */
     AXIS2_EXTERN void AXIS2_CALL
-    rampart_config_free(rampart_config_t *rampart_config,
-                         const axutil_env_t *env);
-
-
-    /****************************************************************/
+    rampart_config_free(
+        rampart_config_t *rampart_config,
+        const axutil_env_t *env);
 
     /**
-     *
-     * @param rampart_config
+     * set username needed to build username token
+     * @param rampart_config rampart configuration structure
      * @param evn pointer to environment struct,Must not be NULL.
-     * @param user
-     * @returns status of the op.                                                                                                        
-     * AXIS2_SUCCESS on success and AXIS2_FAILURE on error          
+     * @param user name of the user
+     * @returns status of the op. AXIS2_SUCCESS on success and AXIS2_FAILURE on error          
      */
-
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_config_set_username(rampart_config_t *rampart_config,
-                             const axutil_env_t *env,
-                             axis2_char_t *user);
+    rampart_config_set_username(
+        rampart_config_t *rampart_config,
+        const axutil_env_t *env,
+        axis2_char_t *user);
 
     /**
-     *
-     * @param rampart_config
+     * set password of the user. Will be used to build UsernameToken
+     * @param rampart_config rampart configuration structure
      * @param evn pointer to environment struct,Must not be NULL.
-     * @param password
-     * @returns status of the op.                                                                                                        
-     * AXIS2_SUCCESS on success and AXIS2_FAILURE on error          
+     * @param password password of the user
+     * @returns status of the op.
      */
-
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_config_set_password(rampart_config_t *rampart_config,
-                                 const axutil_env_t *env,
-                                 axis2_char_t *password);
+    rampart_config_set_password(
+        rampart_config_t *rampart_config,
+        const axutil_env_t *env,
+        axis2_char_t *password);
 
     /**
-     *
-     * @param rampart_config
+     * set password type needed. Will be used to build UsernameToken
+     * @param rampart_config rampart configuration structure
      * @param evn pointer to environment struct,Must not be NULL.
-     * @param password_type
-     * @returns status of the op.                                                                                                        
-     * AXIS2_SUCCESS on success and AXIS2_FAILURE on error          
+     * @param password_type type of the password. (hash/plain)
+     * @returns status of the op.
      */
-
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_config_set_password_type(rampart_config_t *rampart_config,
-                                      const axutil_env_t *env,
-                                      axis2_char_t *password_type);
+    rampart_config_set_password_type(
+        rampart_config_t *rampart_config,
+        const axutil_env_t *env,
+        axis2_char_t *password_type);
 
     /**
-     *
-     * @param rampart_config
+     * sets time to live parameter needed by Timestamp element
+     * @param rampart_config rampart configuration structure
      * @param evn pointer to environment struct,Must not be NULL.
-     * @param ttl
-     * @returns status of the op.                                                                                                        
-     * AXIS2_SUCCESS on success and AXIS2_FAILURE on error          
+     * @param ttl time to live value in seconds
+     * @returns status of the op.
      */
-
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_config_set_ttl(rampart_config_t *rampart_config,
-                            const axutil_env_t *env,
-                            int ttl);
+    rampart_config_set_ttl(
+        rampart_config_t *rampart_config,
+        const axutil_env_t *env,
+        int ttl);
 
     /**
-     *
-     * @param rampart_config
-     * @param evn pointer to environment struct,Must not be NULL.
-     * @param user
-     * @returns status of the op.                                                                                                        
-     * AXIS2_SUCCESS on success and AXIS2_FAILURE on error          
+     * Sets saml token needed to build/process the message
+     * @param rampart_config rampart configuration structure
+     * @param evn pointer to environment struct,Must not b e NULL.
+     * @param saml SAML token used to build/process the message
+     * @returns status of the op.
      */
-
 	AXIS2_EXTERN int AXIS2_CALL
-	rampart_config_add_saml_token(rampart_config_t *rampart_config, 
-								  const axutil_env_t *env, 
-								  rampart_saml_token_t *saml);
+	rampart_config_add_saml_token(
+        rampart_config_t *rampart_config, 
+		const axutil_env_t *env, 
+		rampart_saml_token_t *saml);
 
     /**
-     *
-     * @param rampart_config
+     * sets function pointer used to aquire issued token
+     * @param rampart_config rampart configuration structure
      * @param evn pointer to environment struct,Must not be NULL.
-     * @param issued_token_aquire
-     * @returns status of the op.                                                                                                        
-     * AXIS2_SUCCESS on success and AXIS2_FAILURE on error          
+     * @param issued_token_aquire function pointer from which issued token will be obtained
+     * @returns status of the op.
      */
-
 	AXIS2_EXTERN axis2_status_t AXIS2_CALL
-	rampart_config_set_issued_token_aquire_function(rampart_config_t *rampart_config,
-								  const axutil_env_t *env,
-								  issued_token_callback_func issued_token_aquire);
+	rampart_config_set_issued_token_aquire_function(
+        rampart_config_t *rampart_config,
+		const axutil_env_t *env,
+		issued_token_callback_func issued_token_aquire);
+
     /**
-     * 
-     * @param rampart_config
+     * Gets stored username
+     * @param rampart_config rampart configuration structure
      * @param evn pointer to environment struct,Must not be NULL.
-     * returns
+     * returns username stored in rampart config
      */
-
     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
     rampart_config_get_username(
         rampart_config_t *rampart_config,
         const axutil_env_t *env);
+
     /**
-     * 
-     * @param rampart_config
+     * Gets stored password
+     * @param rampart_config rampart configuration structure
      * @param evn pointer to environment struct,Must not be NULL.
-     * returns
+     * returns password stored in rampart config
      */
-
     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
     rampart_config_get_password(
         rampart_config_t *rampart_config,
         const axutil_env_t *env);
+
     /**
-     * 
-     * @param rampart_config
+     * Gets stored password type
+     * @param rampart_config rampart configuration structure
      * @param evn pointer to environment struct,Must not be NULL.
-     * returns
+     * returns password type stored in rampart config
      */
-
     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
     rampart_config_get_password_type(
         rampart_config_t *rampart_config,
         const axutil_env_t *env);
+
     /**
-     * 
-     * @param rampart_config
+     * Gets stored time to live
+     * @param rampart_config rampart configuration structure
      * @param evn pointer to environment struct,Must not be NULL.
-     * returns
+     * returns time to live parameter stored in rampart config
      */
-    
     AXIS2_EXTERN int AXIS2_CALL
     rampart_config_get_ttl(
         rampart_config_t *rampart_config,
         const axutil_env_t *env);
+
     /**
-     * 
-     * @param rampart_config
+     * Gets stored SAML token
+     * @param rampart_config rampart configuration structure
      * @param evn pointer to environment struct,Must not be NULL.
-     * returns
+     * returns SAML token stored in rampart config
      */
-
 	AXIS2_EXTERN axutil_array_list_t * AXIS2_CALL
-	rampart_config_get_saml_tokens(rampart_config_t *rampart_config, 
-								  const axutil_env_t *env);    
+	rampart_config_get_saml_tokens(
+        rampart_config_t *rampart_config, 
+		const axutil_env_t *env);    
+
     /**
-     * 
-     * @param rampart_config
+     * Gets stored issued token aquire function pointer
+     * @param rampart_config rampart configuration structure
      * @param evn pointer to environment struct,Must not be NULL.
-     * returns
+     * returns issued token aquire function pointer stored in rampart config
      */
-
 	AXIS2_EXTERN issued_token_callback_func AXIS2_CALL
-	rampart_config_get_issued_token_aquire_function(rampart_config_t *rampart_config, 
-								  const axutil_env_t *env);    
-    /*End of Getters */
-
+	rampart_config_get_issued_token_aquire_function(
+        rampart_config_t *rampart_config, 
+		const axutil_env_t *env);    
 
+    /* @} */
 #ifdef __cplusplus
 }
 #endif
-#endif
-
-
-
-
-
 
+#endif /* RAMPART_CONFIG_H */
 

Modified: webservices/rampart/trunk/c/include/rampart_constants.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_constants.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_constants.h (original)
+++ webservices/rampart/trunk/c/include/rampart_constants.h Sun Oct 12 21:41:51 2008
@@ -122,6 +122,8 @@
 #define RAMPART_FAULT_MSG_REPLAYED             "rampc:Message-Replayed"
 #define RAMPART_FAULT_IN_POLICY                "rampc:Policy"
 
+#define RAMPART_FAULT_ELEMENT_LOCAL_NAME       "ProblemSecurityHeader"
+
 
     /*Dynamically set values*/
 #define RAMPART_ACTION_PASSWORD "password"
@@ -164,9 +166,14 @@
 #define RAMPART_SCT_ID_TYPE_LOCAL 1
 #define RAMPART_SCT_ID_TYPE_GLOBAL 2
 
+#define RAMPART_USERNAME_TOKEN_NONCE_LENGTH 24
+
 #define RAMPART_ENC_TOKEN_ID "EncryptionTokenID"
 #define RAMPART_SIG_TOKEN_ID "SignatureTokenID"
 
+#define RAMPART_BST_ID_PREFIX "BST-"
+#define RAMPART_EMBED_TOKEN_ID "ID"
+
 #ifdef __cplusplus
 }
 #endif

Modified: webservices/rampart/trunk/c/include/rampart_context.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_context.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_context.h (original)
+++ webservices/rampart/trunk/c/include/rampart_context.h Sun Oct 12 21:41:51 2008
@@ -1884,6 +1884,17 @@
         rampart_context_t *rampart_context,
         const axutil_env_t *env);
 
+    /**
+     * check whether different keys are needed for encryption and signature
+     * @param env pointer to environment struct
+     * @param rampart_context rampart context
+     * @return AXIS2_TRUE if different keys are needed. AXIS2_FALSE otherwise.
+     */
+    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+    is_different_session_key_for_encryption_and_signing(
+        const axutil_env_t *env,
+        rampart_context_t *rampart_context);
+
 
     
 #ifdef __cplusplus

Modified: webservices/rampart/trunk/c/include/rampart_crypto_util.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_crypto_util.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_crypto_util.h (original)
+++ webservices/rampart/trunk/c/include/rampart_crypto_util.h Sun Oct 12 21:41:51 2008
@@ -1,17 +1,18 @@
 /*
- *   Copyright 2003-2004 The Apache Software Foundation.
+ * 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
  *
- *   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
  *
- *       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.
+ * 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.
  */
 
 
@@ -37,17 +38,19 @@
 
 
     /**
-    * Calculate the hash of concatenated string of followings
-    * @param nonce
-    * @param created 
-    * @param password 
-    * @return calculated hash
+    * Calculate the hash of concatenated string of nonce+created+password
+    * @param env pointer to environment variable
+    * @param nonce randomly created bytes
+    * @param created created time
+    * @param password password to be hashed
+    * @return calculated hash on success. NULL otherwise
     */
     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
-    rampart_crypto_sha1(const axutil_env_t *env,
-                        const axis2_char_t *nonce,
-                        const axis2_char_t *created,
-                        const axis2_char_t *password);
+    rampart_crypto_sha1(
+        const axutil_env_t *env,
+        const axis2_char_t *nonce,
+        const axis2_char_t *created,
+        const axis2_char_t *password);
 
 
     /* @} */
@@ -55,4 +58,4 @@
 }
 #endif
 
-#endif    /* !RAMPART_CRYPTO_H */
+#endif    /* !RAMPART_CRYPTO_UTIL */

Modified: webservices/rampart/trunk/c/include/rampart_handler_util.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_handler_util.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_handler_util.h (original)
+++ webservices/rampart/trunk/c/include/rampart_handler_util.h Sun Oct 12 21:41:51 2008
@@ -16,20 +16,8 @@
  */
 
 
-#include <axis2_handler_desc.h>
-#include <axutil_array_list.h>
-#include <axiom_soap_const.h>
-#include <axiom_soap_envelope.h>
 #include <axiom_soap_header.h>
-#include <axiom_soap_header_block.h>
-#include <axis2_op.h>
 #include <axis2_msg_ctx.h>
-#include <axis2_msg_info_headers.h>
-#include <axutil_property.h>
-#include <rampart_constants.h>
-#include <rampart_util.h>
-#include <axis2_conf_ctx.h>
-
 
 #ifndef RAMPART_HANDLER_UTIL_H
 #define RAMPART_HANDLER_UTIL_H
@@ -49,75 +37,37 @@
 {
 #endif
 
-
-    /**
-     * Get properties from the axis2 context
-     * @param env pointer to environment struct
-     * @param ctx axis2 context
-     * @param key the property name
-     * @return parameter
-     */
-
-    AXIS2_EXTERN axis2_char_t* AXIS2_CALL
-    rampart_get_property_from_ctx( const axutil_env_t *env,
-                                   axis2_ctx_t *ctx,
-                                   const axis2_char_t *key);
-
-    /**
-    * Get parameter for the given parameter name
-    * @param env pointer to environment struct    
-    * @param msg_ctx message context
-    * @param parameter the parameter name
-    * @return parameter 
-    */
-
-    AXIS2_EXTERN axutil_param_t* AXIS2_CALL
-    rampart_get_security_param( const axutil_env_t *env,
-                                axis2_msg_ctx_t *msg_ctx,
-                                axis2_char_t *parameter);
-
-
-
-
     /**
-    * Get the security token from the header block
+    * Get the security header from the header block
     * @param env pointer to environment struct
     * @param msg_ctx message context
-    * @param soap heamsg_ctxder
-    * @return soap_header security element node
+    * @param soap_header header block 
+    * @return security soap header node
     */
     AXIS2_EXTERN axiom_node_t *AXIS2_CALL
-    rampart_get_security_header(const axutil_env_t *env,
-                               axis2_msg_ctx_t *msg_ctx,
-                               axiom_soap_header_t *soap_header);
+    rampart_get_security_header(
+        const axutil_env_t *env,
+        axis2_msg_ctx_t *msg_ctx,
+        axiom_soap_header_t *soap_header);
 
     /**
-    * Creates a SOAP envelope based on params described below
+    * Creates a SOAP fault based on params described below and store in msg_ctx
     * @param env pointer to environment struct
     * @param sub_code the text of the Subcode element of a SOAP fault message
     * @param reason_text the text in soapenv:Reason element
     * @param detail_node_text the text in the soapenv:Detail element
     * @param msg_ctx the msg_ctx 
-    * @return soap_header security element node
+    * @return void
     */
     AXIS2_EXTERN void AXIS2_CALL
-    rampart_create_fault_envelope(const axutil_env_t *env,
-                                  const axis2_char_t *sub_code,
-                                  const axis2_char_t *reason_text,
-                                  const axis2_char_t *detail_node_text,
-                                  axis2_msg_ctx_t *msg_ctx);
+    rampart_create_fault_envelope(
+        const axutil_env_t *env,
+        const axis2_char_t *sub_code,
+        const axis2_char_t *reason_text,
+        const axis2_char_t *detail_node_text,
+        axis2_msg_ctx_t *msg_ctx);
 
     /**
-     * Validates a security header elements 
-     * @param env pointer to environment struct  
-     * @param msg_ctx the msg_ctx 
-     * @param  sec_node the reference to the security node
-     */
-    AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_validate_security_header(const axutil_env_t *env,
-                                    axis2_msg_ctx_t *msg_ctx,
-                                    axiom_node_t *sec_node);
-    /**
      * Get rampart configurations from the message context
      * @param env pointer to environment struct
      * @param msg_ctx message context
@@ -125,9 +75,11 @@
      * @return the loaded configuration params
      */
     AXIS2_EXTERN void *AXIS2_CALL
-    rampart_get_rampart_configuration(const axutil_env_t *env,
-                                      axis2_msg_ctx_t *msg_ctx,
-                                      axis2_char_t *param_name);
+    rampart_get_rampart_configuration(
+        const axutil_env_t *env,
+        axis2_msg_ctx_t *msg_ctx,
+        axis2_char_t *param_name);
+
     /**
      * Check wether rampart is engaged or not
      * @param env pointer to environment struct
@@ -135,10 +87,9 @@
      * @return if engaged returns AXIS2_TRUE, else returns AXIS2_FALSE
      */
     AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-    rampart_is_rampart_engaged(const axutil_env_t *env,
-                               axis2_msg_ctx_t *msg_ctx);
-
-
+    rampart_is_rampart_engaged(
+        const axutil_env_t *env,
+        axis2_msg_ctx_t *msg_ctx);
 
     /** @} */
 #ifdef __cplusplus

Modified: webservices/rampart/trunk/c/include/rampart_policy_validator.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_policy_validator.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_policy_validator.h (original)
+++ webservices/rampart/trunk/c/include/rampart_policy_validator.h Sun Oct 12 21:41:51 2008
@@ -1,17 +1,18 @@
 /*
- *   Copyright 2003-2004 The Apache Software Foundation.
+ * 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
  *
- *   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
  *
- *       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.
+ * 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 <axutil_utils_defines.h>
@@ -46,7 +47,8 @@
     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_pv_validate_sec_header(const axutil_env_t *env,
+    rampart_pv_validate_sec_header(
+        const axutil_env_t *env,
         rampart_context_t *rampart_context,
         axiom_node_t *sec_node,
         axis2_msg_ctx_t *msg_ctx);

Modified: webservices/rampart/trunk/c/include/rampart_replay_detector.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_replay_detector.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_replay_detector.h (original)
+++ webservices/rampart/trunk/c/include/rampart_replay_detector.h Sun Oct 12 21:41:51 2008
@@ -32,8 +32,8 @@
 #include <axis2_defines.h>
 #include <axutil_env.h>
 #include <axis2_msg_ctx.h>
-#include <axis2_conf_ctx.h>
 #include <rampart_context.h>
+
 #ifdef __cplusplus
 extern "C"
 {

Modified: webservices/rampart/trunk/c/include/rampart_sec_processed_result.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_sec_processed_result.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_sec_processed_result.h (original)
+++ webservices/rampart/trunk/c/include/rampart_sec_processed_result.h Sun Oct 12 21:41:51 2008
@@ -1,24 +1,24 @@
 /*
- *   Copyright 2003-2004 The Apache Software Foundation.
+ * 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
  *
- *   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
  *
- *       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.
+ * 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 <rampart_constants.h>
 #include <axutil_utils_defines.h>
 #include <axis2_defines.h>
 #include <axutil_env.h>
+#include <axis2_msg_ctx.h>
 
 /**
   * @file rampart_sec_processed_result.h
@@ -35,54 +35,68 @@
       * @defgroup rampart_sec_processed_result
       * @ingroup Rampart_Util
       */
+
     /**
-    *   Set a security processed result to the message context
-    */
+     * Set a security processed result to the message context
+     * @param env Environment structure
+     * @param msg_ctx message context sttucture
+     * @param key key of the security processed result
+     * @param value value of the security processed result
+     * @return status of the operation
+     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_set_security_processed_result(const axutil_env_t *env,
-                                          axis2_msg_ctx_t *msg_ctx,
-                                          axis2_char_t *key,
-                                          void *value);
-    /**
-    *   Get a security processed result from a message context.
-    *   A service  may use this method to retirieve a particular result by the key
-    *   @env the environment 
-    *   @msg_ctx the message context in which data are extracted
-    *   @key as specified in rampart_constants section SPR
-    *
-    */
+    rampart_set_security_processed_result(
+        const axutil_env_t *env,
+        axis2_msg_ctx_t *msg_ctx,
+        axis2_char_t *key,
+        void *value);
+
+    /**
+     * Get a security processed result from a message context.
+     * A service  may use this method to retirieve a particular result by the key
+     * @env the environment 
+     * @msg_ctx the message context in which data are extracted
+     * @key as specified in rampart_constants section SPR
+     * @return value of the security processed result corresponding to @key
+     */
     AXIS2_EXTERN void *AXIS2_CALL
-    rampart_get_security_processed_result(const axutil_env_t *env,
-                                          axis2_msg_ctx_t *msg_ctx,
-                                          axis2_char_t *key);
+    rampart_get_security_processed_result(
+        const axutil_env_t *env,
+        axis2_msg_ctx_t *msg_ctx,
+        axis2_char_t *key);
 
     /**
-    *   Set a security processed result property to the message context
-    *   @env the environment 
-    *   @msg_ctx the message context in which data are extracted
-    */
+     * Set a security processed result property to the message context
+     * @env the environment 
+     * @msg_ctx the message context in which data are stored/extracted
+     * @return status of the operation
+     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_set_security_processed_results_property(const axutil_env_t *env,
-            axis2_msg_ctx_t *msg_ctx);
+    rampart_set_security_processed_results_property(
+        const axutil_env_t *env,
+        axis2_msg_ctx_t *msg_ctx);
 
     /**
-    *   Get the complete set of security processed results
-    *   @env the environment 
-    *   @msg_ctx the message context in which data are extracted
-    */
+     * Get the complete set of security processed results
+     * @env the environment 
+     * @msg_ctx the message context in which data are extracted
+     * @return complete set of security processed results.
+     */
     AXIS2_EXTERN axutil_hash_t* AXIS2_CALL
-    rampart_get_all_security_processed_results(const axutil_env_t *env,
-            axis2_msg_ctx_t *msg_ctx);
+    rampart_get_all_security_processed_results(
+        const axutil_env_t *env,
+        axis2_msg_ctx_t *msg_ctx);
 
     /**
-     * Prints all ke/val pairs in the security processed results
-     *   @env the environment 
-     *   @msg_ctx the message context in which data are extracted
-     *
+     * Prints all ke/val pairs in the security processed results. For debugging purposes
+     * @env the environment 
+     * @msg_ctx the message context in which data are extracted
+     * @return void
      */
     AXIS2_EXTERN void AXIS2_CALL
-    rampart_print_security_processed_results_set(const axutil_env_t *env,
-            axis2_msg_ctx_t *msg_ctx);
+    rampart_print_security_processed_results_set(
+        const axutil_env_t *env,
+        axis2_msg_ctx_t *msg_ctx);
 
 
     /* @} */

Modified: webservices/rampart/trunk/c/include/rampart_token_builder.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_token_builder.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_token_builder.h (original)
+++ webservices/rampart/trunk/c/include/rampart_token_builder.h Sun Oct 12 21:41:51 2008
@@ -1,30 +1,23 @@
 /*
- *   Copyright 2003-2004 The Apache Software Foundation.
+ * 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
  *
- *   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
  *
- *       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.
+ * 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 <axutil_utils_defines.h>
 #include <axis2_defines.h>
-#include <axutil_date_time.h>
 #include <axutil_env.h>
-#include <axutil_property.h>
-#include <axis2_msg_ctx.h>
-#include <rampart_authn_provider.h>
-#include <rampart_credentials.h>
-#include <rampart_callback.h>
 #include <oxs_x509_cert.h>
 /**
   * @file rampart_token_builder.h
@@ -55,9 +48,8 @@
     /**
      * Build a SecurityTokenReference element according to the pattern specified in @pattern.
      * The token will be attached to the node @parent and relavent data will be extracted from 
-     * certificate @cert.
-     * Note that this method will internally call other token building methods specified in this header
-     * depending on the @pattern. 
+     * certificate @cert. Note that this method will internally call other token building methods 
+     * specified in this header depending on the @pattern. 
      * @param env pointer to environment struct
      * @param parent The parent node
      * @param cert The X509 certificate
@@ -65,10 +57,11 @@
      * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
      */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_token_build_security_token_reference(const axutil_env_t *env,
-            axiom_node_t *parent,
-            oxs_x509_cert_t *cert,
-            rampart_token_build_pattern_t pattern);
+    rampart_token_build_security_token_reference(
+        const axutil_env_t *env,
+        axiom_node_t *parent,
+        oxs_x509_cert_t *cert,
+        rampart_token_build_pattern_t pattern);
 
     /**
      * Build an Embedded token with data available in the certificate.
@@ -82,27 +75,47 @@
      * @param cert The X509 certificate
      * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
      */
-
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_token_build_embedded(const axutil_env_t *env,
-                                 axiom_node_t *parent,
-                                 oxs_x509_cert_t *cert);
+    rampart_token_build_embedded(
+        const axutil_env_t *env,
+        axiom_node_t *parent,
+        oxs_x509_cert_t *cert);
+
     /**
      * Build a KeyIndentifer token with data available in the certificate.
      *        <SecurityTokenReference>
      *            <KeyIdentifier>WEqswOIUsd</KeyIdentifier>
      *        </SecurityTokenReference>
-     * 
      * @param env pointer to environment struct
      * @param parent The parent node
      * @param cert The X509 certificate
      * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
      */
-
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_token_build_key_identifier(const axutil_env_t *env,
-                                       axiom_node_t *parent,
-                                       oxs_x509_cert_t *cert);
+    rampart_token_build_key_identifier(
+        const axutil_env_t *env,
+        axiom_node_t *parent,
+        oxs_x509_cert_t *cert);
+    
+    /*
+     * Build an X509Certificate token with data available in the certificate.
+     *        <SecurityTokenReference>
+     *          <ds:X509Data>
+     *              <ds:X509Certificate>
+     *                  MIICzjCCAjegAwIBAgIJANyD+jwekxGuMA......
+     *              </ds:X509Certificate>
+     *          <ds:X509Data>
+     *        </SecurityTokenReference>
+     * @param env pointer to environment struct
+     * @param parent The parent node
+     * @param cert The X509 certificate
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rampart_token_build_x509_data_x509_certificate(
+        const axutil_env_t *env,
+        axiom_node_t *parent,
+        oxs_x509_cert_t *cert);
 
     /**
      * Build an X509IssuerSerial token with data available in the certificate.
@@ -119,29 +132,12 @@
      * @param cert The X509 certificate
      * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
      */
-
-    AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_token_build_x509_data_x509_certificate(const axutil_env_t *env,
-            axiom_node_t *parent,
-            oxs_x509_cert_t *cert);
-    /*
-     * Build an X509Certificate token with data available in the certificate.
-     *        <SecurityTokenReference>
-     *          <ds:X509Data>
-     *              <ds:X509Certificate>
-     *                  MIICzjCCAjegAwIBAgIJANyD+jwekxGuMA......
-     *              </ds:X509Certificate>
-     *          <ds:X509Data>
-     *          </SecurityTokenReference>
-     * @param env pointer to environment struct
-     * @param parent The parent node
-     * @param cert The X509 certificate
-     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_token_build_x509_data_issuer_serial(const axutil_env_t *env,
-            axiom_node_t *parent,
-            oxs_x509_cert_t *cert);
+    rampart_token_build_x509_data_issuer_serial(
+        const axutil_env_t *env,
+        axiom_node_t *parent,
+        oxs_x509_cert_t *cert);
+
     /* @} */
 #ifdef __cplusplus
 }

Modified: webservices/rampart/trunk/c/include/rampart_token_processor.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_token_processor.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_token_processor.h (original)
+++ webservices/rampart/trunk/c/include/rampart_token_processor.h Sun Oct 12 21:41:51 2008
@@ -1,30 +1,27 @@
 /*
- *   Copyright 2003-2004 The Apache Software Foundation.
+ * 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
  *
- *   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
  *
- *       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.
+ * 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 <axutil_utils_defines.h>
+#include <axis2_util.h>
 #include <axis2_defines.h>
-#include <axutil_date_time.h>
+#include <axutil_utils_defines.h>
 #include <axutil_env.h>
-#include <axutil_property.h>
-#include <axis2_msg_ctx.h>
-#include <rampart_authn_provider.h>
-#include <rampart_credentials.h>
-#include <rampart_callback.h>
+#include <axiom_node.h>
+#include <oxs_x509_cert.h>
+
 /**
   * @file rampart_token_processor.h
   * @brief Token processing of rampart
@@ -42,32 +39,77 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
+    
+    /**
+     * extract certificate related information using given token_reference node and scope node
+     * @param env Environment structure
+     * @param st_ref_node security token reference node. 
+     * @param scope_node node where additional details should be found. Can be NULL for all other 
+     *  scenarios but the Direct Reference
+     * @param cert certificate where values extracted shuold be populated
+     * @return status of the operation
+     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_token_process_security_token_reference(const axutil_env_t *env,
-            axiom_node_t *st_ref_node,
-            axiom_node_t *scope_node,/*Can be NULL for all other scenarios but the Direct Reference*/
-            oxs_x509_cert_t *cert);
-
+    rampart_token_process_security_token_reference(
+        const axutil_env_t *env,
+        axiom_node_t *st_ref_node,
+        axiom_node_t *scope_node,
+        oxs_x509_cert_t *cert);
+
+    /**
+     * extract certificate using reference id given in reference node
+     * @param env Environment structure
+     * @param ref_node security token reference node. 
+     * @param scope_node node where certificate details should be found using reference id
+     * @param cert certificate where values extracted shuold be populated
+     * @return status of the operation
+     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_token_process_direct_ref(const axutil_env_t *env,
-                                     axiom_node_t *ref_node,
-                                     axiom_node_t *scope_node,
-                                     oxs_x509_cert_t *cert);
-
+    rampart_token_process_direct_ref(
+        const axutil_env_t *env,
+        axiom_node_t *ref_node,
+        axiom_node_t *scope_node,
+        oxs_x509_cert_t *cert);
+
+    /**
+     * extract embedded certificate from given embed_node
+     * @param env Environment structure
+     * @param embed_node node where certificate is embedded. 
+     * @param cert certificate where values extracted shuold be populated
+     * @return status of the operation
+     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_token_process_embedded(const axutil_env_t *env,
-                                   axiom_node_t *embed_node,
-                                   oxs_x509_cert_t *cert);
-
+    rampart_token_process_embedded(
+        const axutil_env_t *env,
+        axiom_node_t *embed_node,
+        oxs_x509_cert_t *cert);
+
+    /**
+     * extract key identifier and populate the certificate
+     * @param env Environment structure
+     * @param ki_node node where key identifier is available. 
+     * @param cert certificate where values extracted shuold be populated
+     * @return status of the operation
+     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_token_process_key_identifier(const axutil_env_t *env,
-                                         axiom_node_t *ki_node,
-                                         oxs_x509_cert_t *cert);
-
+    rampart_token_process_key_identifier(
+        const axutil_env_t *env,
+        axiom_node_t *ki_node,
+        oxs_x509_cert_t *cert);
+
+    /**
+     * extract key details from x509data node
+     * @param env Environment structure
+     * @param x509_data_node x509data node. 
+     * @param cert certificate where values extracted shuold be populated
+     * @return status of the operation
+     */
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_token_process_x509_data(const axutil_env_t *env,
-                                    axiom_node_t *x509_data_node,
-                                    oxs_x509_cert_t *cert);
+    rampart_token_process_x509_data(
+        const axutil_env_t *env,
+        axiom_node_t *x509_data_node,
+        oxs_x509_cert_t *cert);
+
     /* @} */
 #ifdef __cplusplus
 }

Modified: webservices/rampart/trunk/c/include/rampart_username_token.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_username_token.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_username_token.h (original)
+++ webservices/rampart/trunk/c/include/rampart_username_token.h Sun Oct 12 21:41:51 2008
@@ -35,22 +35,29 @@
 
 
 #include <axutil_env.h>
-#include <rampart_constants.h>
-#include <rampart_crypto_util.h>
 #include <rampart_context.h>
 
-
+    /*
+     * builds username token
+     * @param env pointer to environment struct
+     * @param rampart_context pointer to rampart context structure
+     * @param sec_node Security header node
+     * @param sec_ns_obj security namespace object
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+     */
     axis2_status_t AXIS2_CALL
     rampart_username_token_build(
         const axutil_env_t *env,
         rampart_context_t *rampart_context,
         axiom_node_t *sec_node,
         axiom_namespace_t *sec_ns_obj);
+
     /*
      * Validates the given username token
      * @param env pointer to environment struct
      * @param msg_ctx axis2 message context
-     * @param soap_header SOAP Header
+     * @param ut_node User name token node
+     * @param rampart_context pointer to rampart context structure
      * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
      */
     axis2_status_t AXIS2_CALL

Modified: webservices/rampart/trunk/c/include/rampart_util.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_util.h?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_util.h (original)
+++ webservices/rampart/trunk/c/include/rampart_util.h Sun Oct 12 21:41:51 2008
@@ -19,7 +19,6 @@
 #include <axis2_defines.h>
 #include <axutil_date_time.h>
 #include <axutil_env.h>
-#include <axutil_property.h>
 #include <axis2_msg_ctx.h>
 #include <rampart_authn_provider.h>
 #include <rampart_credentials.h>
@@ -200,17 +199,6 @@
         axis2_char_t *dt1, 
         axis2_char_t *dt2);
 
-    /**
-     * check whether different keys are needed for encryption and signature
-     * @param env pointer to environment struct
-     * @param rampart_context rampart context
-     * @return AXIS2_TRUE if different keys are needed. AXIS2_FALSE otherwise.
-     */
-    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-    is_different_session_key_for_encryption_and_signing(
-        const axutil_env_t *env,
-        rampart_context_t *rampart_context);
-
     /* @} */
 #ifdef __cplusplus
 }

Modified: webservices/rampart/trunk/c/samples/sct_provider/sct_provider_hash_map.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/sct_provider/sct_provider_hash_map.c?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/samples/sct_provider/sct_provider_hash_map.c (original)
+++ webservices/rampart/trunk/c/samples/sct_provider/sct_provider_hash_map.c Sun Oct 12 21:41:51 2008
@@ -22,6 +22,7 @@
 #include <rampart_util.h>
 #include <rampart_sct_provider.h>
 #include <secconv_security_context_token.h>
+#include <axis2_conf_ctx.h>
 
 #define RAMPART_SCT_PROVIDER_HASH_PROB "Rampart_SCT_Prov_DB_Prop"
 

Modified: webservices/rampart/trunk/c/samples/sct_provider/sct_provider_stored_key.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/sct_provider/sct_provider_stored_key.c?rev=703913&r1=703912&r2=703913&view=diff
==============================================================================
--- webservices/rampart/trunk/c/samples/sct_provider/sct_provider_stored_key.c (original)
+++ webservices/rampart/trunk/c/samples/sct_provider/sct_provider_stored_key.c Sun Oct 12 21:41:51 2008
@@ -22,6 +22,7 @@
 #include <rampart_util.h>
 #include <rampart_sct_provider.h>
 #include <secconv_security_context_token.h>
+#include <axis2_conf_ctx.h>
 
 #define RAMPART_SCT_PROVIDER_HASH_PROB "Rampart_SCT_Prov_DB_Prop"