axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r425998 - in /webservices/axis2/trunk/c/rampart/include: openssl_cipher_ctx.h openssl_crypt.h oxs_ctx.h oxs_enc_engine.h oxs_key.h
Date Thu, 27 Jul 2006 07:55:54 GMT
Author: damitha
Date: Thu Jul 27 00:55:53 2006
New Revision: 425998

URL: http://svn.apache.org/viewvc?rev=425998&view=rev
Log:
Applying patches for omxmlsec

Added:
    webservices/axis2/trunk/c/rampart/include/oxs_enc_engine.h
    webservices/axis2/trunk/c/rampart/include/oxs_key.h
Modified:
    webservices/axis2/trunk/c/rampart/include/openssl_cipher_ctx.h
    webservices/axis2/trunk/c/rampart/include/openssl_crypt.h
    webservices/axis2/trunk/c/rampart/include/oxs_ctx.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=425998&r1=425997&r2=425998&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/openssl_cipher_ctx.h (original)
+++ webservices/axis2/trunk/c/rampart/include/openssl_cipher_ctx.h Thu Jul 27 00:55:53 2006
@@ -41,14 +41,15 @@
     /*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);
+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
@@ -64,8 +65,6 @@
 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,
                              int encrypt,
                              const unsigned char* cipher_name
                              );

Modified: 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=425998&r1=425997&r2=425998&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/openssl_crypt.h (original)
+++ webservices/axis2/trunk/c/rampart/include/openssl_crypt.h Thu Jul 27 00:55:53 2006
@@ -16,6 +16,7 @@
 
 #include <openssl/evp.h>
 #include <openssl_cipher_ctx.h>
+#include <openssl_constants.h>
 #include <axis2_util.h>
 
 /**
@@ -42,9 +43,9 @@
 *@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,
+AXIS2_EXTERN int AXIS2_CALL  openssl_block_cipher_crypt(const axis2_env_t *env,     openssl_evp_block_cipher_ctx_ptr
bc_ctx,
+    unsigned char *in_main_buf, 
+    unsigned char **out_main_buf,
     int do_encrypt);
 
 

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=425998&r1=425997&r2=425998&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_ctx.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_ctx.h Thu Jul 27 00:55:53 2006
@@ -24,10 +24,10 @@
   */
 
 #include <axis2_defines.h>
-#include <oxs_strings.h>
 #include <axis2_env.h>
 #include <axiom_node.h>
 #include <oxs_buffer.h>
+#include <oxs_key.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -39,15 +39,15 @@
  * @{
  */
 
+typedef struct _enc_ctx enc_ctx, *enc_ctx_ptr;
+
 typedef enum  {
-    enc_ctx_transform_operation_none =0,
-    enc_ctx_transform_operation_encode,
-    enc_ctx_transform_operation_decode,
-    enc_ctx_transform_operation_sign,
-    enc_ctx_transform_operation_verify,
-    enc_ctx_transform_operation_encrypt,
-    enc_ctx_transform_operation_decrypt
-} enc_ctx_transform_operation_t;
+    oxs_operation_none =0,
+    oxs_operation_sign,
+    oxs_operation_verify,
+    oxs_operation_encrypt,
+    oxs_operation_decrypt
+} oxs_operation_t;
 
 typedef enum {
     enc_ctx_mode_encrypted_data = 0,
@@ -55,12 +55,16 @@
 } enc_ctx_mode_t;
 
 
-typedef struct enc_ctx{
+
+struct _enc_ctx{
     /*Encryption mode*/
     enc_ctx_mode_t mode;
     
     /*transformation type */
-    enc_ctx_transform_operation_t operation;    
+    oxs_operation_t operation;    
+
+    /*key*/
+    oxs_key_ptr key;
 
     /* attributes from EncryptedData or EncryptedKey */
     axis2_char_t*           id;
@@ -70,8 +74,6 @@
     axis2_char_t*           recipient;
     axis2_char_t*           carriedKeyName;
 
-
-
     /*attributes from EncryptionMethod*/ 
     axis2_char_t*           encmtd_algorithm;
     
@@ -82,22 +84,22 @@
     axiom_node_t*           enc_method_node;
     axiom_node_t*           key_info_node;
     axiom_node_t*           cipher_value_node;
+   
 
-
-} enc_ctx_t; 
+}; 
 
 
 
