axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kausha...@apache.org
Subject svn commit: r493974 - in /webservices/axis2/trunk/c/rampart: include/ samples/client/enc_echo/ src/omxmlsec/ src/omxmlsec/openssl/ src/omxmlsec/tokens/ src/util/
Date Mon, 08 Jan 2007 07:38:47 GMT
Author: kaushalye
Date: Sun Jan  7 23:38:44 2007
New Revision: 493974

URL: http://svn.apache.org/viewvc?view=rev&rev=493974
Log:
Modified OMXMLSecurity to use the log mechanism available under axis2.
JIRA https://issues.apache.org/jira/browse/AXIS2C-495


Modified:
    webservices/axis2/trunk/c/rampart/include/openssl_pem.h
    webservices/axis2/trunk/c/rampart/include/oxs_asym_ctx.h
    webservices/axis2/trunk/c/rampart/include/oxs_error.h
    webservices/axis2/trunk/c/rampart/samples/client/enc_echo/echo.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/asym_ctx.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/axiom.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/buffer.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/cipher.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/encryption.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/error.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/iv.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/key_mgr.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pem.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pkey.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/rsa.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/util.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/x509.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_binary_security_token.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_data.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_value.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_data_reference.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_embedded.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encrypted_data.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encrypted_key.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encryption_method.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_identifier.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_info.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_name.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_reference.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_reference_list.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_security_token_reference.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_data.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_issuer_name.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_issuer_serial.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_serial_number.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_encryption.c
    webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_processor.c

Modified: webservices/axis2/trunk/c/rampart/include/openssl_pem.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/openssl_pem.h?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/openssl_pem.h (original)
+++ webservices/axis2/trunk/c/rampart/include/openssl_pem.h Sun Jan  7 23:38:44 2007
@@ -46,6 +46,12 @@
     OPENSSL_PEM_PKEY_TYPE_UNKNOWN 
 } openssl_pem_pkey_type_t;
 
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+openssl_pem_buf_read_pkey(const axis2_env_t *env,
+    axis2_char_t *b64_encoded_buf,
+    axis2_char_t *password,
+    openssl_pem_pkey_type_t type,
+    EVP_PKEY **pkey);
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 openssl_pem_read_pkey(const axis2_env_t *env,

Modified: webservices/axis2/trunk/c/rampart/include/oxs_asym_ctx.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_asym_ctx.h?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_asym_ctx.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_asym_ctx.h Sun Jan  7 23:38:44 2007
@@ -88,6 +88,14 @@
                     const axis2_env_t *env);
 
 /**
+*@ctx pointer to the OMXMLSec asymmetric context struct
+*@env pointer to environment struct
+*@return AXIS2_SUCCESS on success, else AXIS2_FAILURE	
+*/	
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_asym_ctx_get_der_buf(const oxs_asym_ctx_t *ctx,
+                    const axis2_env_t *env);
+/**
 *Returns the password. Usually the password for the keystore. But alternatively may kepe the
 *password for the private key in a PEM file.
 *@ctx pointer to the OMXMLSec asymmetric context struct

Modified: webservices/axis2/trunk/c/rampart/include/oxs_error.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_error.h?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_error.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_error.h Sun Jan  7 23:38:44 2007
@@ -101,7 +101,7 @@
  *
  */
 AXIS2_EXTERN void AXIS2_CALL
-oxs_error(const char* file, int line, const char* func,
+oxs_error(const axis2_env_t *env, const char* file, int line, const char* func,
         int code, const char* msg,...);
 
 /** @} */

Modified: webservices/axis2/trunk/c/rampart/samples/client/enc_echo/echo.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/samples/client/enc_echo/echo.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/samples/client/enc_echo/echo.c (original)
+++ webservices/axis2/trunk/c/rampart/samples/client/enc_echo/echo.c Sun Jan  7 23:38:44 2007
@@ -130,11 +130,11 @@
         printf("echo client invoke FAILED!\n");
     }
 
