Hello,
I'm trying to write an interface to OpenSSL using BIO pairs. For testing
purposes, I'm doing communication locally in two seperate threads (one
accessing a server context, the other a client context) so I figured I
should worry about thread safety. I read in the OpenSSL documentation
that one could find out if thread support was enabled using this:
#define OPENSSL_THREAD_DEFINES
#include <openssl/opensslconf.h>
#if defined(THREADS)
// thread support enabled
#else
// no thread support
#endif
If I stick to this it appears that I have no thread support here on my
system (Win32), but I see no mention of that OPENSSL_THREAD_DEFINES
macro in opensslconf.h, or anywhere else. Also, I see that
OPENSSL_THREADS is defined in opensslconf.h so I'm basically wondering
if this part of the documentation is out of date and if this
OPENSSL_THREADS means that thread support is enabled. If so, are the
callbacks defined in th-lock.c still valid ? I get a few warnings when I
compile those with my project, but C is like alcohol and cigarettes -
you never watch the warnings.
Next question:
I'll probably do all the locking manually since the threads themselves
aren't defined at the C code level for my app (I'm not sure if thread
support will work transparently with OpenSSL for user level threads). So
I'm wondering if just locking all access to the C module in which
OpenSSL routines are called should be sufficient or are there particular
sequences of calls that should be made atomically (that OpenSSL thread
support would usually deal with) ?
Thanks for reading and eventually for answering.
--
Alain Damiral,
Université Catholique de Louvain - student
alain.damiral'at'student.info.ucl.ac.be
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]