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/31 07:33:34 UTC
svn commit: r427016 - in /webservices/axis2/trunk/c/rampart/include:
openssl_constants.h oxs_constants.h oxs_ctx.h oxs_enc_engine.h oxs_key.h
rampart_constants.h
Author: damitha
Date: Sun Jul 30 22:33:33 2006
New Revision: 427016
URL: http://svn.apache.org/viewvc?rev=427016&view=rev
Log:
Applying patches.
Added:
webservices/axis2/trunk/c/rampart/include/openssl_constants.h
Modified:
webservices/axis2/trunk/c/rampart/include/oxs_constants.h
webservices/axis2/trunk/c/rampart/include/oxs_ctx.h
webservices/axis2/trunk/c/rampart/include/oxs_enc_engine.h
webservices/axis2/trunk/c/rampart/include/oxs_key.h
webservices/axis2/trunk/c/rampart/include/rampart_constants.h
Added: webservices/axis2/trunk/c/rampart/include/openssl_constants.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/openssl_constants.h?rev=427016&view=auto
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/openssl_constants.h (added)
+++ webservices/axis2/trunk/c/rampart/include/openssl_constants.h Sun Jul 30 22:33:33 2006
@@ -0,0 +1,50 @@
+/*
+ * 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 <axis2_util.h>
+
+/**
+ * @file
+ * @brief
+ */
+#ifndef OPENSSL_CONSTANTS_H
+#define OPENSSL_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define OPENSSL_ENCRYPT 1
+#define OPENSSL_DECRYPT 0
+#define OPENSSL_LEAVE_UNCHANGED -1
+
+/**Ciphers *************/
+
+#define OPENSSL_EVP_des_ede3_cbc "EVP_des_ede3_cbc"
+#define OPENSSL_EVP_aes_128_cbc "EVP_aes_128_cbc"
+#define OPENSSL_EVP_aes_192_cbc "EVP_aes_192_cbc"
+#define OPENSSL_EVP_aes_256_cbc "EVP_aes_256_cbc"
+
+#define OPENSSL_DEFAULT_IV8 "01234567"
+#define OPENSSL_DEFAULT_IV16 "0123456701234567"
+#define OPENSSL_DEFAULT_IV24 "012345670123456701234567"
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OPENSSL_CONSTANTS_H */
Modified: webservices/axis2/trunk/c/rampart/include/oxs_constants.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_constants.h?rev=427016&r1=427015&r2=427016&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_constants.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_constants.h Sun Jul 30 22:33:33 2006
@@ -23,6 +23,8 @@
{
#endif
+
+
/*Global prefixes**********************/
#define OXS_xenc "xenc"
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=427016&r1=427015&r2=427016&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_ctx.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_ctx.h Sun Jul 30 22:33:33 2006
@@ -84,7 +84,8 @@
axiom_node_t* enc_method_node;
axiom_node_t* key_info_node;
axiom_node_t* cipher_value_node;
-
+ /*Used in decryption process to keep the data to be decrypted*/
+ axis2_char_t* inputdata;
};
Modified: 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=427016&r1=427015&r2=427016&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_enc_engine.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_enc_engine.h Sun Jul 30 22:33:33 2006
@@ -39,19 +39,55 @@
#endif
-
+/*Does encryption or decryption depending on the enc_ctx*/
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-oxs_enc_encrypt(const axis2_env_t *env,
+oxs_enc_crypt(const axis2_env_t *env,
enc_ctx_ptr enc_ctx,
oxs_buffer_ptr input,
axis2_char_t* key,
oxs_buffer_ptr result);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_enc_populate_cipher_value(const axis2_env_t *env,
+ axiom_node_t* template_node,
+ oxs_buffer_ptr databuf);
+
+/*We expect user to provide a template as below*/
+/**
+<EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
+ <KeyName/>
+ </KeyInfo>
+ <CipherData>
+ <CipherValue>YoUR-ENCrypteD-Dat@-HeRe</CipherValue>
+ </CipherData>
+</EncryptedData>
+*/
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_enc_decrypt_template(const axis2_env_t *env,
+ axiom_node_t* template_node,
+ axis2_char_t** decrypted_data,
+ enc_ctx_ptr enc_ctx
+ );
+
/*We expect user to provide a template as below
-TODO: Write the template*/
+The CipherValue will be populated once encrypted*/
+/**
+<EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#">
+ <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+ <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
+ <KeyName/>
+ </KeyInfo>
+ <CipherData>
+ <CipherValue></CipherValue>
+ </CipherData>
+</EncryptedData>
+*/
AXIS2_EXTERN axis2_status_t AXIS2_CALL
oxs_enc_encrypt_template(const axis2_env_t *env,
- axiom_node_t* template,
+ axiom_node_t* template_node,
axis2_char_t* data,
enc_ctx_ptr enc_ctx
);
Modified: 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=427016&r1=427015&r2=427016&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_key.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_key.h Sun Jul 30 22:33:33 2006
@@ -43,6 +43,7 @@
typedef struct _oxs_key oxs_key, *oxs_key_ptr;
struct _oxs_key{
+ axis2_char_t *name;
unsigned char *data;
int size;
int usage;
@@ -50,6 +51,7 @@
AXIS2_EXTERN oxs_key_ptr AXIS2_CALL
oxs_key_create_key(const axis2_env_t *env,
+ axis2_char_t *name,
unsigned char *data,
int size,
int usage
Modified: webservices/axis2/trunk/c/rampart/include/rampart_constants.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart_constants.h?rev=427016&r1=427015&r2=427016&view=diff
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart_constants.h (original)
+++ webservices/axis2/trunk/c/rampart/include/rampart_constants.h Sun Jul 30 22:33:33 2006
@@ -23,6 +23,8 @@
{
#endif
+/*Default values*/
+
/* rampart element names*/
#define RAMPART_SECURITY "Security"
#define RAMPART_SECURITY_USERNAMETOKEN "UsernameToken"
@@ -55,6 +57,8 @@
#define RAMPART_PASSWORD_DIGEST "passwordDigest"
#define RAMPART_ACTION_ITEMS_USERNAMETOKEN "UsernameToken"
#define RAMPART_ACTION_ITEMS_TIMESTAMP "Timestamp"
+#define RAMPART_ACTION_ITEMS_ENCRYPT "Encrypt"
+#define RAMPART_ACTION_ITEMS_SIGNATURE "Signature"
#define RAMPART_ACTION_PW_CALLBACK_CLASS "passwordCallbackClass"
/*Dynamically set values*/
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org