Author: pini
Date: Fri Mar 30 07:05:45 2007
New Revision: 524092
URL: http://svn.apache.org/viewvc?view=rev&rev=524092
Log:
Fixing jira issue 292
Modified:
webservices/rampart/trunk/c/src/omxmlsec/axis2_utils.c
webservices/rampart/trunk/c/src/omxmlsec/encryption.c
webservices/rampart/trunk/c/src/omxmlsec/openssl/digest.c
webservices/rampart/trunk/c/src/omxmlsec/openssl/pem.c
webservices/rampart/trunk/c/src/omxmlsec/openssl/util.c
webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c
webservices/rampart/trunk/c/src/omxmlsec/signature.c
webservices/rampart/trunk/c/src/util/rampart_crypto_util.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_util.c
webservices/rampart/trunk/c/test/util/test_sha.c
webservices/rampart/trunk/c/test/util/test_util.c
Modified: webservices/rampart/trunk/c/src/omxmlsec/axis2_utils.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/axis2_utils.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/axis2_utils.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/axis2_utils.c Fri Mar 30 07:05:45
2007
@@ -26,9 +26,9 @@
oxs_buffer_t *out_buf = NULL;
int ret, length;
- length = axis2_base64_decode_len((char*)(oxs_buffer_get_data(coded_buf,
env)));
- plain_str = AXIS2_MALLOC(env->allocator,
axis2_base64_decode_len((char*)(oxs_buffer_get_data(coded_buf, env))));
- ret = axis2_base64_decode(plain_str,
(char*)(oxs_buffer_get_data(coded_buf, env)));
+ length = axutil_base64_decode_len((char*)(oxs_buffer_get_data(coded_buf,
env)));
+ plain_str = AXIS2_MALLOC(env->allocator,
axutil_base64_decode_len((char*)(oxs_buffer_get_data(coded_buf, env))));
+ ret = axutil_base64_decode(plain_str,
(char*)(oxs_buffer_get_data(coded_buf, env)));
if (ret < 0) return NULL;
out_buf = oxs_string_to_buffer(env, plain_str);
return out_buf;
@@ -42,9 +42,9 @@
int ret;
- encoded_str = AXIS2_MALLOC(env->allocator, (unsigned
int)axis2_base64_encode_len(axis2_strlen((char*)(plain_buf->data))));
+ encoded_str = AXIS2_MALLOC(env->allocator, (unsigned
int)axutil_base64_encode_len(axis2_strlen((char*)(plain_buf->data))));
- ret = axis2_base64_encode(encoded_str, (char*)(plain_buf->data),
plain_buf->size);
+ ret = axutil_base64_encode(encoded_str, (char*)(plain_buf->data),
plain_buf->size);
if (ret < 0) return NULL;
/*Set to the output buffer */
Modified: webservices/rampart/trunk/c/src/omxmlsec/encryption.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/encryption.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/encryption.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/encryption.c Fri Mar 30 07:05:45
2007
@@ -106,13 +106,13 @@
return AXIS2_FAILURE;
}
- encodedlen = axis2_base64_encode_len(enclen);
+ encodedlen = axutil_base64_encode_len(enclen);
encoded_str = AXIS2_MALLOC(env->allocator, encodedlen);
- ret = axis2_base64_encode_binary(encoded_str,
oxs_buffer_get_data(output, env), enclen);
+ ret = axutil_base64_encode_binary(encoded_str,
oxs_buffer_get_data(output, env), enclen);
if (ret < 0)
{
oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
- "axis2_base64_encode_binary failed");
+ "axutil_base64_encode_binary failed");
return AXIS2_FAILURE;
}
@@ -135,12 +135,12 @@
decoded_buf = oxs_buffer_create(env);
/*First we need to base64 decode*/
- decoded_data = AXIS2_MALLOC(env->allocator,
axis2_base64_decode_len((char*)oxs_buffer_get_data(input, env)));
- decoded_len = axis2_base64_decode_binary(decoded_data,
(char*)oxs_buffer_get_data(input, env) );
+ decoded_data = AXIS2_MALLOC(env->allocator,
axutil_base64_decode_len((char*)oxs_buffer_get_data(input, env)));
+ decoded_len = axutil_base64_decode_binary(decoded_data,
(char*)oxs_buffer_get_data(input, env) );
if (decoded_len < 0)
{
oxs_error(env, ERROR_LOCATION, OXS_ERROR_DECRYPT_FAILED,
- "axis2_base64_decode_binary failed");
+ "axutil_base64_decode_binary failed");
return AXIS2_FAILURE;
}
/*Populate decoded (input to the crypto function) buffer*/
@@ -224,9 +224,9 @@
/*Encrypt using the public key. Then base64 encode and populate the
buffer */
out_buf = oxs_buffer_create(env);
enclen = openssl_rsa_pub_encrypt(env, pkey, padding, input, out_buf);
- encodedlen = axis2_base64_encode_len(enclen);
+ encodedlen = axutil_base64_encode_len(enclen);
encoded_str = AXIS2_MALLOC(env->allocator, encodedlen);
- ret = axis2_base64_encode(encoded_str, (const char
*)oxs_buffer_get_data(out_buf, env), enclen);
+ ret = axutil_base64_encode(encoded_str, (const char
*)oxs_buffer_get_data(out_buf, env), enclen);
status = oxs_buffer_populate(result, env, (unsigned
char*)axis2_strdup(env, encoded_str), encodedlen);
/*Free*/
@@ -244,8 +244,8 @@
/*Operation id PRV DECRYPT; Get the private key from the context*/
pkey = oxs_asym_ctx_get_private_key(ctx, env);
/*Base64 decode first. Then do the decryption and populate the buffer*/
- decoded_encrypted_str = AXIS2_MALLOC(env->allocator,
axis2_base64_decode_len((char*)oxs_buffer_get_data(input, env)));
- ret = axis2_base64_decode((char*)decoded_encrypted_str,
(char*)oxs_buffer_get_data(input, env));
+ decoded_encrypted_str = AXIS2_MALLOC(env->allocator,
axutil_base64_decode_len((char*)oxs_buffer_get_data(input, env)));
+ ret = axutil_base64_decode((char*)decoded_encrypted_str,
(char*)oxs_buffer_get_data(input, env));
dec_enc_buf = oxs_buffer_create(env);
oxs_buffer_populate(dec_enc_buf, env, decoded_encrypted_str, ret);
declen = openssl_rsa_prv_decrypt(env, pkey, padding, dec_enc_buf,
result);
Modified: webservices/rampart/trunk/c/src/omxmlsec/openssl/digest.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/openssl/digest.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/openssl/digest.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/openssl/digest.c Fri Mar 30
07:05:45 2007
@@ -19,7 +19,7 @@
#include <openssl/sha.h>
#include <openssl/md5.h>
#include <openssl_digest.h>
-#include <axis2_base64.h>
+#include <axutil_base64.h>
#include <axis2_util.h>
#define SIZE_HASH 32
@@ -37,8 +37,8 @@
SHA1_Update(&c,(unsigned char*)input,length);
SHA1_Final(md,&c);
- encoded_str = AXIS2_MALLOC(env->allocator,
axis2_base64_encode_len(SIZE_HASH));
- axis2_base64_encode(encoded_str, (char*)md, SHA_DIGEST_LENGTH);
+ encoded_str = AXIS2_MALLOC(env->allocator,
axutil_base64_encode_len(SIZE_HASH));
+ axutil_base64_encode(encoded_str, (char*)md, SHA_DIGEST_LENGTH);
AXIS2_LOG_INFO(env->log, "[openssl][sha1-output]\n\n%s\n\n", encoded_str);
return encoded_str;
@@ -58,7 +58,7 @@
MD5_Final(md, &ctx);
encoded_str = AXIS2_MALLOC(env->allocator, MD5_DIGEST_LENGTH);
- axis2_base64_encode(encoded_str, (char*)md, MD5_DIGEST_LENGTH);
+ axutil_base64_encode(encoded_str, (char*)md, MD5_DIGEST_LENGTH);
return encoded_str;
}
Modified: webservices/rampart/trunk/c/src/omxmlsec/openssl/pem.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/openssl/pem.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/openssl/pem.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/openssl/pem.c Fri Mar 30 07:05:45
2007
@@ -45,7 +45,7 @@
int ret = 0;
int decode_len = 0;
- decode_len = axis2_base64_decode_len(b64_encoded_buf);
+ decode_len = axutil_base64_decode_len(b64_encoded_buf);
buff = AXIS2_MALLOC(env->allocator, decode_len + 1000);
ilen = axis2_strlen(b64_encoded_buf);
Modified: webservices/rampart/trunk/c/src/omxmlsec/openssl/util.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/openssl/util.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/openssl/util.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/openssl/util.c Fri Mar 30 07:05:45
2007
@@ -45,9 +45,9 @@
int encodedlen;
axis2_char_t *encoded_str = NULL;
- encodedlen = axis2_base64_encode_len(size);
+ encodedlen = axutil_base64_encode_len(size);
encoded_str = AXIS2_MALLOC(env->allocator, encodedlen);
- ret = axis2_base64_encode(encoded_str, (const char *)temp_buffer, size);
+ ret = axutil_base64_encode(encoded_str, (const char *)temp_buffer, size);
status = oxs_buffer_populate(buffer, env, (unsigned char*)encoded_str,
size);
AXIS2_FREE(env->allocator, encoded_str);
encoded_str = NULL;
Modified: webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c Fri Mar 30 07:05:45
2007
@@ -62,16 +62,16 @@
/* int len = 0;*/
/* int ret = 0;*/
- decode_len = axis2_base64_decode_len(formatted_buf );
+ decode_len = axutil_base64_decode_len(formatted_buf );
buff = AXIS2_MALLOC(env->allocator, decode_len);
ilen = axis2_strlen(formatted_buf);
- decoded_len = axis2_base64_decode_binary(buff,formatted_buf);
+ decoded_len = axutil_base64_decode_binary(buff,formatted_buf);
if (decoded_len < 0)
{
oxs_error(env, ERROR_LOCATION, OXS_ERROR_DECRYPT_FAILED,
- "axis2_base64_decode_binary failed");
+ "axutil_base64_decode_binary failed");
return AXIS2_FAILURE;
}
Modified: webservices/rampart/trunk/c/src/omxmlsec/signature.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/signature.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/signature.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/signature.c Fri Mar 30 07:05:45
2007
@@ -54,9 +54,9 @@
}
/*Base64 encode*/
- encodedlen = axis2_base64_encode_len(signedlen);
+ encodedlen = axutil_base64_encode_len(signedlen);
encoded_str = AXIS2_MALLOC(env->allocator, encodedlen);
- ret = axis2_base64_encode(encoded_str, (const char
*)oxs_buffer_get_data(signed_result_buf, env), signedlen);
+ ret = axutil_base64_encode(encoded_str, (const char
*)oxs_buffer_get_data(signed_result_buf, env), signedlen);
status = oxs_buffer_populate(output, env, (unsigned
char*)axis2_strdup(env, encoded_str), encodedlen);
/*Free signed_result_buf*/
@@ -113,12 +113,12 @@
/*Base64 decode the signature value and create the sig buffer*/
/*Allocate enough space*/
- decoded_data = AXIS2_MALLOC(env->allocator,
axis2_base64_decode_len(signature));
- decoded_len = axis2_base64_decode_binary(decoded_data, signature );
+ decoded_data = AXIS2_MALLOC(env->allocator,
axutil_base64_decode_len(signature));
+ decoded_len = axutil_base64_decode_binary(decoded_data, signature );
if (decoded_len < 0)
{
oxs_error(env, ERROR_LOCATION, OXS_ERROR_SIG_VERIFICATION_FAILED,
- "axis2_base64_decode_binary failed");
+ "axutil_base64_decode_binary failed");
return AXIS2_FAILURE;
}
Modified: webservices/rampart/trunk/c/src/util/rampart_crypto_util.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_crypto_util.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_crypto_util.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_crypto_util.c Fri Mar 30
07:05:45 2007
@@ -22,7 +22,7 @@
#include <stdio.h>
#include <rampart_crypto_util.h>
#include <axis2_util.h>
-#include <axis2_base64.h>
+#include <axutil_base64.h>
#include <openssl_digest.h>
/*Calculate the hash of concatenated string of
@@ -43,9 +43,9 @@
/*Decode the nonce first*/
if(nonce){
int ret;
- decoded_nonce_length = axis2_base64_decode_len(nonce);
- decoded_nonce = AXIS2_MALLOC(env->allocator,
axis2_base64_decode_len(nonce));
- ret = axis2_base64_decode(decoded_nonce, nonce);
+ decoded_nonce_length = axutil_base64_decode_len(nonce);
+ decoded_nonce = AXIS2_MALLOC(env->allocator,
axutil_base64_decode_len(nonce));
+ ret = axutil_base64_decode(decoded_nonce, nonce);
}
if ((!nonce) && (!created))
Modified: webservices/rampart/trunk/c/src/util/rampart_token_builder.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_token_builder.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_token_builder.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_token_builder.c Fri Mar 30
07:05:45 2007
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <rampart_util.h>
#include <axis2_util.h>
-#include <axis2_base64.h>
+#include <axutil_base64.h>
#include <oxs_buffer.h>
#include <rampart_constants.h>
#include <rampart_token_builder.h>
Modified: webservices/rampart/trunk/c/src/util/rampart_token_processor.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_token_processor.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_token_processor.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_token_processor.c Fri Mar 30
07:05:45 2007
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <rampart_util.h>
#include <axis2_util.h>
-#include <axis2_base64.h>
+#include <axutil_base64.h>
#include <oxs_buffer.h>
#include <rampart_constants.h>
#include <oxs_constants.h>
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?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_util.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_util.c Fri Mar 30 07:05:45 2007
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <rampart_util.h>
#include <axis2_util.h>
-#include <axis2_base64.h>
+#include <axutil_base64.h>
#include <axis2_property.h>
#include <time.h>
#include <oxs_buffer.h>
@@ -182,7 +182,7 @@
status = generate_random_data(env, buffer, 16);
rand_str = (char*)oxs_buffer_get_data(buffer, env);
encoded_str = AXIS2_MALLOC(env->allocator, sizeof(char) * (SIZE_NONCE+1));
- axis2_base64_encode(encoded_str, rand_str, oxs_buffer_get_size(buffer,
env));
+ axutil_base64_encode(encoded_str, rand_str, oxs_buffer_get_size(buffer,
env));
oxs_buffer_free(buffer, env);
return encoded_str;
Modified: webservices/rampart/trunk/c/test/util/test_sha.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/test/util/test_sha.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/test/util/test_sha.c (original)
+++ webservices/rampart/trunk/c/test/util/test_sha.c Fri Mar 30 07:05:45 2007
@@ -2,7 +2,7 @@
#include <rampart_util.h>
#include <rampart_crypto_util.h>
#include <axis2_util.h>
-#include <axis2_base64.h>
+#include <axutil_base64.h>
axis2_env_t *test_init()
{
@@ -36,7 +36,7 @@
encodedStr = AXIS2_MALLOC(env->allocator, 20);
- axis2_base64_encode_binary(encodedStr, hash, 20);
+ axutil_base64_encode_binary(encodedStr, hash, 20);
printf("Hash = %s \n", encodedStr);
#endif
Modified: webservices/rampart/trunk/c/test/util/test_util.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/test/util/test_util.c?view=diff&rev=524092&r1=524091&r2=524092
==============================================================================
--- webservices/rampart/trunk/c/test/util/test_util.c (original)
+++ webservices/rampart/trunk/c/test/util/test_util.c Fri Mar 30 07:05:45 2007
@@ -2,7 +2,7 @@
#include <rampart_util.h>
#include <rampart_crypto_util.h>
#include <axis2_util.h>
-#include <axis2_base64.h>
+#include <axutil_base64.h>
#include <axis2_date_time.h>
axis2_env_t *test_init()