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 ka...@apache.org on 2007/09/05 09:14:59 UTC

svn commit: r572892 - in /webservices/rampart/trunk/c: configure.ac samples/configure.ac src/util/rampart_encryption.c src/util/rampart_sec_header_builder.c src/util/rampart_sec_header_processor.c

Author: kaushalye
Date: Wed Sep  5 00:14:58 2007
New Revision: 572892

URL: http://svn.apache.org/viewvc?rev=572892&view=rev
Log:
Fixing error messages.
Change the released version to 1.0.0

Modified:
    webservices/rampart/trunk/c/configure.ac
    webservices/rampart/trunk/c/samples/configure.ac
    webservices/rampart/trunk/c/src/util/rampart_encryption.c
    webservices/rampart/trunk/c/src/util/rampart_sec_header_builder.c
    webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c

Modified: webservices/rampart/trunk/c/configure.ac
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/configure.ac?rev=572892&r1=572891&r2=572892&view=diff
==============================================================================
--- webservices/rampart/trunk/c/configure.ac (original)
+++ webservices/rampart/trunk/c/configure.ac Wed Sep  5 00:14:58 2007
@@ -2,7 +2,7 @@
 
 AC_PREREQ(2.59)
 
-AC_INIT(rampartc-src, 0.91)
+AC_INIT(rampartc-src, 1.0.0)
 AC_CANONICAL_SYSTEM
 AM_CONFIG_HEADER(config.h)
 dnl AM_INIT_AUTOMAKE([tar-ustar])

Modified: webservices/rampart/trunk/c/samples/configure.ac
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/samples/configure.ac?rev=572892&r1=572891&r2=572892&view=diff
==============================================================================
--- webservices/rampart/trunk/c/samples/configure.ac (original)
+++ webservices/rampart/trunk/c/samples/configure.ac Wed Sep  5 00:14:58 2007
@@ -2,7 +2,7 @@
 
 AC_PREREQ(2.59)
 
-AC_INIT(rampart-samples-src, 0.90)
+AC_INIT(rampart-samples-src, 1.0.0)
 AC_CANONICAL_SYSTEM
 AM_CONFIG_HEADER(config.h)
 dnl AM_INIT_AUTOMAKE([tar-ustar])

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=572892&r1=572891&r2=572892&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_encryption.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_encryption.c Wed Sep  5 00:14:58 2007
@@ -107,7 +107,7 @@
 
     if(status != AXIS2_SUCCESS)
     {
-        AXIS2_LOG_INFO(env->log, 
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
             "[rampart][rampart_signature]Error occured in Adding Encrypted parts..");
         axutil_array_list_free(nodes_to_encrypt, env);
         nodes_to_encrypt = NULL;
@@ -131,7 +131,7 @@
             sig_node = oxs_axiom_get_node_by_local_name(env, sec_node, OXS_NODE_SIGNATURE);
             if(!sig_node)
             {
-                AXIS2_LOG_INFO(env->log, 
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                     "[rampart][rampart_encryption]Encrypting signature, Sigature Not found");
                 return AXIS2_FAILURE;
             }
@@ -151,14 +151,14 @@
     token_type = rp_property_get_type(token, env);
 
     if(!rampart_context_is_token_type_supported(token_type, env))
-    {    
-        AXIS2_LOG_INFO(env->log,
+    {   
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
             "[rampart][rampart_encryption]Specified token type not supported.");
         return AXIS2_FAILURE;
     }
     if(rampart_context_check_is_derived_keys(env,token))
     {
-        AXIS2_LOG_INFO(env->log,
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
             "[rampart][rampart_encryption]We still do not support derived keys");
         return AXIS2_FAILURE;
     }
@@ -179,6 +179,8 @@
     status = oxs_key_for_algo(session_key, env, enc_sym_algo);
     if(AXIS2_FAILURE == status)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                "[rampart][rampart_encryption] Cannot generate the key for the algorithm %s, ", enc_sym_algo);
         return AXIS2_FAILURE;
     }
 