-    if (svc_client)
+    /*if (svc_client)
     {
         AXIS2_SVC_CLIENT_FREE(svc_client, env);
         svc_client = NULL;
-    }
+    }*/
     /*    if (endpoint_ref)
         {
             AXIS2_ENDPOINT_REF_FREE(endpoint_ref, env);

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/asym_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/asym_ctx.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/asym_ctx.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/asym_ctx.c Sun Jan  7 23:38:44 2007
@@ -24,6 +24,7 @@
 struct oxs_asym_ctx_t
 {
     axis2_char_t *file_name;
+    axis2_char_t *der_buf;
     axis2_char_t *password;
     axis2_char_t *algorithm;
     axis2_char_t *st_ref_pattern;
@@ -31,6 +32,7 @@
     oxs_asym_ctx_format_t format;   
     oxs_x509_cert_t *certificate;
     openssl_pkey_t *private_key;
+
 };
 
 
@@ -45,6 +47,13 @@
 }
 
 axis2_char_t *AXIS2_CALL
+oxs_asym_ctx_get_der_buf(
+    const oxs_asym_ctx_t *asym_ctx,
+    const axis2_env_t *env)
+{
+    return asym_ctx->der_buf;
+}
+axis2_char_t *AXIS2_CALL
 oxs_asym_ctx_get_password(
     const oxs_asym_ctx_t *asym_ctx,
     const axis2_env_t *env)
@@ -118,6 +127,22 @@
 }
 
 axis2_status_t AXIS2_CALL
+oxs_asym_ctx_set_der_buf(
+    oxs_asym_ctx_t *asym_ctx,
+    const axis2_env_t *env,
+    axis2_char_t *der_buf)
+{
+
+    if (asym_ctx->der_buf)
+    {
+        AXIS2_FREE(env->allocator, asym_ctx->der_buf);
+        asym_ctx->der_buf = NULL;
+    }
+    asym_ctx->der_buf = AXIS2_STRDUP(der_buf, env);
+    return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
 oxs_asym_ctx_set_password(
     oxs_asym_ctx_t *asym_ctx,
     const axis2_env_t *env,
@@ -235,6 +260,7 @@
     }
 
     asym_ctx->file_name= NULL;
+    asym_ctx->der_buf= NULL;
     asym_ctx->password= NULL;
     asym_ctx->format= -1;
     asym_ctx->algorithm = NULL;
@@ -257,6 +283,12 @@
     {
         AXIS2_FREE(env->allocator, asym_ctx->file_name);
         asym_ctx->file_name = NULL;
+    }
+
+    if (asym_ctx->der_buf)
+    {
+        AXIS2_FREE(env->allocator, asym_ctx->der_buf);
+        asym_ctx->der_buf = NULL;
     }
 
     if (asym_ctx->password)

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=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/axiom.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/axiom.c Sun Jan  7 23:38:44 2007
@@ -47,7 +47,7 @@
     parent_ele = AXIOM_NODE_GET_DATA_ELEMENT(parent, env);
     if (!parent_ele)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "Cannot find %s element", local_name);
         return -1;
     }
@@ -176,7 +176,7 @@
     parent_ele = AXIOM_NODE_GET_DATA_ELEMENT(parent, env);
     if (!parent_ele)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "Cannot find %s element", local_name);
         return NULL;
     }
@@ -189,7 +189,7 @@
     parent_name = AXIOM_NODE_TO_STRING(parent, env);
     if (!node)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "Cannot find child %s of %s", local_name, parent_name);
         return NULL;
     }
@@ -223,7 +223,7 @@
 
     if (!buffer)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "buffer is NULL");
         return NULL;
     }
@@ -232,7 +232,7 @@
 
     if (!reader)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "axiom_xml_reader is NULL");
         return NULL;
     }
@@ -240,7 +240,7 @@
     builder = axiom_stax_builder_create(env, reader);
     if (!builder)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "axiom_stax_builder is NULL");
         return NULL;
     }
@@ -248,14 +248,14 @@
     doc = axiom_document_create(env, NULL, builder);
     if (!doc)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "axiom_document is NULL");
         return NULL;
     }
     node = AXIOM_DOCUMENT_BUILD_ALL(doc, env);
     if (!node)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "Building node failed");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/buffer.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/buffer.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/buffer.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/buffer.c Sun Jan  7 23:38:44 2007
@@ -174,7 +174,7 @@
     status = oxs_buffer_set_max_size(&(buffer_impl->buffer), env, OXS_BUFFER_INITIAL_SIZE);
     if (status == AXIS2_FAILURE)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
                 "oxs_buffer_set_max_size");
         return NULL;
     }
@@ -241,7 +241,7 @@
     {
         if (!buffer_impl->data)
         {
-            oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "oxs_buffer_remove_head failed. data is NULL");
             return  AXIS2_FAILURE;
         }
@@ -258,7 +258,7 @@
     {
         if (!buffer_impl->data)
         {
-            oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "oxs_buffer_remove_head failed");
             return  AXIS2_FAILURE;
         }
@@ -292,7 +292,7 @@
     {
         if (buffer_impl->data)
         {
-            oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "");
             return  AXIS2_FAILURE;
         }
@@ -321,7 +321,7 @@
         oxs_buffer_set_max_size(&(buffer_impl->buffer), env, size);
         if (!data)
         {
-            oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "data is NULL");
             return AXIS2_FAILURE;
         }
@@ -351,7 +351,7 @@
         oxs_buffer_set_max_size(&(buffer_impl->buffer), env,  buffer_impl->size + size);
         if (!data)
         {
-            oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "data is NULL");
             return AXIS2_FAILURE;
         }
@@ -380,7 +380,7 @@
     {
         if (!data)
         {
-            oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "Passed data is NULL");
             return AXIS2_FAILURE;
         }
@@ -415,7 +415,7 @@
     f = fopen(filename, "rb");
     if (f == NULL)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "");
         return AXIS2_FAILURE;
     }
@@ -436,7 +436,7 @@
         if (status == AXIS2_FAILURE)
         {
             fclose(f);
-            oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "");
             return AXIS2_FAILURE;
         }
@@ -466,7 +466,7 @@
     status = oxs_buffer_set_max_size(buffer, env,  size);
     if (status == AXIS2_FAILURE)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "oxs_buffer_set_max_size failed");
         return AXIS2_FAILURE;
     }
@@ -532,7 +532,7 @@
 
     if (new_data == NULL)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "");
         return AXIS2_FAILURE;
     }
@@ -544,7 +544,7 @@
     {
         if (buffer_impl->data == NULL)
         {
-            oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "");
             return AXIS2_FAILURE;
         }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/cipher.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/cipher.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/cipher.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/cipher.c Sun Jan  7 23:38:44 2007
@@ -36,7 +36,7 @@
 
     cipher_name = oxs_get_cipher_name_for_url(env, url);
     if((!cipher_name) || (0 == AXIS2_STRCMP(cipher_name, ""))){
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                         OXS_ERROR_INVALID_DATA, "Cannot populate cipher property");
         return NULL;
     }
@@ -45,7 +45,7 @@
     ret = openssl_populate_cipher_property(env, cprop);
     if (ret == AXIS2_FAILURE)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_INVALID_DATA, "Cannot populate cipher property");
         return NULL;
 
@@ -82,7 +82,7 @@
     }
     else
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_UNSUPPORTED_ALGO, "Algorithm not supported");
         return NULL;
     }
@@ -119,7 +119,7 @@
     }
     else
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_INVALID_DATA, "Name not supported");
         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=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/encryption.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/encryption.c Sun Jan  7 23:38:44 2007
@@ -47,7 +47,7 @@
     /*Get cipher property*/
     cprop =  oxs_get_cipher_property_for_url(env, OXS_CTX_GET_ENC_MTD_ALGORITHM(enc_ctx, env));
     if(!cprop){
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "Cipher property is NULL");
         return AXIS2_FAILURE;
     }
