Author: kaushalye
Date: Fri Oct 12 02:44:40 2007
New Revision: 584109

URL: http://svn.apache.org/viewvc?rev=584109&view=rev
Log:
1. Derived key encryption, with asymmetric encryption of the session key used.
2. Code formatting

Modified:
    webservices/rampart/trunk/c/src/omxmlsec/key.c
    webservices/rampart/trunk/c/src/omxmlsec/xml_encryption.c
    webservices/rampart/trunk/c/src/util/rampart_context.c
    webservices/rampart/trunk/c/src/util/rampart_encryption.c
    webservices/rampart/trunk/c/src/util/rampart_engine.c
    webservices/rampart/trunk/c/src/util/rampart_handler_util.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_timestamp_token.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/src/omxmlsec/key.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/key.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/key.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/key.c Fri Oct 12 02:44:40 2007
@@ -28,7 +28,9 @@
 {
     oxs_buffer_t *buf;
     axis2_char_t *name;
+    axis2_char_t *nonce;
     int           usage;
+    int           offset;
 };
 
 /******************** end of function headers *****************/

Modified: webservices/rampart/trunk/c/src/omxmlsec/xml_encryption.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/xml_encryption.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/xml_encryption.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/xml_encryption.c Fri Oct 12 
02:44:40 2007
@@ -497,8 +497,10 @@
 
     cd_node = oxs_token_build_cipher_data_element(env, encrypted_key_node);
     cv_node = oxs_token_build_cipher_value_element(env, cd_node,  
encrypted_key_data);
-    oxs_token_build_data_reference_list(env, encrypted_key_node, id_list);
-
+    /*If and only if the id_list the present, we create the reference list*/
+    if(id_list){
+        oxs_token_build_data_reference_list(env, encrypted_key_node, id_list);
+    }
     /*Free*/
     oxs_buffer_free(result, env);
     result = NULL;

Modified: webservices/rampart/trunk/c/src/util/rampart_context.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_context.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_context.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_context.c Fri Oct 12 02:44:40 
2007
@@ -1046,8 +1046,8 @@
                 }
             }
         }/*eof for*/
-               axutil_array_list_free(soap_header_blocks, env);
-               soap_header_blocks = NULL;
+        axutil_array_list_free(soap_header_blocks, env);
+        soap_header_blocks = NULL;
         return AXIS2_SUCCESS;
     }
     else if(axutil_strcmp(local_name,"Security")==0)

Modified: webservices/rampart/trunk/c/src/util/rampart_encryption.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_encryption.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_encryption.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_encryption.c Fri Oct 12 
02:44:40 2007
@@ -66,7 +66,8 @@
                         "[rampart][rampart_encryption] Specified token type 
not supported.");
         return AXIS2_FAILURE;
     }
-                                       
+    
+
     /*Get the asymmetric key encryption algorithm*/
     enc_asym_algo = rampart_context_get_enc_asym_algo(rampart_context, env);
 
@@ -321,15 +322,20 @@
     axutil_array_list_free(nodes_to_encrypt, env);
     nodes_to_encrypt = NULL;
 
-    /*TODO Encrypt the session key using the Public Key of the recipient*/
-
+    /* Encrypt the session key using the Public Key of the recipient*/
+    status = rampart_enc_encrypt_session_key(env, session_key, msg_ctx, 
rampart_context, soap_envelope, sec_node, id_list );
+    if(AXIS2_FAILURE == status){
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                                "[rampart][rampart_encryption] Cannot encrypt 
the session key " );
+        return AXIS2_FAILURE;
+    }
     /*Add used <wsc:DerivedKeyToken> elements to the header*/
     for(j=0 ; j < axutil_array_list_size(dk_list, env); j++){
         oxs_key_t *dk = NULL;
         
         dk = (oxs_key_t *)axutil_array_list_get(dk_list, env, j);
         /*TODO build the <wsc:DerivedKeyToken> element*/
-
+        
     }/*End of For loop of dk_list iteration*/
     return status;
 }

Modified: webservices/rampart/trunk/c/src/util/rampart_engine.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_engine.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_engine.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_engine.c Fri Oct 12 02:44:40 
2007
@@ -140,9 +140,9 @@
                                           "Error in the Internal 
