axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kausha...@apache.org
Subject svn commit: r478471 - in /webservices/axis2/trunk/c/rampart: include/ src/handlers/ src/omxmlsec/ src/omxmlsec/openssl/ src/util/
Date Thu, 23 Nov 2006 05:32:31 GMT
Author: kaushalye
Date: Wed Nov 22 21:32:30 2006
New Revision: 478471

URL: http://svn.apache.org/viewvc?view=rev&rev=478471
Log:
Introducing rampart security processed results.
In the message processing stage certian information(e.g. Username) will be stored in a hash
table so that the reciever (e.g. Service) would be able to use them without processing the
message again.


Added:
    webservices/axis2/trunk/c/rampart/include/rampart_sec_processed_result.h
    webservices/axis2/trunk/c/rampart/src/util/rampart_sec_processed_result.c
Modified:
    webservices/axis2/trunk/c/rampart/include/oxs_axiom.h
    webservices/axis2/trunk/c/rampart/include/rampart_constants.h
    webservices/axis2/trunk/c/rampart/include/rampart_handler_util.h
    webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/axiom.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/encryption.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/crypt.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_encryption.c
    webservices/axis2/trunk/c/rampart/src/util/Makefile.am
    webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_processor.c
    webservices/axis2/trunk/c/rampart/src/util/rampart_util.c
    webservices/axis2/trunk/c/rampart/src/util/username_token.c

Modified: webservices/axis2/trunk/c/rampart/include/oxs_axiom.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_axiom.h?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_axiom.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_axiom.h Wed Nov 22 21:32:30 2006
@@ -47,7 +47,8 @@
 AXIS2_EXTERN axiom_node_t* AXIS2_CALL
 oxs_axiom_get_node_by_id(const axis2_env_t *env,
     axiom_node_t *node,
-    axis2_char_t *id_val);
+    axis2_char_t *attr,
+    axis2_char_t *val);
 
 AXIS2_EXTERN axis2_char_t* AXIS2_CALL
 oxs_axiom_get_attribute_value_of_node_by_name(const axis2_env_t *env,

Modified: webservices/axis2/trunk/c/rampart/include/rampart_constants.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart_constants.h?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart_constants.h (original)
+++ webservices/axis2/trunk/c/rampart/include/rampart_constants.h Wed Nov 22 21:32:30 2006
@@ -123,6 +123,16 @@
 /*Dynamically set values*/
 #define RAMPART_ACTION_PASSWORD "password"
 #define RAMPART_CALLBACK_SPECIFIC_PROPERTY "callbackSpecificProperty"
+
+/*Security processed results*/
+#define RAMPART_SECURITY_PROCESSED_RESULTS "SecurityProcessedResults"
+#define RAMPART_SPR_UT_USERNAME "SPR_UT_username"
+#define RAMPART_SPR_UT_CREATED "SPR_UT_created"
+#define RAMPART_SPR_UT_NONCE "SPR_UT_nonce"
+#define RAMPART_SPR_UT_PASSWORD_TYPE "SPR_UT_passwordType"
+#define RAMPART_SPR_TS_CREATED "SPR_TS_created"
+#define RAMPART_SPR_TS_EXPIRES "SPR_TS_expires"
+
 #ifdef __cplusplus
 }
 #endif