@@ -208,6 +210,8 @@
                 (nodes_to_encrypt, env, i);
         if(!node_to_enc)
         {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                "[rampart][rampart_encryption] Cannot get the node from the list to encrypt");
             return AXIS2_FAILURE;
         }
         /*Create the encryption context for OMXMLSEC*/
@@ -229,6 +233,8 @@
             axutil_array_list_add(id_list, env, id);
             if(AXIS2_FAILURE == enc_status)
             {
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                    "[rampart][rampart_encryption] Cannot encrypt the node " );
                 return AXIS2_FAILURE;
             }
         }   
@@ -259,8 +265,8 @@
     }
     if(!eki)
     {
-        AXIS2_LOG_INFO(env->log, 
-            "[rampart][rampart_encryption]No mechanism for attaching the token.");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "[rampart][rampart_encryption] No mechanism for attaching the certificate info.");
         return AXIS2_FAILURE;
     }
 
@@ -316,8 +322,8 @@
                         (rampart_context, env);
                     if(!password_callback)
                     {
-                        AXIS2_LOG_INFO(env->log, 
-                            "[rampart][rampart_encryption]Password call back module is not loaded.");
+                        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                            "[rampart][rampart_encryption] Password call back module is not loaded.");
                         return AXIS2_FAILURE;
                     }
                     password = rampart_callback_password(env, password_callback, enc_user);
@@ -338,6 +344,8 @@
             sec_node, session_key, id_list);
     if(AXIS2_FAILURE == status)
     {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                            "[rampart][rampart_encryption] Session key encryption failed.");
         return AXIS2_FAILURE;
     }
 
@@ -396,7 +404,7 @@
         env, sec_node,  OXS_NODE_ENCRYPTED_KEY); 
     if(!encrypted_key_node)
     {
-        AXIS2_LOG_INFO(env->log, 
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
             "[rampart][rampart_encryption]Encrypting signature, EncryptedKey Not found");
         return AXIS2_FAILURE;
     }    
@@ -437,7 +445,7 @@
 
                 if(!reference_node)
                 {
-                    AXIS2_LOG_INFO(env->log, 
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
                         "[rampart][rampart_encryption]Encrypting signature, Reference Node build failed");
                     return AXIS2_FAILURE;
                 }
@@ -446,14 +454,23 @@
                     return AXIS2_SUCCESS;
                 }
             }
-            else
-                return AXIS2_FAILURE;
+            else{
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                        "[rampart][rampart_encryption]Encrypting signature, Cannot build the STR node");
+                    return AXIS2_FAILURE;
+                }
         }
-        else
-            return AXIS2_FAILURE;
+        else{
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                        "[rampart][rampart_encryption] Encrypting signature, cannot build the key indfo node");
+                return AXIS2_FAILURE;
+            }
     }
-    else 
+    else{ 
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                  "[rampart][rampart_encryption]Encrypting signature, Cannot get the encryption data element");
         return AXIS2_FAILURE;
+        }
 }
 
 

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=572892&r1=572891&r2=572892&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 Wed Sep  5 00:14:58 2007
@@ -121,7 +121,8 @@
                                                    sec_node, sec_ns_obj, ttl);
             if (status == AXIS2_FAILURE)
             {
-                AXIS2_LOG_INFO(env->log, "[rampart][shb] Timestamp Token build failed. ERROR");
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                    "[rampart][shb] Timestamp Token build failed. ERROR");
                 return AXIS2_FAILURE;
             }
         }
@@ -144,7 +145,8 @@
                             sec_ns_obj);
                 if (status == AXIS2_FAILURE)
                 {
-                    AXIS2_LOG_INFO(env->log, "[rampart][shb] UsernmaeToken build failed. ERROR");
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "[rampart][shb] UsernmaeToken build failed. ERROR");
                     return AXIS2_FAILURE;
                 }
             }
@@ -164,6 +166,8 @@
                 status = rampart_enc_encrypt_message(env, msg_ctx, rampart_context, soap_envelope, sec_node);
                 if(status != AXIS2_SUCCESS)
                 {
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "[rampart][shb] Encryption failed. ERROR");
                     return AXIS2_FAILURE;
                 }    
                 