configuration.", RAMPART_FAULT_IN_POLICY, msg_ctx);
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                             "[rampart][rampart_engine] Cannot create security 
policy from policy.");
-                       
-                       rampart_context_free(rampart_context, env);
-                       rampart_context = NULL;
+
+            rampart_context_free(rampart_context, env);
+            rampart_context = NULL;
             return NULL;
         }
 
@@ -156,9 +156,9 @@
                                           "Error in the Internal 
configuration.", RAMPART_FAULT_IN_POLICY, msg_ctx);
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                             "[rampart][rampart_engine] rampc policies creation 
failed.");
-                       
-                       rampart_context_free(rampart_context, env);
-                       rampart_context = NULL;
+
+            rampart_context_free(rampart_context, env);
+            rampart_context = NULL;
             return NULL;
         }
     }
@@ -171,8 +171,8 @@
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                             "[rampart][engine] Conf context is NULL ");
             rampart_context_free(rampart_context, env);
-                       rampart_context = NULL;
-                       return NULL;
+            rampart_context = NULL;
+            return NULL;
         }
 
         ctx = axis2_conf_ctx_get_base(conf_ctx,env);
@@ -181,8 +181,8 @@
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                             "[rampart][engine] axis2 context is NULL ");
             rampart_context_free(rampart_context, env);
-                       rampart_context = NULL;
-                       return NULL;
+            rampart_context = NULL;
+            return NULL;
         }
         property = axutil_property_create_with_args(env, AXIS2_SCOPE_REQUEST ,
                    AXIS2_TRUE, (void *)rampart_context_free, rampart_context);

Modified: webservices/rampart/trunk/c/src/util/rampart_handler_util.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_handler_util.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_handler_util.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_handler_util.c Fri Oct 12 
02:44:40 2007
@@ -135,8 +135,8 @@
         {
             /*Set mustUnderstand = 0*/
             
axiom_soap_header_block_set_must_understand_with_bool(header_block, env, 
AXIS2_FALSE);
-                       if (env)
-                               AXIS2_FREE(env->allocator, hash_index);
+            if (env)
+                AXIS2_FREE(env->allocator, hash_index);
             return header_block_node;
         }
 

Modified: webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c Fri Oct 
12 02:44:40 2007
@@ -98,16 +98,16 @@
 
     }else{ /*Sign before encrypt*/
         is_encrypt_before_sign = AXIS2_FALSE;
-        
+
         /*TODO First do signature specific stuff using Symmetric key*/
-        
-        
+
+
         /*Then Handle Encryption stuff*/
         status = rampart_enc_dk_encrypt_message(env, msg_ctx, rampart_context, 
soap_envelope, sec_node);
         if (status == AXIS2_FAILURE)
         {
-                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shb] Sym 
binding, Encryption failed in Symmetric binding. ERROR");
-                return AXIS2_FAILURE;
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shb] Sym 
binding, Encryption failed in Symmetric binding. ERROR");
+            return AXIS2_FAILURE;
         }
     }
     status = AXIS2_SUCCESS;

Modified: webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c 
(original)
+++ webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c Fri Oct 
12 02:44:40 2007
@@ -437,8 +437,8 @@
                         "[rampart][shp] Cannot decrypt the EncryptedKey");
         rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_CHECK,
                                       "Key decryption failed", 
RAMPART_FAULT_IN_ENCRYPTED_KEY, msg_ctx);
-               oxs_asym_ctx_free(asym_ctx, env);
-               asym_ctx = NULL;
+        oxs_asym_ctx_free(asym_ctx, env);
+        asym_ctx = NULL;
         return AXIS2_FAILURE;
     }
 
@@ -455,8 +455,8 @@
                                       "Error in the policy. No summetric 
algo", RAMPART_FAULT_IN_POLICY, msg_ctx);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                         "[rampart][shp] Symetric enc algorithm not specified 
in policy.");
-               oxs_asym_ctx_free(asym_ctx, env);
-               asym_ctx = NULL;
+        oxs_asym_ctx_free(asym_ctx, env);
+        asym_ctx = NULL;
         return AXIS2_FAILURE;
     }
 
@@ -496,8 +496,8 @@
 
             rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_CHECK,
                                           "Cannot find EncryptedData element", 