Modified: webservices/axis2/trunk/c/rampart/include/rampart_handler_util.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart_handler_util.h?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart_handler_util.h (original)
+++ webservices/axis2/trunk/c/rampart/include/rampart_handler_util.h Wed Nov 22 21:32:30 2006
@@ -37,7 +37,9 @@
 extern "C"
 {
 #endif
- /**
+
+
+/**
  * Get properties from the axis2 context
  * @param env pointer to environment struct
  * @param ctx axis2 context

Added: webservices/axis2/trunk/c/rampart/include/rampart_sec_processed_result.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart_sec_processed_result.h?view=auto&rev=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart_sec_processed_result.h (added)
+++ webservices/axis2/trunk/c/rampart/include/rampart_sec_processed_result.h Wed Nov 22 21:32:30
2006
@@ -0,0 +1,86 @@
+/*
+ *   Copyright 2003-2004 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.
+ */
+
+
+#include <rampart_constants.h>
+#include <axis2_utils_defines.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+
+/**
+  * @file rampart_sec_processed_result.h
+  * @brief RAMPART-UTIL 
+  */
+#ifndef RAMPART_SEC_PROCESSED_RESULT
+#define RAMPART_SEC_PROCESSED_RESULT
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+  * @defgroup Rampart_Util
+  * @ingroup Rampart_Util
+  */
+/**
+*   Set a security processed result to the message context
+*/
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rampart_set_security_processed_result(const axis2_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
+*
+*/
+AXIS2_EXTERN void *AXIS2_CALL
+rampart_get_security_processed_result(const axis2_env_t *env,
+        axis2_msg_ctx_t *msg_ctx,
+        axis2_char_t *key);
+
+/**
+*   Set a security processed result property to the message context
+*/
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rampart_set_security_processed_results_property(const axis2_env_t *env,
+    axis2_msg_ctx_t *msg_ctx);
+
+/**
+*   Get the complete set of security processed results
+*/
+AXIS2_EXTERN axis2_hash_t* AXIS2_CALL
+rampart_get_security_processed_results_set(const axis2_env_t *env,
+    axis2_msg_ctx_t *msg_ctx);
+
+/**
+ * Prints all ke/val pairs in the security processed results
+ *
+ */
+AXIS2_EXTERN void AXIS2_CALL
+rampart_print_security_processed_results_set(const axis2_env_t *env,
+    axis2_msg_ctx_t *msg_ctx);
+
+/* @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif    /* !RAMPART_SEC_PROCESSED_RESULT */

Modified: webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c (original)
+++ webservices/axis2/trunk/c/rampart/src/handlers/rampart_in_handler.c Wed Nov 22 21:32:30
2006
@@ -16,6 +16,7 @@
 
 #include <axis2_handler_desc.h>
 #include <axis2_array_list.h>
+#include <axis2_hash.h>
 #include <axiom_soap_const.h>
 #include <axiom_soap_envelope.h>
 #include <axiom_soap_header.h>
@@ -30,6 +31,8 @@
 #include <rampart_timestamp_token.h>
 #include <rampart_util.h>
 #include <rampart_sec_header_processor.h>
+#include <rampart_sec_processed_result.h>
+
 /*************************** Function headers *********************************/
 
 axis2_status_t AXIS2_CALL
@@ -127,11 +130,16 @@
             }
             /*Then re-populate using the axis2_ctx*/
             status = RAMPART_ACTIONS_POPULATE_FROM_CTX(actions, env, ctx);
-
+            
 
             sec_node = rampart_get_security_token(env, msg_ctx, soap_header);
 
             sub_codes = axis2_array_list_create(env, 0);
+            /*Set the security processed results to the message ctx*/
+            status = rampart_set_security_processed_results_property(env, msg_ctx);
+            if(AXIS2_FAILURE == status){
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][rampart_in_handler]
Unable to set the security processed results");
+            }
 
             if(!sec_node){
                 AXIS2_LOG_INFO(env->log, "[rampart][rampart_in_handler] No security header
element.");
@@ -147,6 +155,7 @@
                 return AXIS2_FAILURE;
             }
             */
+
             /*The main entry point for all security header validations*/    
             status = rampart_shp_process_message(env, msg_ctx, actions, soap_envelope, sec_node,
sub_codes);
             if (AXIS2_FAILURE == status)
@@ -155,6 +164,7 @@
                 return AXIS2_FAILURE;
             }                
 
+            /*rampart_print_security_processed_results_set(env, msg_ctx);*/
 
         } /* End of sec_header */
 

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/axiom.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/axiom.c?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/axiom.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/axiom.c Wed Nov 22 21:32:30 2006
@@ -25,6 +25,7 @@
 #include <axiom_element.h>
 #include <axiom_document.h>
 #include <axiom_stax_builder.h>
