You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2006/07/17 07:28:58 UTC
svn commit: r422624 - in /webservices/axis2/trunk/c/rampart/include:
openssl_cipher_ctx.h oxs_axiom.h oxs_axis2_utils.h oxs_buffer.h oxs_error.h
Author: damitha
Date: Sun Jul 16 22:28:58 2006
New Revision: 422624
URL: http://svn.apache.org/viewvc?rev=422624&view=rev
Log:
Adding files for error handling. Thanks kaushalye
Added:
webservices/axis2/trunk/c/rampart/include/oxs_error.h
Modified:
webservices/axis2/trunk/c/rampart/include/openssl_cipher_ctx.h
webservices/axis2/trunk/c/rampart/include/oxs_axiom.h
webservices/axis2/trunk/c/rampart/include/oxs_axis2_utils.h
webservices/axis2/trunk/c/rampart/include/oxs_buffer.h
Modified: webservices/axis2/trunk/c/rampart/include/openssl_cipher_ctx.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/openssl_cipher_ctx.h?rev=422624&r1=422623&r2=422624&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/openssl_cipher_ctx.h (original)
+++ webservices/axis2/trunk/c/rampart/include/openssl_cipher_ctx.h Sun Jul 16 22:28:58 2006
@@ -33,11 +33,14 @@
struct _openssl_evp_block_cipher_ctx {
const EVP_CIPHER* cipher;
EVP_CIPHER_CTX cipher_ctx;
- int keyInitialized;
- int ctxInitialized;
- unsigned char key[EVP_MAX_KEY_LENGTH];
+ int key_initialized;
+ int ctx_initialized;
+ unsigned char *key;
+ unsigned char *iv;
+ unsigned char *pad;
+ /*unsigned char key[EVP_MAX_KEY_LENGTH];
unsigned char iv[EVP_MAX_IV_LENGTH];
- unsigned char pad[EVP_MAX_BLOCK_LENGTH];
+ unsigned char pad[EVP_MAX_BLOCK_LENGTH];*/
};
@@ -58,7 +61,8 @@
*@return openssl_evp_block_cipher_ctx_ptr initialized block cipher context
*/
-AXIS2_EXTERN openssl_evp_block_cipher_ctx_ptr AXIS2_CALL openssl_evp_block_cipher_ctx_init(const axis2_env_t *env,
+AXIS2_EXTERN int AXIS2_CALL
+openssl_evp_block_cipher_ctx_init(const axis2_env_t *env,
openssl_evp_block_cipher_ctx_ptr bc_ctx,
oxs_buffer_ptr in,
oxs_buffer_ptr out,
Modified: webservices/axis2/trunk/c/rampart/include/oxs_axiom.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_axiom.h?rev=422624&r1=422623&r2=422624&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_axiom.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_axiom.h Sun Jul 16 22:28:58 2006
@@ -24,7 +24,6 @@
*/
#include <axis2_defines.h>
-#include <oxs_strings.h>
#include <axis2_env.h>
#include <axis2_util.h>
#include <axiom_node.h>
@@ -39,6 +38,9 @@
typedef struct axiom_document_t oxs_axiom_document, *oxs_axiom_document_ptr;
typedef struct axiom_node_t oxs_axiom_node, *oxs_axiom_node_ptr;
+
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+oxs_axiom_get_node_content(const axis2_env_t *env, axiom_node_t* node);
/**
* returns 1 sucess 0 otherwise
Modified: webservices/axis2/trunk/c/rampart/include/oxs_axis2_utils.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_axis2_utils.h?rev=422624&r1=422623&r2=422624&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_axis2_utils.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_axis2_utils.h Sun Jul 16 22:28:58 2006
@@ -32,9 +32,13 @@
* @ingroup
* @{
*/
-/*Encoded input buffer will be placed in the out_buf*/
+/*Decoded buffer will be returned*/
+AXIS2_EXTERN oxs_buffer_ptr AXIS2_CALL oxs_base64_decode(axis2_env_t *env,
+ oxs_buffer_ptr coded_buf);
+
+/*Encoded input buffer will be returned*/
AXIS2_EXTERN oxs_buffer_ptr AXIS2_CALL oxs_base64_encode(axis2_env_t *env,
- oxs_buffer_ptr in_buf);
+ oxs_buffer_ptr plain_buf);
/** @} */
#ifdef __cplusplus
Modified: webservices/axis2/trunk/c/rampart/include/oxs_buffer.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_buffer.h?rev=422624&r1=422623&r2=422624&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_buffer.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_buffer.h Sun Jul 16 22:28:58 2006
@@ -26,6 +26,7 @@
#include <axis2_defines.h>
#include <axis2_env.h>
#include <axis2_util.h>
+#include <oxs_axiom.h>
#ifdef __cplusplus
extern "C"
@@ -66,7 +67,7 @@
unsigned int size;
unsigned int max_size;
oxs_AllocMode alloc_mode;
-} ;
+};
AXIS2_EXTERN oxs_buffer_ptr AXIS2_CALL
oxs_create_buffer(const axis2_env_t *env, unsigned int size);
@@ -101,6 +102,11 @@
AXIS2_EXTERN int AXIS2_CALL
oxs_buffer_set_max_size(const axis2_env_t *env, oxs_buffer_ptr buf, unsigned int size);
+AXIS2_EXTERN int AXIS2_CALL
+oxs_buffer_read_file(const axis2_env_t *env, oxs_buffer_ptr buf, const char* filename);
+
+AXIS2_EXTERN int AXIS2_CALL
+oxs_buffer_base64_node_content_read(const axis2_env_t *env, oxs_buffer_ptr buf, axiom_node_t *node);
/** @} */
#ifdef __cplusplus
}
Added: webservices/axis2/trunk/c/rampart/include/oxs_error.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_error.h?rev=422624&view=auto
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_error.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_error.h Sun Jul 16 22:28:58 2006
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OXS_ERROR_H
+#define OXS_ERROR_H
+
+
+/**
+ * @file oxs_error.h
+ * @brief
+ */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*Macros for locating thr error*/
+#define FUNCTION_NAME __FUNCTION__
+#define LINE_NUMBER __LINE__
+#define FILE_NAME __FILE__
+
+#define ERROR_LOCATION FILE_NAME,LINE_NUMBER,FUNCTION_NAME
+
+/*Error codes*/
+#define OXS_ERROR_DEFAULT 0
+#define OXS_ERROR_ENCRYPT_FAILED 1
+#define OXS_ERROR_DECRYPT_FAILED 2
+#define OXS_ERROR_INVALID_DATA 3
+#define OXS_ERROR_INVALID_SIZE 4
+#define OXS_ERROR_INVALID_FORMAT 5
+
+
+typedef struct _oxs_error_description oxs_error_description, *oxs_error_description_ptr;
+
+/**
+* Structure to hold error descriptions
+* @param code Error Code
+* @param message Error Message
+*/
+struct _oxs_error_description
+{
+ int code;
+ const char* message;
+};
+
+/**
+* Given the error code @code get the error message from the table
+* @param code Error code
+* @return error message
+*/
+AXIS2_EXTERN const char* AXIS2_CALL
+oxs_errors_get_msg_by_code(int code);
+
+/**
+* Given position @pos get the error message from the table
+* @param pos Position of the table
+* @return error message
+*/
+AXIS2_EXTERN const char* AXIS2_CALL
+oxs_errors_get_msg(unsigned int pos);
+
+/**
+* Given position @pos get the error code from the table
+* @param pos Position of the table
+* @return error code
+*/
+AXIS2_EXTERN int AXIS2_CALL
+oxs_errors_get_code(unsigned int pos);
+
+/**
+ * Prints the error message
+ * @file: file name
+ * @line: line number
+ * @func: function
+ * @code: the error code.
+ * @msg: the error message
+ *
+ */
+AXIS2_EXTERN void AXIS2_CALL
+oxs_error(const char* file, int line, const char* func,
+ int code, const char* msg,...);
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OXS_ERROR_H */
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org