@@ -62,7 +62,7 @@
     oc_ctx = openssl_cipher_ctx_create(env);
     if (!oc_ctx)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "openssl_cipher_ctx_create failed");
         return AXIS2_FAILURE;
     }
@@ -77,7 +77,7 @@
     cipher_name = (axis2_char_t*)OPENSSL_CIPHER_PROPERTY_GET_NAME(cprop, env);
     if (!cipher_name)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "oxs_get_cipher failed");
 
         return AXIS2_FAILURE;
@@ -102,7 +102,7 @@
         /*Encrypt*/
         enclen = openssl_bc_crypt(env, oc_ctx, input, output, OPENSSL_ENCRYPT);
         if(enclen < 0){
-            oxs_error(ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
                     "openssl_block_cipher_crypt FAILED");
             return AXIS2_FAILURE;
         }
@@ -112,7 +112,7 @@
         ret = axis2_base64_encode_binary(encoded_str, OXS_BUFFER_GET_DATA(output, env), enclen);
         if (ret < 0)
         {
-            oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "axis2_base64_encode_binary failed");
             return AXIS2_FAILURE;
         }
@@ -140,7 +140,7 @@
         decoded_len = axis2_base64_decode_binary(decoded_data, (char*)OXS_BUFFER_GET_DATA(input, env) );
         if (decoded_len < 0)
         {
-            oxs_error(ERROR_LOCATION, OXS_ERROR_DECRYPT_FAILED,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_DECRYPT_FAILED,
                     "axis2_base64_decode_binary failed");
             return AXIS2_FAILURE;
         }
@@ -150,7 +150,7 @@
         enclen = openssl_bc_crypt(env, oc_ctx, decoded_buf, result, OPENSSL_DECRYPT);
        
         if(enclen < 0){
-            oxs_error(ERROR_LOCATION, OXS_ERROR_DECRYPT_FAILED,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_DECRYPT_FAILED,
                     "openssl_block_cipher_crypt FAILED");
             return AXIS2_FAILURE;
         }
@@ -161,7 +161,7 @@
         decoded_data = NULL;
 
     }else{
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "Invalid operation type %d", OXS_CTX_GET_OPERATION(enc_ctx, env));
         return AXIS2_FAILURE;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/error.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/error.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/error.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/error.c Sun Jan  7 23:38:44 2007
@@ -27,9 +27,7 @@
 #define OXS_ERRORS_MAX_NUMBER 64
 static oxs_error_description oxs_errors_table[OXS_ERRORS_MAX_NUMBER] =
     {
-        {
-            OXS_ERROR_DEFAULT, "oxs defualt error"
-        },
+        {OXS_ERROR_DEFAULT, "oxs defualt error"},
         {OXS_ERROR_ENCRYPT_FAILED , "encryption failed" },
         {OXS_ERROR_DECRYPT_FAILED , "decryption failed"},
         {OXS_ERROR_INVALID_DATA , "invalid data"},
@@ -77,7 +75,7 @@
 }
 
 AXIS2_EXTERN void   AXIS2_CALL