RAMPART_FAULT_IN_ENCRYPTED_DATA, msg_ctx);
-                       oxs_asym_ctx_free(asym_ctx, env);
-                       asym_ctx = NULL;
+            oxs_asym_ctx_free(asym_ctx, env);
+            asym_ctx = NULL;
             return AXIS2_FAILURE;
         }
         /*Create an enc_ctx*/
@@ -510,8 +510,8 @@
                             "Cannot find EncryptionMethod Element");
             rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_CHECK,
                                           "Cannot find EncryptionMethod 
Element", RAMPART_FAULT_IN_ENCRYPTED_DATA, msg_ctx);
-                       oxs_asym_ctx_free(asym_ctx, env);
-                       asym_ctx = NULL;
+            oxs_asym_ctx_free(asym_ctx, env);
+            asym_ctx = NULL;
             return AXIS2_FAILURE;
         }
 
@@ -522,8 +522,8 @@
                             "Cannot get the Symmetric Algorithm from Soap 
message.");
             rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_CHECK,
                                           "Cannot find EncryptionMethod 
Element", RAMPART_FAULT_IN_ENCRYPTED_DATA, msg_ctx);
-                       oxs_asym_ctx_free(asym_ctx, env);
-                       asym_ctx = NULL;
+            oxs_asym_ctx_free(asym_ctx, env);
+            asym_ctx = NULL;
 
             return AXIS2_FAILURE;
         }
@@ -535,8 +535,8 @@
             rampart_create_fault_envelope(env, RAMPART_FAULT_INVALID_SECURITY,
                                           "The content is encrypted with the 
wrong algorithm",
                                           RAMPART_FAULT_IN_ENCRYPTED_KEY, 
msg_ctx);
-                       oxs_asym_ctx_free(asym_ctx, env);
-                       asym_ctx = NULL;
+            oxs_asym_ctx_free(asym_ctx, env);
+            asym_ctx = NULL;
             return AXIS2_FAILURE;
 
         }
@@ -550,8 +550,8 @@
         {
             rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_CHECK,
                                           "Data decryption failed", 
RAMPART_FAULT_IN_ENCRYPTED_DATA, msg_ctx);
-                       oxs_asym_ctx_free(asym_ctx, env);
-                       asym_ctx = NULL;
+            oxs_asym_ctx_free(asym_ctx, env);
+            asym_ctx = NULL;
             return AXIS2_FAILURE;
         }
 
@@ -607,11 +607,11 @@
 
     if((!reference_list) || (0 == axutil_array_list_size(reference_list, env)))
     {
-               if (reference_list)
-               {
-                       axutil_array_list_free(reference_list, env);
-                       reference_list = NULL;
-               }
+        if (reference_list)
+        {
+            axutil_array_list_free(reference_list, env);
+            reference_list = NULL;
+        }
 
         AXIS2_LOG_INFO(env->log,
                        "[rampart][shp] Nothing Encrypted Outside security 
header");
@@ -644,15 +644,15 @@
                             "[rampart][shp] Node with ID=%s cannot be found", 
id2);
             rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_CHECK,
                                           "Cannot find EncryptedData element", 
RAMPART_FAULT_IN_ENCRYPTED_DATA, msg_ctx);
-                       axutil_array_list_free(reference_list, env);
-                       reference_list = NULL;
-                       AXIS2_FREE(env->allocator, id2);
-                       id2 = NULL;
+            axutil_array_list_free(reference_list, env);
+            reference_list = NULL;
+            AXIS2_FREE(env->allocator, id2);
+            id2 = NULL;
             return AXIS2_FAILURE;
         }
 
-               AXIS2_FREE(env->allocator, id2);
-               id2 = NULL;
+        AXIS2_FREE(env->allocator, id2);
+        id2 = NULL;
 
         key_info_node = oxs_axiom_get_first_child_node_by_name(env, 
enc_data_node,
                         OXS_NODE_KEY_INFO, OXS_DSIG_NS, NULL);
@@ -681,8 +681,8 @@
                         ref_id = 
axutil_string_substring_starting_at(axutil_strdup(env, ref), 1);
 
                         encrypted_key_node = oxs_axiom_get_node_by_id(env, 
sec_node, "Id", ref_id, NULL);
-                                               AXIS2_FREE(env->allocator, 
ref_id);
-                                               ref_id = NULL;
+                        AXIS2_FREE(env->allocator, ref_id);
+                        ref_id = NULL;
                         if(encrypted_key_node)
                         {
                             ref_list_node = axiom_node_detach(ref_list_node, 
env);
@@ -698,8 +698,8 @@
         }
     }
 