-AXIS2_EXTERN enc_ctx_t* AXIS2_CALL
+AXIS2_EXTERN enc_ctx_ptr AXIS2_CALL
 oxs_ctx_create_ctx(const axis2_env_t *env);
 
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-oxs_ctx_free_ctx(enc_ctx_t *ctx);
+oxs_ctx_free_ctx(enc_ctx_ptr ctx);
 
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-oxs_ctx_reset_ctx(enc_ctx_t *ctx);
+oxs_ctx_reset_ctx(enc_ctx_ptr ctx);
 /**
   <complexType name='EncryptedType' abstract='true'>
     <sequence>

Added: webservices/axis2/trunk/c/rampart/include/oxs_enc_engine.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_enc_engine.h?rev=425998&view=auto
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_enc_engine.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_enc_engine.h Thu Jul 27 00:55:53 2006
@@ -0,0 +1,78 @@
+/*
+ * 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_ENC_ENGINE_H
+#define OXS_ENC_ENGINE_H
+
+
+/**
+  * @file oxs_enc.h
+  * @brief 
+  */
+
+#include <axis2_defines.h>
+#include <oxs_ctx.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+#include <openssl_cipher_ctx.h>
+#include <openssl_crypt.h>
+#include <openssl_constants.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_enc_encrypt(const axis2_env_t *env,
+                enc_ctx_ptr enc_ctx,
+                oxs_buffer_ptr input,
+                axis2_char_t* key,
+                oxs_buffer_ptr result);
+
+/*We expect user to provide a template as below 
+TODO: Write the template*/
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_enc_encrypt_template(const axis2_env_t *env,
+                        axiom_node_t* template,
+                        axis2_char_t* data,
+                        enc_ctx_ptr enc_ctx
+                        );
+
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_enc_cipher_data_node_read(const axis2_env_t *env,
+                         enc_ctx_ptr enc_ctx, axiom_node_t* node);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_enc_encryption_data_node_read(const axis2_env_t *env,
+                        enc_ctx_ptr enc_ctx,
+                        axiom_node_t* node);
+
+
+
+
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* OXS_ENC_ENGINE_H */

Added: webservices/axis2/trunk/c/rampart/include/oxs_key.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_key.h?rev=425998&view=auto
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_key.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_key.h Thu Jul 27 00:55:53 2006
@@ -0,0 +1,70 @@
+/*
+ * 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_KEY_H
+#define OXS_KEY_H
+
+
+/**
+  * @file oxs_key.h
+  * @brief 
+  */
+
+#include <axis2_defines.h>
+#include <oxs_constants.h>
+#include <axis2_env.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+#define OXS_KEY_USAGE_SIGN      0
+#define OXS_KEY_USAGE_VERIFY    1
+#define OXS_KEY_USAGE_ENCRYPT   2
+#define OXS_KEY_USAGE_DECRYPT   3
+#define OXS_KEY_USAGE_NONE      4
+
+#define OXS_KEY_DEFAULT_SIZE    64
+
+typedef struct _oxs_key oxs_key, *oxs_key_ptr;
+
+struct _oxs_key{
+    unsigned char *data;
+    int            size;
+    int            usage;
+};
+
+AXIS2_EXTERN oxs_key_ptr AXIS2_CALL
+oxs_key_create_key(const axis2_env_t *env,
+                    unsigned char *data,
+                    int size,
+                    int usage
+                    );
+
+AXIS2_EXTERN oxs_key_ptr AXIS2_CALL
+oxs_key_read_from_file(const axis2_env_t *env,
+                        axis2_char_t *file_name);
+
+
+
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* OXS_KEY_H */



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