-oxs_error(const char* file, int line, const char* func,
+oxs_error(const axis2_env_t *env, const char* file, int line, const char* func,
         int code, const char* msg, ...)
 {
     const char* error_msg = NULL;
@@ -90,7 +88,6 @@
     AXIS2_VSNPRINTF(value, AXIS2_LEN_VALUE, msg, ap);
     va_end(ap);
 
-    /*Should pass env to this method rather than creating a own one*/
-   /* AXIS2_LOG_INFO(env->log, "ERROR [%s:%d in %s] %s , %s", file, line, func, error_msg, value);     */
-    printf("\nERROR [%s:%d in %s] %s , %s\n", file, line, func, error_msg, value);
+    AXIS2_LOG_INFO(env->log, "OXS ERROR [%s:%d in %s] %s , %s", file, line, func, error_msg, value);     
+    printf("\nOXS ERROR [%s:%d in %s] %s , %s\n", file, line, func, error_msg, value);
 }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/iv.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/iv.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/iv.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/iv.c Sun Jan  7 23:38:44 2007
@@ -34,7 +34,7 @@
     cprop =  oxs_get_cipher_property_for_url(env, key_algo);
     if (!cprop)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
                 "openssl_get_cipher_property failed");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c Sun Jan  7 23:38:44 2007
@@ -344,7 +344,7 @@
     cprop = (openssl_cipher_property_t *)oxs_get_cipher_property_for_url(env, key_algo);
     if (!cprop)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
                 "openssl_get_cipher_property failed");
         return AXIS2_FAILURE;
     }
@@ -356,7 +356,7 @@
     ret = generate_random_data(env, key_buf, size);
     if (ret == AXIS2_FAILURE)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
                 "generate_random_data failed");
         return AXIS2_FAILURE;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/key_mgr.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/key_mgr.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/key_mgr.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/key_mgr.c Sun Jan  7 23:38:44 2007
@@ -27,6 +27,7 @@
     axis2_char_t *password)
 {
     axis2_char_t *filename = NULL;
+    axis2_char_t *der_buf = NULL;
     axis2_status_t status = AXIS2_FAILURE;
     openssl_x509_format_t format;
     openssl_pkey_t *open_prvkey = NULL;
@@ -38,48 +39,69 @@
     EVP_PKEY *prvkey = NULL;
     EVP_PKEY *pubkey = NULL;
 
-    /*Get file to be loaded. Can be either in PEM or PKCS12 format*/
-    filename = oxs_asym_ctx_get_file_name(ctx, env);
-    if(!filename){
-        return AXIS2_FAILURE;
-    }
+    /*If user has specified the certificate/private key directly we will extract the information from it.
+     * Else we will look for a file name to load the certificate/private key*/
+    der_buf = oxs_asym_ctx_get_der_buf(ctx, env);
+    if(der_buf){
+        if( OXS_ASYM_CTX_OPERATION_PUB_ENCRYPT == oxs_asym_ctx_get_operation(ctx, env) || 
+            OXS_ASYM_CTX_OPERATION_PUB_DECRYPT == oxs_asym_ctx_get_operation(ctx, env)){
+            /*load certificate from buf*/
+            status = openssl_x509_load_from_buffer(env, der_buf, &cert);
+        }else{
+            /*load private key from buf*/
+            status = openssl_pem_buf_read_pkey(env, der_buf, password, OPENSSL_PEM_PKEY_TYPE_PRIVATE_KEY, &prvkey); 
+            if(status == AXIS2_FAILURE){
+                prvkey = NULL;
+            }
+        }
+    }else{
 
-    if(OXS_ASYM_CTX_FORMAT_PEM == oxs_asym_ctx_get_format(ctx, env)){
-        oxs_asym_ctx_operation_t operation ;
-		format = OPENSSL_X509_FORMAT_PEM;
+        /*Get file to be loaded. Can be either in PEM or PKCS12 format*/
+        filename = oxs_asym_ctx_get_file_name(ctx, env);
+        if(!filename){
+            return AXIS2_FAILURE;
+        }
+
+        if(OXS_ASYM_CTX_FORMAT_PEM == oxs_asym_ctx_get_format(ctx, env)){
+            oxs_asym_ctx_operation_t operation ;
+		    format = OPENSSL_X509_FORMAT_PEM;
         
 
-        /*First let's check if this is a file containing a certificate*/
-        status = openssl_x509_load_from_pem(env, filename,  &cert);
+            /*First let's check if this is a file containing a certificate*/
+            status = openssl_x509_load_from_pem(env, filename,  &cert);
 
-        if((status == AXIS2_FAILURE) || (!cert)){/*>>*/
-            /*If we cannot get the certificate then the file might contain aither a public key or a private key*/
-            /*The type depends on the operation*/
-            operation = oxs_asym_ctx_get_operation(ctx, env);
-
-            if((operation == OXS_ASYM_CTX_OPERATION_PRV_DECRYPT) || (operation == OXS_ASYM_CTX_OPERATION_PRV_ENCRYPT)){
-                status = openssl_pem_read_pkey(env, filename, password, OPENSSL_PEM_PKEY_TYPE_PRIVATE_KEY, &prvkey);
-                if(status == AXIS2_FAILURE){
-                    prvkey = NULL;
-                }
-            } else if((operation == OXS_ASYM_CTX_OPERATION_PUB_DECRYPT) || (operation == OXS_ASYM_CTX_OPERATION_PUB_ENCRYPT)){
-                status = openssl_pem_read_pkey(env, filename, password, OPENSSL_PEM_PKEY_TYPE_PUBLIC_KEY, &pubkey);
-                if(status == AXIS2_FAILURE){
-                    pubkey = NULL;
+            if((status == AXIS2_FAILURE) || (!cert)){/*>>*/
+                /*If we cannot get the certificate then the file might contain aither a public key or a private key*/
+                /*The type depends on the operation*/
+                operation = oxs_asym_ctx_get_operation(ctx, env);
+
+                if((operation == OXS_ASYM_CTX_OPERATION_PRV_DECRYPT) || (operation == OXS_ASYM_CTX_OPERATION_PRV_ENCRYPT)){
+                    status = openssl_pem_read_pkey(env, filename, password, OPENSSL_PEM_PKEY_TYPE_PRIVATE_KEY, &prvkey);
+                    if(status == AXIS2_FAILURE){
+                        prvkey = NULL;
+                    }
+                } else if((operation == OXS_ASYM_CTX_OPERATION_PUB_DECRYPT) || (operation == OXS_ASYM_CTX_OPERATION_PUB_ENCRYPT)){
+                    status = openssl_pem_read_pkey(env, filename, password, OPENSSL_PEM_PKEY_TYPE_PUBLIC_KEY, &pubkey);
+                    if(status == AXIS2_FAILURE){
+                        pubkey = NULL;
+                    }
                 }
-            }
-        }/*>>*/
-    }else if(OXS_ASYM_CTX_FORMAT_PKCS12 == oxs_asym_ctx_get_format(ctx, env)){
-        format = OPENSSL_X509_FORMAT_PKCS12;
-        /*Here we load both key and the certificate*/
-        status = openssl_x509_load_from_pkcs12(env, filename, password, &cert, &prvkey, &ca);
-        if(AXIS2_FAILURE == status){
-            oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
+            }/*>>*/
+        }else if(OXS_ASYM_CTX_FORMAT_PKCS12 == oxs_asym_ctx_get_format(ctx, env)){
+            format = OPENSSL_X509_FORMAT_PKCS12;
+            /*Here we load both key and the certificate*/
+            status = openssl_x509_load_from_pkcs12(env, filename, password, &cert, &prvkey, &ca);
+            if(AXIS2_FAILURE == status){
+                oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
                             "Error reading the certificate");
-            return AXIS2_FAILURE;
+                return AXIS2_FAILURE;
+            }
         }
-    }
+        
+    }/*end of der_buf*/
     
+    /*Wht ever the way, right now we should have either the public key or the private key*/
+
     /*Alright if the prvkey is available, populate the openssl_pkey*/
     if(prvkey){
         open_prvkey = openssl_pkey_create(env);
@@ -120,8 +142,8 @@
     }
     /*If this fails to get anything return failure*/
     if((!cert) && (!pubkey) && (!prvkey)){
-        oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
-                "Error reading the file %s", filename);
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
+                "Error reading the key");
         return AXIS2_FAILURE;
     }
     return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pem.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pem.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pem.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pem.c Sun Jan  7 23:38:44 2007
