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/14 11:34:21 UTC
svn commit: r421848 - in /webservices/axis2/trunk/c/rampart/include:
openssl_cipher_ctx.h openssl_crypt.h oxs_ctx.h oxs_enc.h
Author: damitha
Date: Fri Jul 14 02:34:20 2006
New Revision: 421848
URL: http://svn.apache.org/viewvc?rev=421848&view=rev
Log:
Adding headers openssl related code
Added:
webservices/axis2/trunk/c/rampart/include/openssl_cipher_ctx.h
webservices/axis2/trunk/c/rampart/include/openssl_crypt.h
Modified:
webservices/axis2/trunk/c/rampart/include/oxs_ctx.h
webservices/axis2/trunk/c/rampart/include/oxs_enc.h
Added: 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=421848&view=auto
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/openssl_cipher_ctx.h (added)
+++ webservices/axis2/trunk/c/rampart/include/openssl_cipher_ctx.h Fri Jul 14 02:34:20 2006
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2003-2004 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.
+ */
+
+#include<openssl/evp.h>
+#include<oxs_buffer.h>
+
+/**
+ * @file
+ * @brief
+ */
+#ifndef OPENSSL_CIPHER_CTX_H
+#define OPENSSL_CIPHER_CTX_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _openssl_evp_block_cipher_ctx openssl_evp_block_cipher_ctx, *openssl_evp_block_cipher_ctx_ptr;
+
+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];
+ unsigned char iv[EVP_MAX_IV_LENGTH];
+ unsigned char pad[EVP_MAX_BLOCK_LENGTH];
+
+};
+
+/**
+* Create a fresh block cipher context
+*@return openssl_evp_block_cipher_ctx_ptr the created block cipher context
+*/
+AXIS2_EXTERN openssl_evp_block_cipher_ctx_ptr AXIS2_CALL openssl_evp_block_cipher_ctx_create(const axis2_env_t *env);
+
+/**
+* Initialize the block cipher context for a given cipher
+*
+*@param openssl_evp_block_cipher_ctx_ptr block cipher context
+*@param in input buffer
+*@param out output buffer
+*@param encrypt 1 to encrypt 0 to decrypt
+*@param cipher_name Name of the cipher Passing NULL will use the default
+*@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,
+ openssl_evp_block_cipher_ctx_ptr bc_ctx,
+ oxs_buffer_ptr in,
+ oxs_buffer_ptr out,
+ int encrypt,
+ const unsigned char* cipher_name
+ );
+
+/*TODO write the free function*/
+
+
+/* @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OPENSSL_CIPHER_CTX_H */
Added: webservices/axis2/trunk/c/rampart/include/openssl_crypt.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/openssl_crypt.h?rev=421848&view=auto
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/openssl_crypt.h (added)
+++ webservices/axis2/trunk/c/rampart/include/openssl_crypt.h Fri Jul 14 02:34:20 2006
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2003-2004 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.
+ */
+
+#include <openssl/evp.h>
+#include <openssl_cipher_ctx.h>
+#include <axis2_util.h>
+
+/**
+ * @file
+ * @brief
+ */
+#ifndef OPENSSL_CRYPT_H
+#define OPENSSL_CRYPT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @defgroup
+ * @ingroup
+ * @{
+ */
+
+/**
+*
+*@param bc_ctx block cipher context
+*@param in_buf buffer to en/decrypt
+*@param out_buf buffer to place the en/decrypted data
+*@param do_encrypt 1 to encrypt 0 to decrypt
+*@return -1 if failed
+*/
+AXIS2_EXTERN int AXIS2_CALL openssl_block_cipher_crypt(axis2_env_t *env, openssl_evp_block_cipher_ctx_ptr bc_ctx,
+ oxs_buffer_ptr in_buf,
+ oxs_buffer_ptr out_buf,
+ int do_encrypt);
+
+
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OPENSSL_CRYPT_H */
Modified: webservices/axis2/trunk/c/rampart/include/oxs_ctx.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_ctx.h?rev=421848&r1=421847&r2=421848&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_ctx.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_ctx.h Fri Jul 14 02:34:20 2006
@@ -24,9 +24,10 @@
*/
#include <axis2_defines.h>
-#include <oxs_constants.h>
+#include <oxs_strings.h>
#include <axis2_env.h>
#include <axiom_node.h>
+#include <oxs_buffer.h>
#ifdef __cplusplus
extern "C"
@@ -62,10 +63,14 @@
enc_ctx_transform_operation_t operation;
/* attributes from EncryptedData or EncryptedKey */
- axis2_char_t* encdata_id;
- axis2_char_t* encdata_type;
- axis2_char_t* encdata_mime_type;
- axis2_char_t* encdata_encoding;
+ axis2_char_t* id;
+ axis2_char_t* type;
+ axis2_char_t* mime_type;
+ axis2_char_t* encoding;
+ axis2_char_t* recipient;
+ axis2_char_t* carriedKeyName;
+
+
/*attributes from EncryptionMethod*/
axis2_char_t* encmtd_algorithm;
Modified: webservices/axis2/trunk/c/rampart/include/oxs_enc.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_enc.h?rev=421848&r1=421847&r2=421848&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_enc.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_enc.h Fri Jul 14 02:34:20 2006
@@ -24,7 +24,7 @@
*/
#include <axis2_defines.h>
-#include <oxs_constants.h>
+#include <oxs_strings.h>
#include <oxs_ctx.h>
#include <axis2_env.h>
#include <axiom_node.h>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org