aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-08 15:22:43 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-08 15:22:43 +0000
commitdcaf9225a32b5699e13dc51bd847e17b953a647a (patch)
treeda5ac0468a78263babaf1ce1fe000eea765a2811 /res
parent1191562945bd297f501b4e4831ba75c6c111dfdc (diff)
Merged revisions 205120 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r205120 | russell | 2009-07-08 10:17:19 -0500 (Wed, 08 Jul 2009) | 16 lines 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/branches/1.6.0@205139 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_crypto.c2
-rw-r--r--res/res_jabber.c4
2 files changed, 0 insertions, 6 deletions
diff --git a/res/res_crypto.c b/res/res_crypto.c
index e55abe891..1a779968f 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, sizeof(cli_crypto) / sizeof(struct ast_cli_entry));
/* Install ourselves into stubs */
diff --git a/res/res_jabber.c b/res/res_jabber.c
index 543dd909b..5751f42c3 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -541,10 +541,6 @@ static int aji_tls_handshake(struct aji_client *client)
ast_debug(1, "Starting TLS handshake\n");
- /* Load encryption, hashing algorithms and error strings */
- SSL_library_init();
- SSL_load_error_strings();
-
/* Choose an SSL/TLS protocol version, create SSL_CTX */
client->ssl_method = SSLv3_method();
client->ssl_context = SSL_CTX_new(client->ssl_method);