The threads(3) manpage states that to use OpenSSL in multi-threaded applications then locking callback functions must be set otherwise random crashes may occur.

This poses a challenge when using OpenSSL in a library which should be MT safe. There is no safe way to set the locking callbacks from within the library itself. The calling application may or may not be using OpenSSL or may be linking against multiple libraries some of which may be linked against OpenSSL. The application may not even be aware that it will end up calling into OpenSSL code.

The only safe way to ensure that the OpenSSL code will be MT safe would be for the OpenSSL library itself to set locking callbacks, however I don't see any compile-time option to do that.

Is there a reason I'm missing as to why this option isn't available?

Without this, the library can do its best to set the locking callbacks when loaded if they are not set and then remove them when unloaded, however this will always be inherently racy if there are other parts of the process using OpenSSL.

Thanks,

-M


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to