Common OpenSSL support code. More...
#include "asterisk.h"#include "asterisk/_private.h"#include "asterisk/utils.h"#include "asterisk/lock.h"
Go to the source code of this file.
Functions | |
| int | ast_ssl_init (void) |
Common OpenSSL support code.
Definition in file ssl.c.
| int ast_ssl_init | ( | void | ) |
Porvided by ssl.c
Definition at line 73 of file ssl.c.
References ast_calloc, and ast_mutex_init().
Referenced by main().
{
#ifdef HAVE_OPENSSL
unsigned int i;
SSL_library_init();
SSL_load_error_strings();
ERR_load_crypto_strings();
ERR_load_BIO_strings();
OpenSSL_add_all_algorithms();
/* Make OpenSSL thread-safe. */
CRYPTO_set_id_callback(ssl_threadid);
ssl_num_locks = CRYPTO_num_locks();
if (!(ssl_locks = ast_calloc(ssl_num_locks, sizeof(ssl_locks[0])))) {
return -1;
}
for (i = 0; i < ssl_num_locks; i++) {
ast_mutex_init(&ssl_locks[i]);
}
CRYPTO_set_locking_callback(ssl_lock);
#endif /* HAVE_OPENSSL */
return 0;
}