@@ -28,6 +28,52 @@
 #include <openssl_pkcs12.h>
 #include <openssl_pem.h>
 
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+openssl_pem_buf_read_pkey(const axis2_env_t *env,
+    axis2_char_t *b64_encoded_buf,
+    axis2_char_t *password,
+    openssl_pem_pkey_type_t type,
+    EVP_PKEY **pkey)
+{
+    unsigned char *buff = NULL;
+    BIO *bio = NULL;
+    int ilen = 0;
+
+    /*First we need to base64 decode*/
+    EVP_ENCODE_CTX ctx;
+    int len = 0;
+    int ret = 0;
+    int decode_len = 0;
+
+    decode_len = axis2_base64_decode_len(b64_encoded_buf);
+    buff = AXIS2_MALLOC(env->allocator, decode_len + 1000);
+
+    ilen = axis2_strlen(b64_encoded_buf);
+    EVP_DecodeInit(&ctx);
+    EVP_DecodeUpdate(&ctx, (unsigned char*)buff, &len,
+                   (unsigned char*)b64_encoded_buf, ilen);
+    EVP_DecodeFinal(&ctx, (unsigned char*)buff, &ret);
+    ret += len;
+    if ((bio = BIO_new_mem_buf(b64_encoded_buf, ilen)) == NULL)
+    {
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
+                "BIO memeory allocation failure");
+        return AXIS2_FAILURE;
+    }
+    /*Load*/
+    *pkey = PEM_read_bio_PrivateKey(bio, NULL, 0 , password); 
+
+    /*Free*/
+    BIO_free(bio);
+    bio = NULL;
+    AXIS2_FREE(env->allocator, buff);
+    buff = NULL;
+
+    if(!*pkey){
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 openssl_pem_read_pkey(const axis2_env_t *env,

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pkey.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pkey.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pkey.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pkey.c Sun Jan  7 23:38:44 2007
@@ -310,7 +310,7 @@
         if (!pk)
         {
             /*If there is no key by now its an error*/
-            oxs_error(ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
+            oxs_error(env, ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
                     "Cannot load key from %s", filename);
 
             return AXIS2_FAILURE;

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/rsa.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/rsa.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/rsa.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/rsa.c Sun Jan  7 23:38:44 2007
@@ -156,7 +156,7 @@
             RSA_PKCS1_PADDING);
     if (ret < 0)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_OPENSSL_FUNC_FAILED,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_OPENSSL_FUNC_FAILED,
                             "RSA encryption failed");
         return (-1);
     }
@@ -190,7 +190,7 @@
             RSA_PKCS1_PADDING);
     if (ret < 0)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_OPENSSL_FUNC_FAILED,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_OPENSSL_FUNC_FAILED,
                             "RSA decryption failed");
         return (-1);
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/util.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/util.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/util.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/util.c Sun Jan  7 23:38:44 2007
@@ -36,7 +36,7 @@
     ret = RAND_bytes(temp_buffer, size);
     if (ret < 0)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_DEFAULT, "RAND_bytes failed %d", size);
         return AXIS2_FAILURE;
     }
