I also found errors using PEM_read_ RSAPrivateKey(FILE *fp,...) OR PEM_read_bio_RSAPrivateKey(BIO *bio,...) when the bio points to a file.
 
My solution was to read the private-key file into a memory buffer with fread().
(This means that the file is not protected with a password)
 
Associate a bio with this memory buffer:
bio = BIO_new(bio_s_mem())
 
Using the PEM_read_bio_RSAPrivateKey() now works for some reason.
 
Is do not know what causes this problem under windows.
----- Original Message -----
From: mlcarey59
Sent: Friday, September 20, 2002 7:09 AM
Subject: BIO_printf() and ERR_print_errors() do not allocate memory

BIO_printf and ERR_print_errors() cannnot write memory and cause an unhandled excepting in NTDLL.dll under Win32 complied with VC++ using the Debug Multithreaded DLL.
 
I modified the sign.c demo to run under windows.  Do this I had to change the FILE *fp to BIO *bp.  For some reason the PEM_read_PrivateKey(fp, NULL, 0, NULL) does not work on Windows.  And except for the stdio and stderr file handles passed to BIO_printf and ERR_print_errors the other BIO file routines work.
 
Does anyone know how to fix this problem?
 
Thank You!
 
Marcus
 
 
 

Reply via email to