-       axutil_array_list_free(reference_list, env);
-       reference_list = NULL;
+    axutil_array_list_free(reference_list, env);
+    reference_list = NULL;
     return status;
 }
 

Modified: webservices/rampart/trunk/c/src/util/rampart_sec_processed_result.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_sec_processed_result.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_sec_processed_result.c 
(original)
+++ webservices/rampart/trunk/c/src/util/rampart_sec_processed_result.c Fri Oct 
12 02:44:40 2007
@@ -72,8 +72,8 @@
     sec_processed_results = axutil_hash_make(env);
 
     sec_processed_results_prop = axutil_property_create_with_args(env, 
AXIS2_SCOPE_REQUEST ,
-                   AXIS2_TRUE, (void *)axutil_hash_free, 
sec_processed_results);
-    
+                                 AXIS2_TRUE, (void *)axutil_hash_free, 
sec_processed_results);
+
     axis2_msg_ctx_set_property(msg_ctx, env, 
RAMPART_SECURITY_PROCESSED_RESULTS, sec_processed_results_prop);
 
     return AXIS2_SUCCESS;

Modified: webservices/rampart/trunk/c/src/util/rampart_signature.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_signature.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_signature.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_signature.c Fri Oct 12 
02:44:40 2007
@@ -182,7 +182,7 @@
     {
         AXIS2_LOG_INFO(env->log,
                        "[rampart][rampart_signature] No parts specified or 
specified parts can't be found for Signature.");
-               axutil_array_list_free(nodes_to_sign, env);
+        axutil_array_list_free(nodes_to_sign, env);
         nodes_to_sign = NULL;
         return AXIS2_SUCCESS;
     }
@@ -197,8 +197,8 @@
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                             "[rampart][rampart_signature] Required timestamp 
cannot be found.");
-                       axutil_array_list_free(nodes_to_sign, env);
-                       nodes_to_sign = NULL;
+            axutil_array_list_free(nodes_to_sign, env);
+            nodes_to_sign = NULL;
             return AXIS2_FAILURE;
         }
         axutil_array_list_add(nodes_to_sign, env, ts_node);
@@ -215,8 +215,8 @@
             {
                 AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                                 "[rampart][rampart_signature] Required 
username token cannot be found.");
-                               axutil_array_list_free(nodes_to_sign, env);
-                               nodes_to_sign = NULL;
+                axutil_array_list_free(nodes_to_sign, env);
+                nodes_to_sign = NULL;
                 return AXIS2_FAILURE;
             }
             axutil_array_list_add(nodes_to_sign, env, ut_node);
@@ -230,8 +230,8 @@
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                         "[rampart][rampart_signature] Signature Token is not 
specified");
-               axutil_array_list_free(nodes_to_sign, env);
-               nodes_to_sign = NULL;
+        axutil_array_list_free(nodes_to_sign, env);
+        nodes_to_sign = NULL;
         return AXIS2_FAILURE;
     }
     token_type = rp_property_get_type(token, env);
@@ -240,8 +240,8 @@
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                         "[rampart][rampart_signature] Token type %d not 
supported", token_type);
-               axutil_array_list_free(nodes_to_sign, env);
-               nodes_to_sign = NULL;
+        axutil_array_list_free(nodes_to_sign, env);
+        nodes_to_sign = NULL;
         return AXIS2_FAILURE;
     }
 
@@ -249,8 +249,8 @@
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                         "[rampart][rampart_signature] We still do not support 
derived keys");
-               axutil_array_list_free(nodes_to_sign, env);
-               nodes_to_sign = NULL;
+        axutil_array_list_free(nodes_to_sign, env);
+        nodes_to_sign = NULL;
         return AXIS2_FAILURE;
     }
 
@@ -267,8 +267,8 @@
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                             "[rampart][rampart_signature] Cannot get 
certificate");
-                       axutil_array_list_free(nodes_to_sign, env);
-                       nodes_to_sign = NULL;
+            axutil_array_list_free(nodes_to_sign, env);
+            nodes_to_sign = NULL;
             return AXIS2_FAILURE;
         }
         /*This flag will be useful when creating key Info element.*/