@@ -69,7 +69,7 @@
 
     if (!cprop)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "openssl_cipher_property is NULL");
 
         return AXIS2_FAILURE;
@@ -79,7 +79,7 @@
     cipher_name = OPENSSL_CIPHER_PROPERTY_GET_NAME(cprop, env);
     if (!cipher_name)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "openssl_cipher_property name is NULL");
 
         return AXIS2_FAILURE;
@@ -89,7 +89,7 @@
     cipher = (EVP_CIPHER*)openssl_get_evp_cipher_by_name(env, cipher_name);
     if (!cipher)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "openssl_get_evp_cipher_by_name failed");
 
         return AXIS2_FAILURE;

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/x509.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/x509.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/x509.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/x509.c Sun Jan  7 23:38:44 2007
@@ -39,43 +39,36 @@
     int ilen = 0;
 
     /*First we need to base64 decode*/
-#if 0
-    int decoded_len = -1;
-
-    buff = AXIS2_MALLOC(env->allocator, axis2_base64_decode_len(b64_encoded_buf));
-    ilen = axis2_strlen(b64_encoded_buf);
-    decoded_len = axis2_base64_decode_binary(buff, b64_encoded_buf );
-    if (decoded_len < 0)
-    {
-        /*oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
-                "axis2_base64_decode_binary failed");*/
-        return AXIS2_FAILURE;
-    }
-#else
     EVP_ENCODE_CTX ctx;
     int len = 0;
     int ret = 0;
+    int decode_len = 0;
+
+    decode_len = axis2_base64_decode_len(b64_encoded_buf);
+    buff = AXIS2_MALLOC(env->allocator, decode_len + 1000);
 
-    buff = AXIS2_MALLOC(env->allocator, axis2_base64_decode_len(b64_encoded_buf));
     ilen = axis2_strlen(b64_encoded_buf);
     EVP_DecodeInit(&ctx);
     EVP_DecodeUpdate(&ctx, (unsigned char*)buff, &len,
                    (unsigned char*)b64_encoded_buf, ilen);
     EVP_DecodeFinal(&ctx, (unsigned char*)buff, &ret);
     ret += len;
-#endif
     if ((mem = BIO_new_mem_buf(buff, ilen)) == NULL)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
                 "BIO memeory allocation failure");
         return AXIS2_FAILURE;
     }
 
     *cert = d2i_X509_bio(mem, NULL);
+    /*Free*/
     BIO_free(mem);
+    mem = NULL;
+    AXIS2_FREE(env->allocator, buff);
+    buff = NULL;
 
     if (*cert == NULL){
-        /*oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
+        /*oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
                 "Certificate is NULL");*/
         return AXIS2_FAILURE;
     }
@@ -93,7 +86,7 @@
 
     if ((in=BIO_new_file(filename,"r")) == NULL)
     {
-        /*oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
+        /*oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
                 "Error reading the file %s", filename);*/
         return AXIS2_FAILURE;
     }
@@ -251,21 +244,21 @@
     /*Get ext by ID*/
     index = X509_get_ext_by_NID(cert, NID_subject_key_identifier, -1);
     if (index < 0) {
-       oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
+       oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
                 "The extenension index of NID_subject_key_identifier is not valid");
        return NULL;
     }
 /*Get the extension*/
     ext = X509_get_ext(cert, index);
     if (ext == NULL) {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
                 "The extension for NID_subject_key_identifier is NULL");
         return NULL;
     }
     /*Subject Key Identifier*/
     keyId = (ASN1_OCTET_STRING *)X509V3_EXT_d2i(ext);
     if (keyId == NULL) {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
                 "The SubjectKeyIdentifier is NULL");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_binary_security_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_binary_security_token.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_binary_security_token.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_binary_security_token.c Sun Jan  7 23:38:44 2007
