You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ka...@apache.org on 2007/02/16 10:21:08 UTC

svn commit: r508354 - in /webservices/axis2/trunk/c/rampart: include/oxs_key_mgr.h src/core/Makefile.am src/omxmlsec/Makefile.am src/omxmlsec/key_mgr.c

Author: kaushalye
Date: Fri Feb 16 01:21:07 2007
New Revision: 508354

URL: http://svn.apache.org/viewvc?view=rev&rev=508354
Log:
Openssl and xml-tokens should be linked with OMXMLSecurity. Changed the build system. Plus some minor code modifications in Key Manager.


Modified:
    webservices/axis2/trunk/c/rampart/include/oxs_key_mgr.h
    webservices/axis2/trunk/c/rampart/src/core/Makefile.am
    webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am
    webservices/axis2/trunk/c/rampart/src/omxmlsec/key_mgr.c

Modified: webservices/axis2/trunk/c/rampart/include/oxs_key_mgr.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_key_mgr.h?view=diff&rev=508354&r1=508353&r2=508354
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_key_mgr.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_key_mgr.h Fri Feb 16 01:21:07 2007
@@ -66,7 +66,7 @@
     axis2_char_t *filename);
 
 AXIS2_EXTERN oxs_x509_cert_t* AXIS2_CALL
-oxs_key_mgr_load_x509_cert_from_buf(const axis2_env_t *env,
+oxs_key_mgr_load_x509_cert_from_string(const axis2_env_t *env,
     axis2_char_t *pem_buf);
 /** @} */
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/rampart/src/core/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/core/Makefile.am?view=diff&rev=508354&r1=508353&r2=508354
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/core/Makefile.am (original)
+++ webservices/axis2/trunk/c/rampart/src/core/Makefile.am Fri Feb 16 01:21:07 2007
@@ -8,8 +8,6 @@
 libmod_rampart_la_LIBADD  = ../handlers/librampart_handlers.la \
 			    ../util/librampart_util.la \
 			    ../omxmlsec/libomxmlsec.la \
-			    ../omxmlsec/tokens/liboxstokens.la \
-                ../omxmlsec/openssl/libomopenssl.la \
 				../secpolicy/model/librp_model.la \
 				../secpolicy/builder/librp_builder.la	
 

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=508354&r1=508353&r2=508354
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/Makefile.am Fri Feb 16 01:21:07 2007
@@ -10,6 +10,8 @@
 libomxmlsec_la_LIBADD  = -lssl\
 			../../../util/src/libaxis2_util.la \
 			../../../axiom/src/om/libaxis2_axiom.la \
+			tokens/liboxstokens.la \
+			openssl/libomopenssl.la \
 			c14n/liboxsc14n.la \
 			-lcrypto 
 

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/key_mgr.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/key_mgr.c?view=diff&rev=508354&r1=508353&r2=508354
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/key_mgr.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/key_mgr.c Fri Feb 16 01:21:07 2007
@@ -154,11 +154,12 @@
     return AXIS2_SUCCESS;
 }
 
+/********************************************************************************************/
 /*These are new set of functions that break-up the complex logic in oxs_key_mgr_load_key()*/
 
 AXIS2_EXTERN openssl_pkey_t* AXIS2_CALL
 oxs_key_mgr_load_private_key_from_string(const axis2_env_t *env, 
-    axis2_char_t *pem_buf, /*in PEM format*/
+    axis2_char_t *pem_string, /*in PEM format*/
     axis2_char_t *password)
 {
     openssl_pkey_t *open_prvkey = NULL;
@@ -166,7 +167,7 @@
     EVP_PKEY *prvkey = NULL;
  
     /*load private key from buf*/
-    status = openssl_pem_buf_read_pkey(env, pem_buf, password, OPENSSL_PEM_PKEY_TYPE_PRIVATE_KEY, &prvkey); 
+    status = openssl_pem_buf_read_pkey(env, pem_string, password, OPENSSL_PEM_PKEY_TYPE_PRIVATE_KEY, &prvkey); 
     /*Populate*/
     if(prvkey){
         open_prvkey = openssl_pkey_create(env);
@@ -247,34 +248,14 @@
 }
 
 AXIS2_EXTERN oxs_x509_cert_t* AXIS2_CALL
-oxs_key_mgr_load_x509_cert_from_buf(const axis2_env_t *env,
-    axis2_char_t *pem_buf)
+oxs_key_mgr_load_x509_cert_from_string(const axis2_env_t *env,
+    axis2_char_t *pem_string)
 {
     X509 *cert = NULL;
     oxs_x509_cert_t *oxs_cert = NULL;
-    openssl_x509_load_from_buffer(env, pem_buf, &cert);
+    openssl_x509_load_from_buffer(env, pem_string, &cert);
   
-    if(cert){
-        EVP_PKEY *pubkey = NULL;
-        openssl_pkey_t *open_pubkey = NULL;
-
-        oxs_cert = oxs_x509_cert_create(env);
-
-        oxs_x509_cert_set_data(oxs_cert, env, openssl_x509_get_cert_data(env, cert));
-        oxs_x509_cert_set_date(oxs_cert, env, openssl_x509_get_info(env, OPENSSL_X509_INFO_VALID_TO ,cert));
-        oxs_x509_cert_set_issuer(oxs_cert, env, openssl_x509_get_info(env, OPENSSL_X509_INFO_ISSUER ,cert));
-        oxs_x509_cert_set_subject(oxs_cert, env, openssl_x509_get_info(env, OPENSSL_X509_INFO_SUBJECT ,cert));
-        oxs_x509_cert_set_fingerprint(oxs_cert, env, openssl_x509_get_info(env, OPENSSL_X509_INFO_FINGER,cert));
-        oxs_x509_cert_set_serial_number(oxs_cert, env, openssl_x509_get_serial(env, cert));
-        oxs_x509_cert_set_key_identifier(oxs_cert, env, openssl_x509_get_subject_key_identifier(env, cert));
-
-        /*Additionally we need to set the public key*/
-        openssl_x509_get_pubkey(env, cert, &pubkey);
-        open_pubkey = openssl_pkey_create(env);
-        OPENSSL_PKEY_POPULATE(open_pubkey, env, pubkey, openssl_x509_get_info(env, OPENSSL_X509_INFO_FINGER,cert), OPENSSL_PKEY_TYPE_PUBLIC_KEY);
-        /*Set the public key to the x509 certificate*/
-        oxs_x509_cert_set_public_key(oxs_cert, env, open_pubkey);
-    }
+    oxs_cert = oxs_key_mgr_convert_to_x509(env, cert);
 
     return oxs_cert; 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org