[asterisk-commits] russell: branch 1.6.1 r205147 - in /branches/1.6.1: ./ include/asterisk/ main...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 8 10:29:14 CDT 2009


Author: russell
Date: Wed Jul  8 10:29:10 2009
New Revision: 205147

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=205147
Log:
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.
........

Added:
    branches/1.6.1/main/ssl.c
      - copied unchanged from r205120, trunk/main/ssl.c
Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/include/asterisk/_private.h
    branches/1.6.1/main/Makefile
    branches/1.6.1/main/asterisk.c
    branches/1.6.1/res/res_crypto.c
    branches/1.6.1/res/res_jabber.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/include/asterisk/_private.h
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/include/asterisk/_private.h?view=diff&rev=205147&r1=205146&r2=205147
==============================================================================
--- branches/1.6.1/include/asterisk/_private.h (original)
+++ branches/1.6.1/include/asterisk/_private.h Wed Jul  8 10:29:10 2009
@@ -38,6 +38,7 @@
 int ast_http_reload(void);		/*!< Provided by http.c */
 int ast_tps_init(void); 		/*!< Provided by taskprocessor.c */
 int ast_timing_init(void);		/*!< Provided by timing.c */
+int ast_ssl_init(void);                 /*!< Porvided by ssl.c */
 
 /*!
  * \brief Reload asterisk modules.

Modified: branches/1.6.1/main/Makefile
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/main/Makefile?view=diff&rev=205147&r1=205146&r2=205147
==============================================================================
--- branches/1.6.1/main/Makefile (original)
+++ branches/1.6.1/main/Makefile Wed Jul  8 10:29:10 2009
@@ -28,7 +28,7 @@
 	cryptostub.o sha1.o http.o fixedjitterbuf.o abstract_jb.o \
 	strcompat.o threadstorage.o dial.o event.o adsistub.o audiohook.o \
 	astobj2.o hashtab.o global_datastores.o version.o \
-	features.o taskprocessor.o timing.o datastore.o poll.o
+	features.o taskprocessor.o timing.o datastore.o poll.o ssl.o
 
 # we need to link in the objects statically, not as a library, because
 # otherwise modules will not have them available if none of the static

Modified: branches/1.6.1/main/asterisk.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/main/asterisk.c?view=diff&rev=205147&r1=205146&r2=205147
==============================================================================
--- branches/1.6.1/main/asterisk.c (original)
+++ branches/1.6.1/main/asterisk.c Wed Jul  8 10:29:10 2009
@@ -3414,6 +3414,11 @@
 		exit(1);
 	}
 
+	if (ast_ssl_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
 	if (load_modules(1)) {		/* Load modules, pre-load only */
 		printf("%s", term_quit());
 		exit(1);

Modified: branches/1.6.1/res/res_crypto.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/res/res_crypto.c?view=diff&rev=205147&r1=205146&r2=205147
==============================================================================
--- branches/1.6.1/res/res_crypto.c (original)
+++ branches/1.6.1/res/res_crypto.c Wed Jul  8 10:29:10 2009
@@ -585,8 +585,6 @@
 /*! \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 */

Modified: branches/1.6.1/res/res_jabber.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/res/res_jabber.c?view=diff&rev=205147&r1=205146&r2=205147
==============================================================================
--- branches/1.6.1/res/res_jabber.c (original)
+++ branches/1.6.1/res/res_jabber.c Wed Jul  8 10:29:10 2009
@@ -540,10 +540,6 @@
 	int sock;
 	
 	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();




More information about the asterisk-commits mailing list