31 #include <openssl/opensslv.h> 34 #if defined(HAVE_OPENSSL) && \ 35 (defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L) 38 #include <openssl/crypto.h> 39 #include <openssl/err.h> 40 #include <openssl/ssl.h> 41 #if OPENSSL_VERSION_NUMBER < 0x10000000L 49 #define get_OpenSSL_function(func) do { real_##func = dlsym(RTLD_NEXT, __stringify(func)); } while(0) 57 #if OPENSSL_VERSION_NUMBER < 0x10000000L 60 return (
unsigned long) pthread_self();
68 "ssl_num_locks '%d' - n '%d'\n",
82 #if defined(AST_DEVMODE) 84 ast_debug(1,
"Called after startup... ignoring!\n");
92 #if defined(AST_DEVMODE) 94 ast_debug(1,
"Called after startup... ignoring!\n");
99 #if OPENSSL_VERSION_NUMBER < 0x10000000L 102 #if defined(AST_DEVMODE) 104 ast_debug(1,
"Called after startup... ignoring!\n");
112 #if defined(AST_DEVMODE) 114 ast_debug(1,
"Called after startup... ignoring!\n");
133 int (*real_SSL_library_init)(void);
134 #if OPENSSL_VERSION_NUMBER < 0x10000000L 135 void (*real_CRYPTO_set_id_callback)(
unsigned long (*)(void));
137 void (*real_CRYPTO_set_locking_callback)(void (*)(int, int,
const char *, int));
138 void (*real_SSL_load_error_strings)(void);
144 if ((errstr = dlerror()) !=
NULL) {
145 ast_debug(1,
"unable to get real address of SSL_library_init: %s\n", errstr);
151 real_SSL_library_init();
156 #if OPENSSL_VERSION_NUMBER < 0x10000000L 159 if ((errstr = dlerror()) !=
NULL) {
160 ast_debug(1,
"unable to get real address of CRYPTO_set_id_callback: %s\n", errstr);
172 if ((errstr = dlerror()) !=
NULL) {
173 ast_debug(1,
"unable to get real address of CRYPTO_set_locking_callback: %s\n", errstr);
186 real_CRYPTO_set_locking_callback(
ssl_lock);
196 real_SSL_load_error_strings();
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
#define ast_mutex_lock(a)
void SSL_load_error_strings(void)
#define ast_debug(level,...)
Log a DEBUG message.
static unsigned long ssl_threadid(void)
void CRYPTO_set_id_callback(unsigned long(*func)(void))
static ast_mutex_t * ssl_locks
static void ssl_lock(int mode, int n, const char *file, int line)
int SSL_library_init(void)
#define ast_calloc(num, len)
A wrapper for calloc()
Prototypes for public functions only of internal interest,.
void ERR_free_strings(void)
Support for logging to various files, console and syslog Configuration in file logger.conf.
#define ast_mutex_init(pmutex)
void CRYPTO_set_locking_callback(void(*func)(int mode, int type, const char *file, int line))
Structure for mutex and tracking information.
#define get_OpenSSL_function(func)
#define ast_mutex_unlock(a)
static int startup_complete