In message <[EMAIL PROTECTED]> on Thu, 17 Jun 2004 23:30:44 -0700, Lev Walkin <[EMAIL 
PROTECTED]> said:

vlm> Marcus Carey via RT wrote:
vlm> > Windows 2000
vlm> > MS VC++ .NET
vlm> > OpenSSL 0.9.7d 17 Mar 2004
vlm> > 
vlm> > 
vlm> > FILE *fp;
vlm> > X509 *cert;
vlm> > 
vlm> > 
vlm> > fp = fopen("SomefFile","r");
vlm> > cert = PEM_read_X509(fp,NULL,NULL,NULL);
vlm> > fclose(fp);
vlm> > 
vlm> > 
vlm> > I have narrowed it down to the BIO_gets() function.
vlm> > 
vlm> > int BIO_get(BIO *b, char *in, int inl)
vlm> > {
vlm> >     i=b->method->bgets(b,in,inl);   /* This causes an application error - "The 
memory could not be writting" */
vlm> > 
vlm> >     return(i);
vlm> > }
vlm> > 
vlm> > 
vlm> > This error also occures with PEM_write functions.
vlm> 
vlm> 
vlm> Please use the API correctly:
vlm> 
vlm>    FILE *fp = fopen(...);
vlm>    X509 *cert = NULL;      /* Do not forget NULL!!! */
vlm> 
vlm>    cert = PEM_read_X509(fp, &cert, NULL, NULL);

Uhmm, I was under the impression that if PEM_read_X509() and friends
got a NULL as a second argument, it would create a X509 to contain the
information...

I suspect this is a problem on Windows, because I just tried the above
test program (with NULL as second argument to PEM_read_X509()) on
Linux, and it worked like a charm (I checked with gdb that I really
did get a value back, and that it contained sensible data).

-----
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.

-- 
Richard Levitte   \ Tunnlandsvägen 52 \ [EMAIL PROTECTED]
[EMAIL PROTECTED]  \ S-168 36  BROMMA  \ T: +46-708-26 53 44
                    \      SWEDEN       \
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to