Thank you,

This did not solve my problem but it did point me in the correct direction.

I could not get d2i_PKCS12_fp to work even after changing fopen to use "rb" so I switch to using a BIO

BIO *fp = (BIO *)NULL;
PKCS12 *p12 = (PKCS12 *)NULL;

fp = BIO_new_file( p12file, "r" );
if( (BIO *)NULL != fp )
{
  p12 = d2i_PKCS12_bio( fp, (PKCS12 **)NULL );
  BIO_free( fp );
}

However I also found that I needed to add crypto_malloc_init() to my windows 
main function.  After making these changes all seem seems to work for me.

Thanks again,

Perry



Dr. Stephen Henson wrote:

On Thu, Dec 08, 2005, Perry L. Jones wrote:

Anyone have an idea about why the following d2i_PKCS12_fp code fails in windows using openssl 0.9.7c? It works find in Unix/Linux.

FILE *fp = (FILE *)NULL;
PKCS12 *p12 = (PKCS12 *)NULL;

fp = fopen( p12file, "r" );
if( (FILE *)NULL != fp )
{
  p12 = d2i_PKCS12_fp( fp, (PKCS12 **)NULL );
  fclose( fp );
}

I get the following errorr:

"unhandled exception at 0x7c918ea in test_app.c 0xcc000005
Access Violation writing location 0x00000010"


Possibly:

http://www.openssl.org/support/faq.html#PROG2

Oh and you need "rb" mode under Windows for fopen.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to