You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by mi...@apache.org on 2008/04/27 12:24:50 UTC
svn commit: r651914 - in /webservices/rampart/scratch/c/pkcs/c/src:
omxmlsec/openssl/pkcs12.c util/rampart_engine.c
Author: milinda
Date: Sun Apr 27 03:24:48 2008
New Revision: 651914
URL: http://svn.apache.org/viewvc?rev=651914&view=rev
Log:
pkcs12 support.
Modified:
webservices/rampart/scratch/c/pkcs/c/src/omxmlsec/openssl/pkcs12.c
webservices/rampart/scratch/c/pkcs/c/src/util/rampart_engine.c
Modified: webservices/rampart/scratch/c/pkcs/c/src/omxmlsec/openssl/pkcs12.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/pkcs/c/src/omxmlsec/openssl/pkcs12.c?rev=651914&r1=651913&r2=651914&view=diff
==============================================================================
--- webservices/rampart/scratch/c/pkcs/c/src/omxmlsec/openssl/pkcs12.c (original)
+++ webservices/rampart/scratch/c/pkcs/c/src/omxmlsec/openssl/pkcs12.c Sun Apr 27 03:24:48 2008
@@ -31,23 +31,23 @@
axis2_char_t *filename,
PKCS12 **p12)
{
- FILE *fp = NULL;
-
+ BIO *in = NULL;
SSLeay_add_all_algorithms();
ERR_load_crypto_strings();
- if (!(fp = fopen(filename, "rb"))) {
+ if (!(in = BIO_new_file(filename, "rb"))) {
fprintf(stderr, "Error opening file %s\n", filename);
return AXIS2_FAILURE;
}
/*Load pkcs store*/
- *p12 = d2i_PKCS12_fp(fp, NULL);
- fclose (fp);
+ *p12 = d2i_PKCS12_bio(in, NULL);
+
if (!p12) {
fprintf(stderr, "Error reading PKCS#12 file %s\n", filename);
ERR_print_errors_fp(stderr);
return AXIS2_FAILURE;
}
+ BIO_free(in);
return AXIS2_SUCCESS;
}
Modified: webservices/rampart/scratch/c/pkcs/c/src/util/rampart_engine.c
URL: http://svn.apache.org/viewvc/webservices/rampart/scratch/c/pkcs/c/src/util/rampart_engine.c?rev=651914&r1=651913&r2=651914&view=diff
==============================================================================
--- webservices/rampart/scratch/c/pkcs/c/src/util/rampart_engine.c (original)
+++ webservices/rampart/scratch/c/pkcs/c/src/util/rampart_engine.c Sun Apr 27 03:24:48 2008
@@ -191,7 +191,7 @@
password = rampart_callback_password(env, password_callback, enc_user);
if((pkcs12_file = rampart_context_get_pkcs12_file_name(rampart_context, env)))
{
- pkcs12_password = RAMPART_CALLBACK_CALLBACK_PASSWORD(password_callback, env, enc_user, RAMPART_PKCS);
+ pkcs12_password = rampart_callback_password(env, password_callback, enc_user);
key_store = pkcs12_keystore_create(env, pkcs12_file, pkcs12_password);
if(!key_store)
{