aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_crypto.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-08 15:17:19 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-08 15:17:19 +0000
commitaa0e8f1b3cea3d014c491e9cbf39b4bcd99def1a (patch)
tree64d823c71b2b948b5a724c62f8c4d49fc1d7640b /res/res_crypto.c
parent703f20aebeec4f9f2cace0a06e4e0bad278807a4 (diff)
Move OpenSSL initialization to a single place, make library usage thread-safe.
While doing some reading about OpenSSL, I noticed a couple of things that needed to be improved with our usage of OpenSSL. 1) We had initialization of the library done in multiple modules. This has now been moved to a core function that gets executed during Asterisk startup. We already link OpenSSL into the core for TCP/TLS functionality, so this was the most logical place to do it. 2) OpenSSL is not thread-safe by default. However, making it thread safe is very easy. We just have to provide a couple of callbacks. One callback returns a thread ID. The other handles locking. For more information, start with the "Is OpenSSL thread-safe?" question on the FAQ page of openssl.org. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205120 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_crypto.c')
-rw-r--r--res/res_crypto.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/res/res_crypto.c b/res/res_crypto.c
index d8bf1da45..9a39b2fa0 100644
--- a/res/res_crypto.c
+++ b/res/res_crypto.c
@@ -585,8 +585,6 @@ static struct ast_cli_entry cli_crypto[] = {
/*! \brief initialise the res_crypto module */
static int crypto_init(void)
{
- SSL_library_init();
- ERR_load_crypto_strings();
ast_cli_register_multiple(cli_crypto, ARRAY_LEN(cli_crypto));
/* Install ourselves into stubs */