@@ -172,6 +176,8 @@
                 status = rampart_enc_add_key_info(env, msg_ctx, rampart_context, soap_envelope, sec_node);
                 if(status != AXIS2_SUCCESS)
                 {
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "[rampart][shb] Cannot add Key information");
                     return AXIS2_FAILURE;
                 }
                 /*Then Sign the message*/
@@ -179,6 +185,8 @@
                 status = rampart_sig_sign_message(env, msg_ctx, rampart_context, soap_envelope, sec_node);
                 if(status != AXIS2_SUCCESS)
                 {    
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "[rampart][shb] Signing failed. ERROR");
                     return AXIS2_FAILURE;
                 }
 
@@ -187,6 +195,8 @@
                 status = rampart_enc_encrypt_signature(env, msg_ctx, rampart_context, soap_envelope, sec_node);
                 if(status != AXIS2_SUCCESS)
                 {
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "[rampart][shb] Encrypt signature failed. ERROR");
                     return AXIS2_FAILURE;
                 }    
             
@@ -194,14 +204,18 @@
             else
             {    
                 status = rampart_enc_encrypt_message(env, msg_ctx, rampart_context, soap_envelope, sec_node);
-                if(status != AXIS2_SUCCESS)
+                if(status != AXIS2_SUCCESS){
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "[rampart][shb] Encryption failed. ERROR");
                     return AXIS2_FAILURE;
-
+                }
                 /*Then do signature specific things*/
                 status = rampart_sig_sign_message(env, msg_ctx, rampart_context, soap_envelope, sec_node);
-                if(status != AXIS2_SUCCESS)
+                if(status != AXIS2_SUCCESS){
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "[rampart][shb] Signature failed. ERROR");
                     return AXIS2_FAILURE;
-
+                }
             }    
 
             /*Then Handle Supporting token stuff  */
@@ -211,14 +225,19 @@
             is_encrypt_before_sign = AXIS2_FALSE;
             /*First do signature specific stuff*/
             status = rampart_sig_sign_message(env, msg_ctx, rampart_context, soap_envelope, sec_node);
-            if(status != AXIS2_SUCCESS)
+            if(status != AXIS2_SUCCESS){
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "[rampart][shb] Signing failed. ERROR");
                 return AXIS2_FAILURE;
-
+            }
             /*Then Handle Encryption stuff*/
 
             status = rampart_enc_encrypt_message(env, msg_ctx, rampart_context, soap_envelope, sec_node);
-            if(status!=AXIS2_SUCCESS )
+            if(status!=AXIS2_SUCCESS ){
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "[rampart][shb] Encryption failed. ERROR");
                 return AXIS2_FAILURE;
+            }
         }
 
         /*If both encryption and signature is done we should interchange them.
@@ -255,7 +274,7 @@
                 enc_data_node = oxs_axiom_get_node_by_local_name(env, sec_node, OXS_NODE_ENCRYPTED_DATA);
                 if(!enc_data_node)
                 {
-                    AXIS2_LOG_INFO(env->log,"[rampart][shb]Signature is not encrypted,");
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,"[rampart][shb]Signature is not encrypted,");
                     return AXIS2_FAILURE;
                 }
                 else
@@ -263,6 +282,7 @@
                     status = rampart_interchange_nodes(env, enc_key_node, enc_data_node);
                     if(status != AXIS2_SUCCESS)
                     {
+                        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,"[rampart][shb]Cannot interchange enc_key and enc_data nodes");
                         return AXIS2_FAILURE;
                     }    
                 }    
@@ -274,7 +294,7 @@
     else if((rampart_context_get_binding_type(rampart_context,env)) == RP_PROPERTY_SYMMETRIC_BINDING)
     {
         /*Do Symmetric_binding specific things*/