+#include <axiom_util.h>
 
 AXIS2_EXTERN int AXIS2_CALL
 oxs_axiom_get_number_of_children_with_qname(const axis2_env_t *env,
@@ -65,37 +66,38 @@
 AXIS2_EXTERN axiom_node_t* AXIS2_CALL
 oxs_axiom_get_node_by_id(const axis2_env_t *env,
     axiom_node_t *node,
-    axis2_char_t *id_val)
+    axis2_char_t *attr,
+    axis2_char_t *val)
 {
     axis2_char_t *attribute_value = NULL;
+    axis2_char_t *localname = NULL;
     
-    attribute_value = oxs_axiom_get_attribute_value_of_node_by_name(env, node, OXS_ATTR_ID);
-    if(0 == AXIS2_STRCMP(id_val, attribute_value) ){
+    if(!node){return NULL;}
+    
+    if(AXIOM_NODE_GET_NODE_TYPE(node, env) != AXIOM_ELEMENT){return NULL;}
+
+    localname = axiom_util_get_localname(node, env);
+    /*AXIS2_LOG_INFO(env->log, "[rampart][axiom] Checking node %s for the attribute %s
with value = %s", localname, attr, val);*/
+
+    attribute_value = oxs_axiom_get_attribute_value_of_node_by_name(env, node, attr);
+    if(0 == AXIS2_STRCMP(val, attribute_value) ){
         /*Gottcha.. return this node*/
         return node;
     }else{
-        /*Doesnt match. Search sibling/children*/
-        axiom_node_t *sib_node = NULL;
+        /*Doesn't match? Get the first child*/    
+        axiom_node_t *temp_node = NULL;
 
-        sib_node = node;
-        while(sib_node){
-            axiom_element_t *ele = NULL;
-            axiom_children_iterator_t *iter = NULL;
-
-            ele = AXIOM_NODE_GET_DATA_ELEMENT(sib_node, env);
-            iter = AXIOM_ELEMENT_GET_CHILDREN(ele, env, sib_node);
-            while (AXIS2_TRUE == AXIOM_CHILDREN_ITERATOR_HAS_NEXT(iter, env)){
-                axiom_node_t *child_node = NULL;
-                child_node = AXIOM_CHILDREN_ITERATOR_NEXT(iter, env);
-                /*If the child is an element*/
-                if(AXIOM_ELEMENT == AXIOM_NODE_GET_NODE_TYPE(child_node, env)){
-                    /*Recursive call*/
-                    return oxs_axiom_get_node_by_id(env, child_node, id_val);
-                }
+        temp_node = AXIOM_NODE_GET_FIRST_CHILD(node, env);
+        while (temp_node)
+        {
+            axiom_node_t *res_node = NULL;       
+            res_node = oxs_axiom_get_node_by_id(env, temp_node, attr, val);
+            if(res_node){
+                return res_node;
             }
-            sib_node = AXIOM_NODE_GET_NEXT_SIBLING(sib_node, env);
-        }/*sib_node while*/
-
+            temp_node = AXIOM_NODE_GET_NEXT_SIBLING(temp_node, env);
+        } 
+    
     }
     return NULL;
 }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/encryption.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/encryption.c?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/encryption.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/encryption.c Wed Nov 22 21:32:30 2006
@@ -164,7 +164,7 @@
     axis2_status_t status = AXIS2_FAILURE;
     /*TODO We support RSA encryption only. If any other algorithm is specified, reject*/
 
-    /*1. Try to get th epkey from the asy_ctx*/
+    /*1. Try to get the pkey from the asy_ctx*/
     
     /*2. If not try to load the key from the dec_prop_file*/
     file_name = oxs_asym_ctx_get_file_name(ctx, env);

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/crypt.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/crypt.c?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/crypt.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/crypt.c Wed Nov 22 21:32:30 2006
@@ -79,7 +79,6 @@
 
         if (do_encrypt == 1)
         {
-            printf("\nEncrypting block[%d] %s", inlen, inbuf);
             AXIS2_LOG_INFO(env->log, "[oxs][crypt.c] Encrypting block[%d] %s", inlen,
inbuf);
         }
 
@@ -113,7 +112,6 @@
     {
         /* Error */
         EVP_CIPHER_CTX_cleanup(&ctx);
-        printf("\nERROR:EVP_CipherFinal_ex--- EVP_CIPHER_CTX_cleanup\n");
         AXIS2_LOG_INFO(env->log, "[oxs][crypt.c] EVP_CIPHER_CTX_cleanup ");
         return (-1);
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_encryption.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_encryption.c?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_encryption.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_encryption.c Wed Nov 22 21:32:30 2006
@@ -129,7 +129,7 @@
     /*De-serialize the decrypted content to build the node*/
     deserialized_node = (axiom_node_t*)oxs_axiom_deserialize_node(env, decrypted_data);
     if(!deserialized_node){
-        oxs_error(ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,"Cannot deserialize a node from
the content.");
+        oxs_error(ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,"Cannot deserialize a node from
the content.\n%s", decrypted_data);
         return AXIS2_FAILURE;
     }
     /*Assign deserialized_node to the reference passed*/

Modified: webservices/axis2/trunk/c/rampart/src/util/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/Makefile.am?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/Makefile.am (original)
+++ webservices/axis2/trunk/c/rampart/src/util/Makefile.am Wed Nov 22 21:32:30 2006
@@ -4,7 +4,7 @@
 
 librampart_util_la_SOURCES = rampart_action.c rampart_crypto_util.c \
 							rampart_util.c rampart_handler_util.c username_token.c  timestamp_token.c \
-							rampart_encryption.c rampart_sec_header_processor.c
+							rampart_encryption.c rampart_sec_header_processor.c rampart_sec_processed_result.c
 
 
 librampart_util_la_LIBADD  = -lssl \

Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_processor.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_processor.c?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_processor.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_processor.c Wed Nov 22 21:32:30
2006
@@ -157,20 +157,17 @@
         axiom_node_t *envelope_node = NULL;
         oxs_ctx_t *ctx = NULL;
         axiom_node_t *decrypted_node = NULL; 
-        axiom_soap_body_t *body = NULL;
-        axiom_node_t *body_node = NULL;
 
         /*Get the i-th element and decrypt it */
         id = (axis2_char_t*)AXIS2_ARRAY_LIST_GET(reference_list, env, i);
         AXIS2_LOG_INFO(env->log, "[rampart][shp] Decrypting node, ID=%s", id);
+
+        /*Need to remove # sign from the ID*/
         id2 = axis2_string_substring_starting_at(id, 1);
         envelope_node = AXIOM_SOAP_ENVELOPE_GET_BASE_NODE(soap_envelope, env);
 
         /*Search for the node by its ID*/
-        body = AXIOM_SOAP_ENVELOPE_GET_BODY(soap_envelope, env);
-        body_node = AXIOM_SOAP_BODY_GET_BASE_NODE(body, env);
-        /*TODO Check why this fails for soap envelope node*/
-        enc_data_node = oxs_axiom_get_node_by_id(env, body_node, id2);
+        enc_data_node = oxs_axiom_get_node_by_id(env, envelope_node, OXS_ATTR_ID, id2);
         if(!enc_data_node){
             AXIS2_LOG_INFO(env->log, "[rampart][shp] Node with ID=%s cannot be found",
id);
             continue;

Added: webservices/axis2/trunk/c/rampart/src/util/rampart_sec_processed_result.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_sec_processed_result.c?view=auto&rev=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_sec_processed_result.c (added)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_sec_processed_result.c Wed Nov 22 21:32:30
2006
@@ -0,0 +1,120 @@
+/*
+ *   Copyright 2003-2004 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.
+ */
+
+/* 
+ *
+ */
+#include <rampart_util.h>
+#include <axis2_util.h>
+#include <axis2_property.h>
+#include <axis2_msg_ctx.h>
+#include <rampart_constants.h>
+#include <rampart_sec_processed_result.h>
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rampart_set_security_processed_result(const axis2_env_t *env,
+        axis2_msg_ctx_t *msg_ctx,
+        axis2_char_t *key,
+        void *value)
+{
+    axis2_hash_t *sec_processed_results = NULL;
+
+    sec_processed_results = rampart_get_security_processed_results_set(env, msg_ctx);
+    if(!sec_processed_results){
+        return AXIS2_FAILURE;
+    }
+    axis2_hash_set(sec_processed_results, key, AXIS2_HASH_KEY_STRING, value);
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[rampart][spr] Set %s in Security Processed
Results of message context ", key);
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN void *AXIS2_CALL
+rampart_get_security_processed_result(const axis2_env_t *env,
+        axis2_msg_ctx_t *msg_ctx,
+        axis2_char_t *key)
+{
+    axis2_hash_t *sec_processed_results = NULL;
+
+    sec_processed_results = rampart_get_security_processed_results_set(env, msg_ctx);
+    if(!sec_processed_results){
+        return NULL;
+    }
+    return axis2_hash_get(sec_processed_results, key, AXIS2_HASH_KEY_STRING);
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rampart_set_security_processed_results_property(const axis2_env_t *env,
+    axis2_msg_ctx_t *msg_ctx)
+{
+    axis2_hash_t *sec_processed_results = NULL;
+    axis2_property_t *sec_processed_results_prop = NULL;
+
+    if(!msg_ctx){
+        return AXIS2_FAILURE;
+    }
+
+    sec_processed_results = axis2_hash_make(env);
+    sec_processed_results_prop = axis2_property_create(env);
+    
+    AXIS2_PROPERTY_SET_VALUE(sec_processed_results_prop, env, sec_processed_results);
+    AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, RAMPART_SECURITY_PROCESSED_RESULTS, sec_processed_results_prop,
AXIS2_FALSE);
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_hash_t* AXIS2_CALL
+rampart_get_security_processed_results_set(const axis2_env_t *env,
+    axis2_msg_ctx_t *msg_ctx)
+{
+    axis2_property_t *sec_processed_results_prop = NULL;
+    axis2_hash_t *sec_processed_results = NULL;
+
+    sec_processed_results_prop = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env, RAMPART_SECURITY_PROCESSED_RESULTS,
AXIS2_FALSE);
+    if(!sec_processed_results_prop){
+         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][spr] Cannot get %s from msg
ctx ", RAMPART_SECURITY_PROCESSED_RESULTS);
+        return NULL;
+    }
+
+    sec_processed_results = (axis2_hash_t*)AXIS2_PROPERTY_GET_VALUE(sec_processed_results_prop,
env);
+    if(!sec_processed_results){
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][spr] Cannot get Security Processed
Results Hash table from the property");
+        return NULL;
+    }
+
+    return sec_processed_results;
+}
+
+AXIS2_EXTERN void AXIS2_CALL
+rampart_print_security_processed_results_set(const axis2_env_t *env,
+    axis2_msg_ctx_t *msg_ctx)
+{
+    axis2_hash_t *sec_processed_results = NULL;
+    axis2_hash_index_t *hi = NULL;
+    const void *key = NULL;
+    void *val = NULL;
+    
+    sec_processed_results = rampart_get_security_processed_results_set(env, msg_ctx);
+    if(!sec_processed_results){
+        return;
+    }
+    
+    for (hi = axis2_hash_first(sec_processed_results, env); hi; hi = axis2_hash_next(env,
hi)) {
+        axis2_hash_this(hi, &key, NULL, &val);
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[rampart][spr] (key, val) %s = %s\n",
(axis2_char_t*)key, (axis2_char_t*)val);
+        /*printf("%s = %s\n", (axis2_char_t*)key, (axis2_char_t*)val);*/
+    }
+
+}

Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_util.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_util.c?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_util.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_util.c Wed Nov 22 21:32:30 2006
@@ -14,16 +14,20 @@
  *   limitations under the License.
  */
 
-/* Rampart_crypto_util will contain crypto functionalities of the rampart model
+/* 
  *
  */
 #include <stdio.h>
 #include <rampart_util.h>
 #include <axis2_util.h>
 #include <axis2_base64.h>
+#include <axis2_property.h>
 #include <time.h>
 #include <oxs_buffer.h>
 #include <openssl_util.h>
+#include <axis2_msg_ctx.h>
+#include <rampart_constants.h>
+
 /*Calculate the hash of concatenated string of
  * nonce, created and the password.
  *
@@ -34,6 +38,7 @@
 
 
 /*#define PRINTINFO 1 */
+
 AXIS2_EXTERN axis2_char_t* AXIS2_CALL rampart_generate_nonce(const axis2_env_t *env)
 {
     oxs_buffer_t *buffer = NULL;

Modified: webservices/axis2/trunk/c/rampart/src/util/username_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/username_token.c?view=diff&rev=478471&r1=478470&r2=478471
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/username_token.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/username_token.c Wed Nov 22 21:32:30 2006
@@ -512,11 +512,13 @@
             else if (0 == AXIS2_STRCMP(localname,  RAMPART_SECURITY_USERNAMETOKEN_NONCE))
             {
                 nonce = AXIOM_ELEMENT_GET_TEXT(element, env, node);
+                rampart_set_security_processed_result(env, msg_ctx, RAMPART_SPR_UT_NONCE,
nonce);
 
             }
             else if (0 == AXIS2_STRCMP(localname ,  RAMPART_SECURITY_USERNAMETOKEN_CREATED))
             {
                 created = AXIOM_ELEMENT_GET_TEXT(element, env, node);
+                rampart_set_security_processed_result(env, msg_ctx, RAMPART_SPR_UT_CREATED,
created);
 
             }
             else
@@ -539,6 +541,9 @@
         AXIS2_LOG_INFO(env->log,  "[rampart][rampart_usernametoken] Username is not specified");
         return AXIS2_FAILURE;
     }
+    
+    /*Set the username to the SPR*/
+    rampart_set_security_processed_result(env, msg_ctx, RAMPART_SPR_UT_USERNAME, username);
 
     ctx = AXIS2_MSG_CTX_GET_BASE(msg_ctx, env);
     pw_callback_module = RAMPART_ACTIONS_GET_PW_CB_CLASS(actions, env);
@@ -560,10 +565,12 @@
     {
         AXIS2_LOG_INFO(env->log,  "[rampart][rampart_usernametoken] Generating digest
to compare from the password");
         password_to_compare = rampart_crypto_sha1(env, nonce, created, password_from_svr);
+        rampart_set_security_processed_result(env, msg_ctx, RAMPART_SPR_UT_PASSWORD_TYPE,
RAMPART_PASSWORD_DIGEST_URI);
     }
     else
     {
         password_to_compare = password_from_svr;
+        rampart_set_security_processed_result(env, msg_ctx, RAMPART_SPR_UT_PASSWORD_TYPE,
RAMPART_PASSWORD_TEXT_URI);
     }
 
     /*The BIG moment. Compare passwords*/



---------------------------------------------------------------------
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