<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/9021">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">libasteriskssl: Allow OpenSSL 1.0.2 configured with no-deprecated.<br><br>Use CRYPTO_set_id_callback(.) only with OpenSSL 0.9.8 and older.<br><br>ASTERISK-27867<br><br>Change-Id: Iadd58d5bf6f538eb224203970a4e88e26f259655<br>---<br>M main/libasteriskssl.c<br>1 file changed, 18 insertions(+), 12 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/21/9021/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c<br>index 41c6bcb..af6b778 100644<br>--- a/main/libasteriskssl.c<br>+++ b/main/libasteriskssl.c<br>@@ -1,7 +1,7 @@<br> /*<br> * Asterisk -- An open source telephony toolkit.<br> *<br>- * Copyright (C) 2009-2012, Digium, Inc.<br>+ * Copyright (C) 2009-2018, Digium, Inc.<br> *<br> * Russell Bryant <russell@digium.com><br> *<br>@@ -23,28 +23,28 @@<br> * \author Russell Bryant <russell@digium.com><br> */<br> <br>-/*** MODULEINFO<br>- <support_level>core</support_level><br>- ***/<br>-<br> #include "asterisk.h"<br> <br> ASTERISK_FILE_VERSION(__FILE__, "$Revision$")<br> <br>-#include "asterisk/_private.h" /* ast_ssl_init() */<br>+#include "asterisk/_private.h" /* ast_ssl_init() */<br> <br> #ifdef HAVE_OPENSSL<br>-#include <openssl/ssl.h><br>-#include <openssl/err.h><br>+#include <openssl/opensslv.h> /* for OPENSSL_VERSION_NUMBER */<br> #endif<br> <br> #if defined(HAVE_OPENSSL) && \<br>- (!defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))<br>+ (defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L)<br> <br>-#include <dlfcn.h><br>+#include <dlfcn.h> /* for dlerror, dlsym, RTLD_NEXT */<br>+#include <openssl/crypto.h> /* for CRYPTO_num_locks, CRYPTO_set_id_call... */<br>+#include <openssl/err.h> /* for ERR_free_strings */<br>+#include <openssl/ssl.h> /* for SSL_library_init, SSL_load_error_str... */<br>+#include <pthread.h> /* for pthread_self */<br> <br>-#include "asterisk/utils.h"<br>-#include "asterisk/lock.h"<br>+#include "asterisk/lock.h" /* for ast_mutex_t, ast_mutex_init, ast_mut... */<br>+#include "asterisk/logger.h" /* for ast_debug, ast_log, LOG_ERROR */<br>+#include "asterisk/utils.h" /* for ast_calloc */<br> <br> #define get_OpenSSL_function(func) do { real_##func = dlsym(RTLD_NEXT, __stringify(func)); } while(0)<br> <br>@@ -94,6 +94,7 @@<br> #endif<br> }<br> <br>+#if OPENSSL_VERSION_NUMBER < 0x10000000L<br> void CRYPTO_set_id_callback(unsigned long (*func)(void))<br> {<br> #if defined(AST_DEVMODE)<br>@@ -102,6 +103,7 @@<br> }<br> #endif<br> }<br>+#endif<br> <br> void CRYPTO_set_locking_callback(void (*func)(int mode,int type, const char *file, int line))<br> {<br>@@ -127,7 +129,9 @@<br> {<br> unsigned int i;<br> int (*real_SSL_library_init)(void);<br>+#if OPENSSL_VERSION_NUMBER < 0x10000000L<br> void (*real_CRYPTO_set_id_callback)(unsigned long (*)(void));<br>+#endif<br> void (*real_CRYPTO_set_locking_callback)(void (*)(int, int, const char *, int));<br> void (*real_SSL_load_error_strings)(void);<br> const char *errstr;<br>@@ -147,6 +151,7 @@<br> <br> /* Make OpenSSL usage thread-safe. */<br> <br>+#if OPENSSL_VERSION_NUMBER < 0x10000000L<br> dlerror();<br> get_OpenSSL_function(CRYPTO_set_id_callback);<br> if ((errstr = dlerror()) != NULL) {<br>@@ -158,6 +163,7 @@<br> } else {<br> real_CRYPTO_set_id_callback(ssl_threadid);<br> }<br>+#endif<br> <br> dlerror();<br> get_OpenSSL_function(CRYPTO_set_locking_callback);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9021">change 9021</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9021"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Iadd58d5bf6f538eb224203970a4e88e26f259655 </div>
<div style="display:none"> Gerrit-Change-Number: 9021 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>