You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ka...@apache.org on 2006/10/19 15:23:21 UTC

svn commit: r465618 - in /webservices/axis2/trunk/c: rampart/include/rampart_crypto_util.h rampart/samples/client/echo/data/un_ts.axis2.xml rampart/samples/client/echo/echo.c rampart/src/util/rampart_crypto_util.c samples/client/math/math_client.c

Author: kaushalye
Date: Thu Oct 19 06:23:21 2006
New Revision: 465618

URL: http://svn.apache.org/viewvc?view=rev&rev=465618
Log:
Changed the digest  calculation

Modified:
    webservices/axis2/trunk/c/rampart/include/rampart_crypto_util.h
    webservices/axis2/trunk/c/rampart/samples/client/echo/data/un_ts.axis2.xml
    webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c
    webservices/axis2/trunk/c/rampart/src/util/rampart_crypto_util.c
    webservices/axis2/trunk/c/samples/client/math/math_client.c

Modified: webservices/axis2/trunk/c/rampart/include/rampart_crypto_util.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart_crypto_util.h?view=diff&rev=465618&r1=465617&r2=465618
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart_crypto_util.h (original)
+++ webservices/axis2/trunk/c/rampart/include/rampart_crypto_util.h Thu Oct 19 06:23:21 2006
@@ -14,7 +14,7 @@
  *   limitations under the License.
  */
 
-#include<openssl/sha.h>
+#include <openssl/sha.h>
 
 #include <axis2_utils_defines.h>
 #include <axis2_defines.h>

Modified: webservices/axis2/trunk/c/rampart/samples/client/echo/data/un_ts.axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/samples/client/echo/data/un_ts.axis2.xml?view=diff&rev=465618&r1=465617&r2=465618
==============================================================================
--- webservices/axis2/trunk/c/rampart/samples/client/echo/data/un_ts.axis2.xml (original)
+++ webservices/axis2/trunk/c/rampart/samples/client/echo/data/un_ts.axis2.xml Thu Oct 19 06:23:21 2006
@@ -25,7 +25,7 @@
         <user>Gampola</user>
         <passwordType>passwordText</passwordType>
         <!--Following shoud change with your DLL or SO path-->
-        <passwordCallbackClass>/home/kau/axis2/c/deploy/rampart/samples/callback/libpwcb.so</passwordCallbackClass>
+        <passwordCallbackClass>/home/kau/axis2/c/deploy/bin/samples/rampart/callback/libpwcb.so</passwordCallbackClass>
         <timeToLive>360</timeToLive>
       </action>
     </parameter>
@@ -35,7 +35,7 @@
       <action>
         <items>UsernameToken Timestamp</items>
         <!--Following shoud change with your DLL or SO path-->
-        <passwordCallbackClass>/home/kau/axis2/c/deploy/rampart/samples/callback/libpwcb.so</passwordCallbackClass>
+        <passwordCallbackClass>/home/kau/axis2/c/deploy/bin/samples/rampart/callback/libpwcb.so</passwordCallbackClass>
       </action>
     </parameter>
     <!--Rampart configurations END -->

Modified: webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c?view=diff&rev=465618&r1=465617&r2=465618
==============================================================================
--- webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c (original)
+++ webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c Thu Oct 19 06:23:21 2006
@@ -22,7 +22,7 @@
 #include <rampart_constants.h>
 
 /*Enable following line to setup dynamic values*/
-/*#define DYN_SETTINGS 1*/
+#define DYN_SETTINGS 1
 
 axiom_node_t *
 build_om_payload_for_echo_svc(const axis2_env_t *env);

Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_crypto_util.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_crypto_util.c?view=diff&rev=465618&r1=465617&r2=465618
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_crypto_util.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_crypto_util.c Thu Oct 19 06:23:21 2006
@@ -35,9 +35,11 @@
         const axis2_char_t *password)
 
 {
-    axis2_char_t *result = NULL;
     char* input = NULL;
     axis2_char_t* encoded_str = NULL;
+    SHA_CTX c ;
+    unsigned char md[SHA_DIGEST_LENGTH];
+
 
     if ((!nonce) && (!created))
     {/*If both nonce and created are omitted*/
@@ -59,16 +61,15 @@
         input = AXIS2_MALLOC(env->allocator, AXIS2_STRLEN(nonce) + AXIS2_STRLEN(created) + AXIS2_STRLEN(password) + 1);
         sprintf(input, "%s%s%s", nonce, created, password);
     }
-    result = AXIS2_MALLOC(env->allocator, SHA_DIGEST_LENGTH + 1);
-
-    SHA1((unsigned char*)input, SHA_DIGEST_LENGTH, (unsigned char*)result);
-    result[SHA_DIGEST_LENGTH] = '\0';
+    
+    SHA1_Init(&c);
+    SHA1_Update(&c,(unsigned char*)input,AXIS2_STRLEN(input));
+    SHA1_Final(md,&c);
 
     encoded_str = AXIS2_MALLOC(env->allocator, axis2_base64_encode_len(SIZE_HASH));
-    axis2_base64_encode(encoded_str, result, AXIS2_STRLEN(result));
-
+    axis2_base64_encode(encoded_str, (char*)md, SHA_DIGEST_LENGTH);
+    
     AXIS2_FREE(env->allocator, input);
-    AXIS2_FREE(env->allocator, result);
-
+    
     return encoded_str;
 }

Modified: webservices/axis2/trunk/c/samples/client/math/math_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/math/math_client.c?view=diff&rev=465618&r1=465617&r2=465618
==============================================================================
--- webservices/axis2/trunk/c/samples/client/math/math_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/math/math_client.c Thu Oct 19 06:23:21 2006
@@ -108,6 +108,7 @@
                 AXIOM_OUTPUT_FREE(om_output, env);
                 om_output = NULL;
             }
+            AXIOM_XML_WRITER_FREE(writer, env);
         }
     }
     else



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