On Fri, May 28, 2004, Thomas Schuerger wrote:

> > > I have problems using the RSA_private_decrypt() function of the crypto
> > > library in parallel with *the same* (RSA *) structure. When using a
> > > single thread, decryption works flawlessly, when using two or more
> > > threads in parallel, decryption mostly fails with PKCS errors.
> > > 
> > > I thought the RSA structure would be accessed read-only so that this
> > > should be thread-safe.
> > > 
> > 
> > There are some montgomery parameters that are cached in the RSA structure when
> > it is first used. You need to set the appropriate locking callbacks to avoid a
> > race condition in a multithreaded environment.
> > 
> > > Any ideas how to solve this? Is there a function that duplicates an
> > > RSA structure so that I can duplicate it before using it?
> > > 
> > 
> > RSAPrivateKey_dup().
> 
> OK, thanks...
> 
> Are there any examples how the locking callbacks can be set and how
> they could be implemented in a Linux environment?
> 

See:

http://www.openssl.org/support/faq.html#PROG1
http://www.openssl.org/docs/crypto/threads.html

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                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to