axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kausha...@apache.org
Subject svn commit: r515570 - in /webservices/axis2/trunk/c/rampart: include/ src/omxmlsec/ src/util/
Date Wed, 07 Mar 2007 13:55:15 GMT
Author: kaushalye
Date: Wed Mar  7 05:55:14 2007
New Revision: 515570

URL: http://svn.apache.org/viewvc?view=rev&rev=515570
Log:
1. Adding a KeyInfo node builder to OMXMLSecurity.
2. Fixing the build break!!!


Added:
    webservices/axis2/trunk/c/rampart/include/oxs_xml_key_info_builder.h
    webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_info_builder.c
Modified:
    webservices/axis2/trunk/c/rampart/include/oxs_constants.h
    webservices/axis2/trunk/c/rampart/include/rampart_token_builder.h
    webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am
    webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_signature.c
    webservices/axis2/trunk/c/rampart/src/util/rampart_token_builder.c
    webservices/axis2/trunk/c/rampart/src/util/rampart_util.c

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?view=diff&rev=515570&r1=515569&r2=515570
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_constants.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_constants.h Wed Mar  7 05:55:14 2007
@@ -328,12 +328,13 @@
 #define OXS_ENCODING_BASE64BINARY "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
 #define OXS_VALUE_X509V3 "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
 #define OXS_X509_SUBJ_KI "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier"
+
 /****************************************************************
     ST References
 ****************************************************************/
 #define OXS_STR_DIRECT_REFERENCE "DirectReference"
-#define OXS_STR_KEY_IDENTIFIER "KeyIdentifier"
-#define OXS_STR_EMBEDDED "Embedded"
+#define OXS_STR_KEY_IDENTIFIER  OXS_NODE_KEY_IDENTIFIER
+#define OXS_STR_EMBEDDED        OXS_NODE_EMBEDDED
 #define OXS_STR_ISSUER_SERIAL "IssuerSerial"
 #define OXS_STR_THUMB_PRINT "ThumbPrint"
 #define OXS_STR_EXTERNAL_URI "ExternalUri"

Added: webservices/axis2/trunk/c/rampart/include/oxs_xml_key_info_builder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_xml_key_info_builder.h?view=auto&rev=515570
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_xml_key_info_builder.h (added)
+++ webservices/axis2/trunk/c/rampart/include/oxs_xml_key_info_builder.h Wed Mar  7 05:55:14
2007
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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_XML_KEY_INFO_BUILDER_H
+#define OXS_XML_KEY_INFO_BUILDER_H
+
+
+/**
+  * @file oxs_xml_key_processor.h
+  * @brief Process elements available under ds:KeyInfo  
+  */
+
+#include <axis2_defines.h>
+#include <oxs_ctx.h>
+#include <axis2_env.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axis2_qname.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef enum{
+    OXS_KIBP_UNKNOWN = 0,
+    OXS_KIBP_X509DATA_X509CERTIFICATE,
+    OXS_KIBP_X509DATA_ISSUER_SERIAL,
+}oxs_key_info_build_pattern_t;
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_xml_key_info_build(const axis2_env_t *env,
+    axiom_node_t *parent,
+    oxs_x509_cert_t *cert,
+    oxs_key_info_build_pattern_t pattern);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_xml_key_info_build_x509_data_x509_certificate(const axis2_env_t *env,
+    axiom_node_t *parent,
+    oxs_x509_cert_t *cert);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_xml_key_info_build_x509_data_issuer_serial(const axis2_env_t *env,
+    axiom_node_t *parent,
+    oxs_x509_cert_t *cert);
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* OXS_XML_KEY_INFO_BUILDER_H */

