httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank <>
Subject Creating a thread safe module and the problem of calling of 'CRYPTO_set_locking_callback' twice!
Date Tue, 05 Dec 2006 20:45:48 GMT
I am developing a module (using OpenSSL) for apache 2.2.3 and wonder how 
to make it thread safe.

That module uses EVP_EncryptUpdate (and friends) so I have to use 
'CRYPTO_set_id_callback' and 'CRYPTO_set_locking_callback' to make the 
code thread safe. But I am not sure what will happen if the user 
configures mod_ssl! In threaded mode that module calls 
'ssl_util_thread_setup' (in modules/ssl/ssl_util.c) which also calls 
'CRYPTO_set_id_callback' and 'CRYPTO_set_locking_callback'!

So my question is:
- Should I call 'ssl_util_thread_setup' too and a (maybe) second call to 
that function doesn't create problems?
- Should there be a 'Someone_already_called_me_so_go_home'-Variable 
inside the function 'ssl_util_thread_setup' to prevent it from being 
called twice?
- Do I understand something wrong?
- What is the correct approach to solve this dilemma?

Any tips are more than welcome!

View raw message