@@ -281,8 +281,8 @@
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                             "[rampart][rampart_signature] Certificate data 
cannot be loaded from the cert.");
-                       axutil_array_list_free(nodes_to_sign, env);
-                       nodes_to_sign = NULL;
+            axutil_array_list_free(nodes_to_sign, env);
+            nodes_to_sign = NULL;
             return AXIS2_FAILURE;
         }
 
@@ -292,8 +292,8 @@
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                             "[rampart][rampart_signature] Binary Security 
Token creation failed.");
-                       axutil_array_list_free(nodes_to_sign, env);
-                       nodes_to_sign = NULL;
+            axutil_array_list_free(nodes_to_sign, env);
+            nodes_to_sign = NULL;
             return AXIS2_FAILURE;
         }
         oxs_x509_cert_free(cert, env);
@@ -309,8 +309,8 @@
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                         "[rampart][rampart_signature] Cannot attach the 
token.");
-               axutil_array_list_free(nodes_to_sign, env);
-               nodes_to_sign = NULL;
+        axutil_array_list_free(nodes_to_sign, env);
+        nodes_to_sign = NULL;
         return AXIS2_FAILURE;
     }
 
@@ -347,13 +347,13 @@
             oxs_sign_part_set_node(sign_part, env, node_to_sign);
             oxs_sign_part_set_digest_mtd(sign_part, env, digest_method);
             axutil_array_list_add(sign_parts, env, sign_part);
-                       AXIS2_FREE(env->allocator, id);
-                       id = NULL;
+            AXIS2_FREE(env->allocator, id);
+            id = NULL;
         }
     }
 
-       axutil_array_list_free(nodes_to_sign, env);
-       nodes_to_sign = NULL;
+    axutil_array_list_free(nodes_to_sign, env);
+    nodes_to_sign = NULL;
 
     sign_ctx = oxs_sign_ctx_create(env);
 
@@ -502,8 +502,8 @@
         cert_id_ref = axutil_stracat(env, "#",cert_id);
         reference_node = oxs_token_build_reference_element(
                              env, str_node, cert_id_ref, OXS_VALUE_X509V3);
-               AXIS2_FREE(env->allocator, cert_id_ref);
-               cert_id_ref = NULL;
+        AXIS2_FREE(env->allocator, cert_id_ref);
+        cert_id_ref = NULL;
         if(!reference_node)
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,

Modified: webservices/rampart/trunk/c/src/util/rampart_timestamp_token.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_timestamp_token.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_timestamp_token.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_timestamp_token.c Fri Oct 12 
02:44:40 2007
@@ -136,8 +136,8 @@
     if (axutil_strcmp(RAMPART_SECURITY_TIMESTAMP_CREATED ,
                       axiom_element_get_localname(created_ele, env)) != 0)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "[rampart][ts]Timestamp not valid: Cannot find created  in 
timestamp element. The first element MUST be CREATED");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "[rampart][ts]Timestamp not valid: Cannot find created 
 in timestamp element. The first element MUST be CREATED");
         return AXIS2_FAILURE;
     }
 
@@ -149,8 +149,8 @@
     if (validity == AXIS2_SUCCESS)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][ts]Timestamp not 
valid: Created time is not valid");
-               AXIS2_FREE(env->allocator, current_val);
-               current_val = NULL;
+        AXIS2_FREE(env->allocator, current_val);
+        current_val = NULL;
         return AXIS2_FAILURE;
     }
 
@@ -160,18 +160,18 @@
     {
         AXIS2_LOG_INFO(env->log, "[rampart][ts]Cannot find expires in 
timestamp element. This is not critical. Assume that the message is not 
expiring");
         /*If the expire element is not present, it means that the message will 
not be expired.*/
-               AXIS2_FREE(env->allocator, current_val);
-               current_val = NULL;
+        AXIS2_FREE(env->allocator, current_val);
+        current_val = NULL;
         return AXIS2_SUCCESS;
     }
     expires_ele  = (axiom_element_t*)axiom_node_get_data_element(expires_node, 
env);
     if (axutil_strcmp(RAMPART_SECURITY_TIMESTAMP_EXPIRES ,
                       axiom_element_get_localname(expires_ele, env)) != 0)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "[rampart][ts] Timestamp not valid: The second element of 
timestamp token (if any) MUST be EXPIRES");
-               AXIS2_FREE(env->allocator, current_val);
-               current_val = NULL;
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "[rampart][ts] Timestamp not valid: The second element 
of timestamp token (if any) MUST be EXPIRES");
+        AXIS2_FREE(env->allocator, current_val);
+        current_val = NULL;
         return AXIS2_FAILURE;
     }
 