-        AXIS2_LOG_INFO(env->log, "[rampart][shb] Symmetric Binding. We do not support yet");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shb] Symmetric Binding. We do not support yet");
         return AXIS2_FAILURE;
     }
     else if((rampart_context_get_binding_type(rampart_context,env)) == RP_PROPERTY_TRANSPORT_BINDING)
@@ -294,7 +314,7 @@
                                                    sec_node, sec_ns_obj, ttl);
             if (status == AXIS2_FAILURE)
             {
-                AXIS2_LOG_INFO(env->log, "[rampart][shb] Timestamp Token build failed. ERROR");
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shb] Timestamp Token build failed. ERROR");
                 return AXIS2_FAILURE;
             }
         }
@@ -317,7 +337,7 @@
                             sec_ns_obj);
                 if (status == AXIS2_FAILURE)
                 {
-                    AXIS2_LOG_INFO(env->log, "[rampart][shb] UsernmaeToken build failed. ERROR");
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shb] UsernmaeToken build failed. ERROR");
                     return AXIS2_FAILURE;
                 }
             }
@@ -325,6 +345,7 @@
         }
         return status;
     }
-    else
+    else{
         return AXIS2_FAILURE;
+    }        
 }

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=572892&r1=572891&r2=572892&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 Wed Sep  5 00:14:58 2007
@@ -144,7 +144,7 @@
     {
         if(rampart_context_is_include_timestamp(rampart_context,env))
         {
-            AXIS2_LOG_INFO(env->log, "[rampart][shp] Timestamp is not in the message");
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shp] Timestamp is not in the message");
             return AXIS2_FAILURE;
         }else{
             return AXIS2_SUCCESS;
@@ -152,14 +152,14 @@
     }
     else if(!rampart_context_is_include_timestamp(rampart_context,env))
     {
-        AXIS2_LOG_INFO(env->log, "[rampart][shp] Timestamp should not be in the message.");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shp] Timestamp should not be in the message.");
         return AXIS2_FAILURE;
     }
     else
     {
         if(!rampart_shp_validate_qnames(env,ts_node))
         {
-            AXIS2_LOG_INFO(env->log, "[rampart][shp] Error in the security header");
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shp] Error in the security header");
             return AXIS2_FAILURE;
         }
 
@@ -168,7 +168,7 @@
 
         if (valid_ts)
         {
-            AXIS2_LOG_INFO(env->log, "[rampart][scp] Validating Timestamp is SUCCESS ");
+            AXIS2_LOG_INFO(env->log, "[rampart][scp] Succesfully validated the timestamp ");
             return AXIS2_SUCCESS;
         }
         else
@@ -194,7 +194,7 @@
     {
         if(rampart_context_is_include_username_token(rampart_context,env))
         {
-            AXIS2_LOG_INFO(env->log, "[rampart][shp] Username token is not in the message");
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shp] Username token is not in the message");
             return AXIS2_FAILURE;
         }
         else
@@ -202,14 +202,14 @@
     }
     else if(!rampart_context_is_include_username_token(rampart_context,env))
     {
-        AXIS2_LOG_INFO(env->log, "[rampart][shp] Username token should not be in the message.");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shp] Username token should not be in the message.");
         return AXIS2_FAILURE;
     }
     else
     {
         if(!rampart_shp_validate_qnames(env,ut_node))
         {
-            AXIS2_LOG_INFO(env->log, "[rampart][shp] Error in the security header");
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shp] Error in validating qnames for the username token");
             return AXIS2_FAILURE;
         }
 
@@ -222,7 +222,7 @@
         AXIS2_LOG_INFO(env->log, "[rampart][shp] Validating UsernameToken SUCCESS");
         return AXIS2_SUCCESS;
     }else{
-        AXIS2_LOG_INFO(env->log, "[rampart][shp] Validating UsernameToken FAILED");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][shp] Validating UsernameToken FAILED");
         rampart_create_fault_envelope(env, RAMPART_FAULT_FAILED_AUTHENTICATION, "UsernameToken is not valid", RAMPART_FAULT_IN_USERNAMETOKEN, msg_ctx);
         return AXIS2_FAILURE;
     }