@@ -46,7 +46,7 @@
     binary_security_token_ele = axiom_element_create(env, parent, OXS_NODE_BINARY_SECURITY_TOKEN, ns_obj, &binary_security_token_node);
     if (!binary_security_token_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating Binary Security Token element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_data.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_data.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_data.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_data.c Sun Jan  7 23:38:44 2007
@@ -39,7 +39,7 @@
     cipher_data_ele = axiom_element_create(env, parent, OXS_NODE_CIPHER_DATA, ns_obj, &cipher_data_node);
     if (!cipher_data_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating cipher value element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_value.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_value.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_value.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_cipher_value.c Sun Jan  7 23:38:44 2007
@@ -51,7 +51,7 @@
     cipher_value_ele = axiom_element_create(env, parent, OXS_NODE_CIPHER_VALUE, ns_obj, &cipher_value_node);
     if (!cipher_value_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating cipher value element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_data_reference.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_data_reference.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_data_reference.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_data_reference.c Sun Jan  7 23:38:44 2007
@@ -40,7 +40,7 @@
     data_reference_ele = axiom_element_create(env, parent, OXS_NODE_DATA_REFERENCE, ns_obj, &data_reference_node);
     if (!data_reference_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating data reference element");
         return NULL;
     }
@@ -66,7 +66,7 @@
     data_reference_ele = AXIOM_NODE_GET_DATA_ELEMENT(data_ref_node, env);
     if (!data_reference_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error retrieving data reference element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_embedded.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_embedded.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_embedded.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_embedded.c Sun Jan  7 23:38:44 2007
@@ -43,7 +43,7 @@
     embedded_ele = axiom_element_create(env, parent, OXS_NODE_EMBEDDED, ns_obj, &embedded_node);
     if (!embedded_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating embedded element");
         return NULL;
     }
@@ -71,7 +71,7 @@
     embedded_ele = AXIOM_NODE_GET_DATA_ELEMENT(embedded_node, env);
     if (!embedded_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error retrieving embedded element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encrypted_data.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encrypted_data.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encrypted_data.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encrypted_data.c Sun Jan  7 23:38:44 2007
@@ -44,7 +44,7 @@
     encrypted_data_ele = axiom_element_create(env, parent, OXS_NODE_ENCRYPTED_DATA, ns_obj, &encrypted_data_node);
     if (!encrypted_data_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating encrypted data element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encrypted_key.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encrypted_key.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encrypted_key.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encrypted_key.c Sun Jan  7 23:38:44 2007
@@ -38,7 +38,7 @@
     encrypted_key_ele = axiom_element_create(env, parent, OXS_NODE_ENCRYPTED_KEY, ns_obj, &encrypted_key_node);
     if (!encrypted_key_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating encrypted key element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encryption_method.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encryption_method.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encryption_method.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_encryption_method.c Sun Jan  7 23:38:44 2007
@@ -41,7 +41,7 @@
     encryption_method_ele = axiom_element_create(env, parent, OXS_NODE_ENCRYPTION_METHOD, ns_obj, &encryption_method_node);
     if (!encryption_method_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating encryption method element");
         return NULL;
     }
@@ -74,7 +74,7 @@
     enc_mtd_ele = AXIOM_NODE_GET_DATA_ELEMENT(enc_mtd_node, env);
     if (!enc_mtd_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error retrieving encryption method element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_identifier.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_identifier.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_identifier.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_identifier.c Sun Jan  7 23:38:44 2007
@@ -43,7 +43,7 @@
     ki_ele = axiom_element_create(env, parent, OXS_NODE_KEY_IDENTIFIER, ns_obj, &ki_node);
     if (!ki_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating KeyIdentifier element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_info.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_info.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_info.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_info.c Sun Jan  7 23:38:44 2007
@@ -38,7 +38,7 @@
     key_info_ele = axiom_element_create(env, parent, OXS_NODE_KEY_INFO, ns_obj, &key_info_node);
     if (!key_info_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating KeyInfo element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_name.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_name.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_name.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_key_name.c Sun Jan  7 23:38:44 2007
@@ -40,7 +40,7 @@
     key_name_ele = axiom_element_create(env, parent, OXS_NODE_KEY_NAME, ns_obj, &key_name_node);
     if (!key_name_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating KeyName element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_reference.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_reference.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_reference.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_reference.c Sun Jan  7 23:38:44 2007
@@ -42,7 +42,7 @@
     reference_ele = axiom_element_create(env, parent, OXS_NODE_REFERENCE, ns_obj, &reference_node);
     if (!reference_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating Reference element");
         return NULL;
     }
@@ -70,7 +70,7 @@
     reference_ele = AXIOM_NODE_GET_DATA_ELEMENT(ref_node, env);
     if (!reference_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error retrieving data reference element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_reference_list.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_reference_list.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_reference_list.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_reference_list.c Sun Jan  7 23:38:44 2007
@@ -38,7 +38,7 @@
     reference_list_ele = axiom_element_create(env, parent, OXS_NODE_REFERENCE_LIST, ns_obj, &reference_list_node);
     if (!reference_list_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating ReferenceList element");
         return NULL;
     }
@@ -83,7 +83,7 @@
 
     if (!ref_list_node)
     {
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                 "reference list node is NULL");
         return NULL;
     }
@@ -96,7 +96,7 @@
     qname = NULL;
     
     if(!iter){
-        oxs_error(ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                         "There are no children for %s", OXS_NODE_DATA_REFERENCE);
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_security_token_reference.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_security_token_reference.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_security_token_reference.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_security_token_reference.c Sun Jan  7 23:38:44 2007
@@ -38,7 +38,7 @@
     security_token_reference_ele = axiom_element_create(env, parent, OXS_NODE_SECURITY_TOKEN_REFRENCE, ns_obj, &security_token_reference_node);
     if (!security_token_reference_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating SecurityTokenReference element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_data.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_data.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_data.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_data.c Sun Jan  7 23:38:44 2007
@@ -37,7 +37,7 @@
     x509_data_ele = axiom_element_create(env, parent, OXS_NODE_X509_DATA, ns_obj, &x509_data_node);
     if (!x509_data_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating X509Data element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_issuer_name.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_issuer_name.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_issuer_name.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_issuer_name.c Sun Jan  7 23:38:44 2007
@@ -51,7 +51,7 @@
     issuer_name_ele = axiom_element_create(env, parent, OXS_NODE_X509_ISSUER_NAME, ns_obj, &issuer_name_node);
     if (!issuer_name_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating  element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_issuer_serial.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_issuer_serial.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_issuer_serial.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_issuer_serial.c Sun Jan  7 23:38:44 2007
@@ -60,7 +60,7 @@
     x509_issuer_serial_ele = axiom_element_create(env, parent, OXS_NODE_X509_ISSUER_SERIAL, ns_obj, &x509_issuer_serial_node);
     if (!x509_issuer_serial_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating X509IssuerSerial element");
         return NULL;
     }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_serial_number.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_serial_number.c?view=diff&rev=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_serial_number.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/tokens/token_x509_serial_number.c Sun Jan  7 23:38:44 2007
@@ -51,7 +51,7 @@
     serial_number_ele = axiom_element_create(env, parent, OXS_NODE_X509_SERIAL_NUMBER, ns_obj, &serial_number_node);
     if (!serial_number_ele)
     {
-        oxs_error(ERROR_LOCATION,
+        oxs_error(env, ERROR_LOCATION,
                 OXS_ERROR_ELEMENT_FAILED, "Error creating  element");
         return NULL;
     }

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=493974&r1=493973&r2=493974
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_encryption.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_encryption.c Sun Jan  7 23:38:44 2007
@@ -325,7 +325,7 @@
     /*Decrypt*/
     status = oxs_xml_enc_decrypt_data(env, enc_ctx, enc_type_node, result_buf);
     if(AXIS2_FAILURE == status){
-        oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
                   "Data encryption failed");
         return AXIS2_FAILURE;
     }
@@ -333,7 +333,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.\n%s", decrypted_data);
+        oxs_error(env, 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*/
@@ -436,7 +436,7 @@
     input = NULL;
 
     if(AXIS2_FAILURE == status){
-        oxs_error(ERROR_LOCATION, OXS_ERROR_DEFAULT,
+        oxs_error(env, ERROR_LOCATION, OXS_ERROR_ENCRYPT_FAILED,
                   "Assymmetric key encryption failed");
         return AXIS2_FAILURE;
     }

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=493974&r1=493973&r2=493974
==============================================================================
--- 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 Sun Jan  7 23:38:44 2007
@@ -110,7 +110,7 @@
     axiom_node_t *ref_list_node = NULL;
     axis2_array_list_t *reference_list = NULL;
     axis2_char_t *enc_asym_algo = NULL;
-    axis2_char_t *certificate_file = NULL;
+    axis2_char_t *dec_key_file = NULL;
     axis2_char_t *password = NULL;
     axis2_status_t status = AXIS2_FAILURE;
     oxs_asym_ctx_t *asym_ctx = NULL;
@@ -133,16 +133,16 @@
     asym_ctx = oxs_asym_ctx_create(env);
     /*Set default values. Might be useful if there are no data available to identify those*/
     enc_asym_algo = RAMPART_ACTIONS_GET_ENC_KT_ALGO(actions, env);
-    certificate_file = RAMPART_ACTIONS_GET_DEC_KEY_FILE(actions, env);
+    dec_key_file = RAMPART_ACTIONS_GET_DEC_KEY_FILE(actions, env);
     /*Get the password to retrieve the key from key store*/
     password = rampart_callback_encuser_password(env, actions, msg_ctx);
     oxs_asym_ctx_set_algorithm(asym_ctx, env, enc_asym_algo);
-    oxs_asym_ctx_set_file_name(asym_ctx, env, certificate_file);
+    oxs_asym_ctx_set_file_name(asym_ctx, env, dec_key_file);
     oxs_asym_ctx_set_operation(asym_ctx, env, OXS_ASYM_CTX_OPERATION_PRV_DECRYPT);
     oxs_asym_ctx_set_password(asym_ctx, env, password);
     
     /*oxs_asym_ctx_set_format(asym_ctx, env, OXS_ASYM_CTX_FORMAT_PKCS12);*/
-    oxs_asym_ctx_set_format(asym_ctx, env, oxs_util_get_format_by_file_extension(env, certificate_file));
+    oxs_asym_ctx_set_format(asym_ctx, env, oxs_util_get_format_by_file_extension(env, dec_key_file));
 
     /*Create an empty key*/
     decrypted_sym_key = oxs_key_create(env);



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