@@ -182,12 +182,12 @@
 
     /*Check whether time has expired or not*/
     validity = rampart_compare_date_time(env, current_val, expires_val);
-       AXIS2_FREE(env->allocator, current_val);
-       current_val = NULL;
+    AXIS2_FREE(env->allocator, current_val);
+    current_val = NULL;
     if (validity == AXIS2_FAILURE)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
-            "[rampart][ts]Timestamp not valid: Timestamp token has expired");
+                        "[rampart][ts]Timestamp not valid: Timestamp token has 
expired");
         return AXIS2_FAILURE;
     }
     AXIS2_LOG_INFO(env->log, "[rampart][ts] Timstamp is valid");

Modified: webservices/rampart/trunk/c/src/util/rampart_username_token.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_username_token.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_username_token.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_username_token.c Fri Oct 12 
02:44:40 2007
@@ -247,7 +247,7 @@
 
         return AXIS2_FAILURE;
     }
-    
+
     /*Check: Any USERNAME_TOKEN MUST NOT have more than one PASSWORD*/
     if (1 <  oxs_axiom_get_number_of_children_with_qname(env, ut_node,
             RAMPART_SECURITY_USERNAMETOKEN_PASSWORD, RAMPART_WSSE_XMLNS, 
RAMPART_WSSE))
@@ -400,8 +400,8 @@
      * If authentication module is defined use it. 
      * Else try the usual approach to get password from the callback and 
compare
      **/
-    
-    
+
+
     /*In both authentication and password callback methods we should first try 
to
      *use function pointers. */
 
@@ -454,7 +454,7 @@
             }
         }
     }
-    
+
     authn_provider = rampart_context_get_authn_provider(rampart_context, env);
     if(authn_provider)
     {
@@ -520,9 +520,9 @@
                 password_from_svr = rampart_callback_password(env, 
password_callback, username);
             }
         }else{
-            
+
             AXIS2_LOG_INFO(env->log,
-                       "[rampart][rampart_usernametoken] Using the password is 
in the context");
+                           "[rampart][rampart_usernametoken] Using the 
password is in the context");
         }
 
         if (!password_from_svr)

Modified: webservices/rampart/trunk/c/src/util/rampart_util.c
URL: 
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_util.c?rev=584109&r1=584108&r2=584109&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_util.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_util.c Fri Oct 12 02:44:40 2007
@@ -136,11 +136,11 @@
     if (!cb)
     {
         AXIS2_LOG_INFO(env->log, "[rampart][rampart_util] Unable to identify 
the callback module %s. ERROR", callback_module_name);
-               if (param)
-               {
-                       AXIS2_FREE(env->allocator, param);
-                       param = NULL;
-               }
+        if (param)
+        {
+            AXIS2_FREE(env->allocator, param);
+            param = NULL;
+        }
         return AXIS2_FAILURE;
     }
     if(param){
@@ -240,23 +240,23 @@
     status =  axutil_date_time_deserialize_date_time(dt1, env, dt1_str);
     if (status == AXIS2_FAILURE)
     {
-               axutil_date_time_free(dt1, env);
-               axutil_date_time_free(dt2, env);
+        axutil_date_time_free(dt1, env);
+        axutil_date_time_free(dt2, env);
         return AXIS2_FAILURE;
     }
 
     status =  axutil_date_time_deserialize_date_time(dt2, env, dt2_str);
     if (status == AXIS2_FAILURE)
     {
-               axutil_date_time_free(dt1, env);
-               axutil_date_time_free(dt2, env);
+        axutil_date_time_free(dt1, env);
+        axutil_date_time_free(dt2, env);
         return AXIS2_FAILURE;
     }
 
     /*dt1<dt2 for SUCCESS*/
     res = axutil_date_time_compare(dt1, env, dt2);
-       axutil_date_time_free(dt1, env);
-       axutil_date_time_free(dt2, env);
+    axutil_date_time_free(dt1, env);
+    axutil_date_time_free(dt2, env);
     if(AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED == res){
         return AXIS2_SUCCESS;
     }else{


Reply via email to