Modified: webservices/axis2/trunk/c/rampart/include/rampart_token_builder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart_token_builder.h?view=diff&rev=515570&r1=515569&r2=515570
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart_token_builder.h (original)
+++ webservices/axis2/trunk/c/rampart/include/rampart_token_builder.h Wed Mar  7 05:55:14
2007
@@ -97,7 +97,7 @@
  */
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-rampart_token_process_x509_data_x509_certificate(const axis2_env_t *env,
+rampart_token_build_x509_data_x509_certificate(const axis2_env_t *env,
     axiom_node_t *parent,
     oxs_x509_cert_t *cert);
 /*

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am?view=diff&rev=515570&r1=515569&r2=515570
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am Wed Mar  7 05:55:14 2007
@@ -4,7 +4,8 @@
 libomxmlsec_la_SOURCES = ctx.c  buffer.c key.c cipher.c error.c axis2_utils.c axiom.c \
                          iv.c xml_encryption.c encryption.c\
 						utility.c asym_ctx.c x509_cert.c key_mgr.c sign_part.c sign_ctx.c \
-						xml_signature.c signature.c transform.c transforms_factory.c xml_key_processor.c
+						xml_signature.c signature.c transform.c transforms_factory.c xml_key_processor.c \
+						xml_key_info_builder.c
 						
 
 libomxmlsec_la_LIBADD  = -lssl\

Added: webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_info_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_info_builder.c?view=auto&rev=515570
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_info_builder.c (added)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_key_info_builder.c Wed Mar  7 05:55:14
2007
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 <stdio.h>
+#include <axis2_util.h>
+#include <oxs_constants.h>
+#include <oxs_error.h>
+#include <oxs_buffer.h>
+#include <oxs_cipher.h>
+#include <oxs_c14n.h>
+#include <oxs_axiom.h>
+#include <oxs_utility.h>
+#include <openssl_rsa.h>
+#include <openssl_digest.h>
+#include <oxs_key_mgr.h>
+#include <oxs_token_x509_data.h>
+#include <oxs_token_x509_certificate.h>
+#include <oxs_token_key_info.h>
+#include <oxs_token_x509_issuer_name.h>
+#include <oxs_token_x509_serial_number.h>
+#include <oxs_xml_key_info_builder.h>
+#include <oxs_token_x509_issuer_serial.h>
+
+/*Private functions*/
+
+/*Public functions*/
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_xml_key_info_build(const axis2_env_t *env,
+    axiom_node_t *parent,
+    oxs_x509_cert_t *cert,
+    oxs_key_info_build_pattern_t pattern)
+{
+    axis2_status_t status = AXIS2_FAILURE;
+    axiom_node_t *key_info_node = NULL;
+    
+    /*Build the KeyInfo node*/
+    key_info_node = oxs_token_build_key_info_element(env, parent);        
+    
+    if(OXS_KIBP_X509DATA_X509CERTIFICATE == pattern){
+        status = oxs_xml_key_info_build_x509_data_x509_certificate(env, key_info_node, cert);
+    }else if(OXS_KIBP_X509DATA_ISSUER_SERIAL == pattern){
+        status = oxs_xml_key_info_build_x509_data_issuer_serial(env, key_info_node, cert);
+    }else{
+        /*We do not support*/
+    }
+    return status;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_xml_key_info_build_x509_data_x509_certificate(const axis2_env_t *env,
+    axiom_node_t *parent,
+    oxs_x509_cert_t *cert)
+{
+    axiom_node_t *x509_data_node = NULL;
+    axiom_node_t *x509_certificate_node = NULL;
+    axis2_char_t *cert_data = NULL;
+
+    /*Get certificate data*/
+    cert_data = oxs_x509_cert_get_data(cert, env);
+    /*Build the X509Data node*/
+    x509_data_node = oxs_token_build_x509_data_element(env, parent);
+
+    /*Now build the X509Certificate node*/
+    x509_certificate_node = oxs_token_build_x509_certificate_element(env, x509_data_node,
cert_data);
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+oxs_xml_key_info_build_x509_data_issuer_serial(const axis2_env_t *env,
+    axiom_node_t *parent,
+    oxs_x509_cert_t *cert)
+{
+    
+    axiom_node_t *x509_data_node = NULL;
+    axiom_node_t *x509_issuer_serial_node = NULL;
+
+    axis2_char_t *issuer = NULL;
+    axis2_char_t *serial_num = NULL;
+    int serial = -1;
+
+    issuer = oxs_x509_cert_get_issuer(cert, env);
+    serial = oxs_x509_cert_get_serial_number(cert, env);
+
+    if(!issuer){
+        return AXIS2_FAILURE;
+    }
+
+    sprintf(serial_num, "%d", serial);
+    /*Build tokens*/
+    x509_data_node = oxs_token_build_x509_data_element(env, parent);
+    x509_issuer_serial_node = oxs_token_build_x509_issuer_serial_with_data(env, x509_data_node,
issuer, serial_num);
+
+    return AXIS2_SUCCESS;
+
+
+}
+

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_signature.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_signature.c?view=diff&rev=515570&r1=515569&r2=515570
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_signature.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/xml_signature.c Wed Mar  7 05:55:14 2007
@@ -307,7 +307,7 @@
     /*At this point we have a complete <SignedInfo> node. Now we need to sign it*/
     oxs_xml_sig_sign_signed_info(env, signature_node, signed_info_node, sign_ctx); 
 
-    /*Now we need to build the KeyInfo node*/    
+    /*Now we need to build the KeyInfo node.*/    
     oxs_xml_sig_build_key_info(env, signature_node, sign_ctx);     
 
     return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_token_builder.c?view=diff&rev=515570&r1=515569&r2=515570
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_token_builder.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_token_builder.c Wed Mar  7 05:55:14
2007
@@ -56,7 +56,7 @@
     }else if(RTBP_KEY_IDENTIFIER == pattern){
         status = rampart_token_build_key_identifier(env, stref_node, cert);
     }else if(RTBP_X509DATA_X509CERTIFICATE == pattern){
-        status = rampart_token_process_x509_data_x509_certificate(env, stref_node, cert);
+        status = rampart_token_build_x509_data_x509_certificate(env, stref_node, cert);
     }else if(RTBP_X509DATA_ISSUER_SERIAL == pattern){
         status = rampart_token_build_x509_data_issuer_serial(env, stref_node, cert);
     }else{
@@ -108,7 +108,7 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-rampart_token_process_x509_data_x509_certificate(const axis2_env_t *env,
+rampart_token_build_x509_data_x509_certificate(const axis2_env_t *env,
     axiom_node_t *parent,
     oxs_x509_cert_t *cert)
 {

Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_util.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_util.c?view=diff&rev=515570&r1=515569&r2=515570
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_util.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_util.c Wed Mar  7 05:55:14 2007
@@ -196,7 +196,7 @@
     axis2_char_t *dt_str = NULL;
 
     dt = axis2_date_time_create_with_offset(env, ttl);
-    dt_str =  axis2_date_time_seriasize_date_time(dt, env);
+    dt_str =  axis2_date_time_serialize_date_time(dt, env);
     axis2_date_time_free(dt, env);
     return dt_str;
 }



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