Re: PEM_read_X509 and d2i_X509_fp problem.

2005-05-10 Thread Calista
Yes, I have set up the call-backs exactly as in
crypto\threads\mttest.c

The problem seems to be going away when the replace
the 
fseek with fclose and fopen the file again. Does this
sound weird? (considering that all threads may be
executing this code simultaneously).

if(!(x509=d2i_X509_fp(fp, NULL))) {   
  
  fseek(fp, 0,SEEK_SET);
  x509 = PEM_read_X509( fp, NULL, NULL, NULL );
}

--- Joseph Bruni <[EMAIL PROTECTED]> wrote:

> Did you set up your mutex call-backs needed by the
> library? See the  
> man page for CRYPTO_set_locking_callback, et al for
> details.
> 
> -joe
> 
> 
> On May 6, 2005, at 8:56 AM, Calista wrote:
> 
> > Are the functions
> > d2i_X509_fp and PEM_read_X509 thread safe?
> 
> 




Discover Yahoo! 
Get on-the-go sports scores, stock quotes, news and more. Check it out! 
http://discover.yahoo.com/mobile.html
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: PEM_read_X509 and d2i_X509_fp problem.

2005-05-06 Thread Joseph Bruni
Did you set up your mutex call-backs needed by the library? See the  
man page for CRYPTO_set_locking_callback, et al for details.

-joe
On May 6, 2005, at 8:56 AM, Calista wrote:
Are the functions
d2i_X509_fp and PEM_read_X509 thread safe?



smime.p7s
Description: S/MIME cryptographic signature


PEM_read_X509 and d2i_X509_fp problem.

2005-05-06 Thread Calista
The code below fails sometimes( it prints "error"). I
don't understand why. I have a multi threaded
application, and all the threads may be doing the
following code simultaneously. Are the functions
d2i_X509_fp and PEM_read_X509 thread safe?

The variables - x509, fp, cert_filename are local
non-static variables in the function.

The following is a code snippet.
if((fp = fopen (cert_filename, "r"))) {
   x509=NULL;
   if(!(x509=d2i_X509_fp(fp, NULL))) {  fseek(fp, 0,
SEEK_SET);
x509 = PEM_read_X509( fp, NULL, NULL, NULL );
   }
   
   if( !x509 ) {
  printf("error\n"); 
   }
}

Any help is greatly appreciated in this regard.
Thank you.





__ 
Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]