Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
c63cd006
Commit
c63cd006
authored
6 years ago
by
Joshua Colp
Committed by
Gerrit Code Review
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "libasteriskssl: Allow OpenSSL 1.0.2 configured with no-deprecated."
parents
4ea98e49
1424f42d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main/libasteriskssl.c
+23
-13
23 additions, 13 deletions
main/libasteriskssl.c
with
23 additions
and
13 deletions
main/libasteriskssl.c
+
23
−
13
View file @
c63cd006
/*
/*
* Asterisk -- An open source telephony toolkit.
* Asterisk -- An open source telephony toolkit.
*
*
* Copyright (C) 2009-201
2
, Digium, Inc.
* Copyright (C) 2009-201
8
, Digium, Inc.
*
*
* Russell Bryant <russell@digium.com>
* Russell Bryant <russell@digium.com>
*
*
...
@@ -23,26 +23,28 @@
...
@@ -23,26 +23,28 @@
* \author Russell Bryant <russell@digium.com>
* \author Russell Bryant <russell@digium.com>
*/
*/
/*** MODULEINFO
<support_level>core</support_level>
***/
#include
"asterisk.h"
#include
"asterisk.h"
#include
"asterisk/_private.h"
/* ast_ssl_init() */
#include
"asterisk/_private.h"
/* ast_ssl_init() */
#ifdef HAVE_OPENSSL
#ifdef HAVE_OPENSSL
#include
<openssl/ssl.h>
#include
<openssl/opensslv.h>
/* for OPENSSL_VERSION_NUMBER */
#include
<openssl/err.h>
#endif
#endif
#if defined(HAVE_OPENSSL) && \
#if defined(HAVE_OPENSSL) && \
(!defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
(defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L)
#include
<dlfcn.h>
#include
<dlfcn.h>
/* for dlerror, dlsym, RTLD_NEXT */
#include
<openssl/crypto.h>
/* for CRYPTO_num_locks, CRYPTO_set_id_call... */
#include
<openssl/err.h>
/* for ERR_free_strings */
#include
<openssl/ssl.h>
/* for SSL_library_init, SSL_load_error_str... */
#if OPENSSL_VERSION_NUMBER < 0x10000000L
#include
<pthread.h>
/* for pthread_self */
#endif
#include
"asterisk/utils.h"
#include
"asterisk/lock.h"
/* for ast_mutex_t, ast_mutex_init, ast_mut... */
#include
"asterisk/lock.h"
#include
"asterisk/logger.h"
/* for ast_debug, ast_log, LOG_ERROR */
#include
"asterisk/utils.h"
/* for ast_calloc */
#define get_OpenSSL_function(func) do { real_##func = dlsym(RTLD_NEXT, __stringify(func)); } while(0)
#define get_OpenSSL_function(func) do { real_##func = dlsym(RTLD_NEXT, __stringify(func)); } while(0)
...
@@ -52,10 +54,12 @@ static ast_mutex_t *ssl_locks;
...
@@ -52,10 +54,12 @@ static ast_mutex_t *ssl_locks;
static
int
ssl_num_locks
;
static
int
ssl_num_locks
;
#if OPENSSL_VERSION_NUMBER < 0x10000000L
static
unsigned
long
ssl_threadid
(
void
)
static
unsigned
long
ssl_threadid
(
void
)
{
{
return
(
unsigned
long
)
pthread_self
();
return
(
unsigned
long
)
pthread_self
();
}
}
#endif
static
void
ssl_lock
(
int
mode
,
int
n
,
const
char
*
file
,
int
line
)
static
void
ssl_lock
(
int
mode
,
int
n
,
const
char
*
file
,
int
line
)
{
{
...
@@ -92,6 +96,7 @@ void SSL_load_error_strings(void)
...
@@ -92,6 +96,7 @@ void SSL_load_error_strings(void)
#endif
#endif
}
}
#if OPENSSL_VERSION_NUMBER < 0x10000000L
void
CRYPTO_set_id_callback
(
unsigned
long
(
*
func
)(
void
))
void
CRYPTO_set_id_callback
(
unsigned
long
(
*
func
)(
void
))
{
{
#if defined(AST_DEVMODE)
#if defined(AST_DEVMODE)
...
@@ -100,6 +105,7 @@ void CRYPTO_set_id_callback(unsigned long (*func)(void))
...
@@ -100,6 +105,7 @@ void CRYPTO_set_id_callback(unsigned long (*func)(void))
}
}
#endif
#endif
}
}
#endif
void
CRYPTO_set_locking_callback
(
void
(
*
func
)(
int
mode
,
int
type
,
const
char
*
file
,
int
line
))
void
CRYPTO_set_locking_callback
(
void
(
*
func
)(
int
mode
,
int
type
,
const
char
*
file
,
int
line
))
{
{
...
@@ -125,7 +131,9 @@ int ast_ssl_init(void)
...
@@ -125,7 +131,9 @@ int ast_ssl_init(void)
{
{
unsigned
int
i
;
unsigned
int
i
;
int
(
*
real_SSL_library_init
)(
void
);
int
(
*
real_SSL_library_init
)(
void
);
#if OPENSSL_VERSION_NUMBER < 0x10000000L
void
(
*
real_CRYPTO_set_id_callback
)(
unsigned
long
(
*
)(
void
));
void
(
*
real_CRYPTO_set_id_callback
)(
unsigned
long
(
*
)(
void
));
#endif
void
(
*
real_CRYPTO_set_locking_callback
)(
void
(
*
)(
int
,
int
,
const
char
*
,
int
));
void
(
*
real_CRYPTO_set_locking_callback
)(
void
(
*
)(
int
,
int
,
const
char
*
,
int
));
void
(
*
real_SSL_load_error_strings
)(
void
);
void
(
*
real_SSL_load_error_strings
)(
void
);
const
char
*
errstr
;
const
char
*
errstr
;
...
@@ -145,6 +153,7 @@ int ast_ssl_init(void)
...
@@ -145,6 +153,7 @@ int ast_ssl_init(void)
/* Make OpenSSL usage thread-safe. */
/* Make OpenSSL usage thread-safe. */
#if OPENSSL_VERSION_NUMBER < 0x10000000L
dlerror
();
dlerror
();
get_OpenSSL_function
(
CRYPTO_set_id_callback
);
get_OpenSSL_function
(
CRYPTO_set_id_callback
);
if
((
errstr
=
dlerror
())
!=
NULL
)
{
if
((
errstr
=
dlerror
())
!=
NULL
)
{
...
@@ -156,6 +165,7 @@ int ast_ssl_init(void)
...
@@ -156,6 +165,7 @@ int ast_ssl_init(void)
}
else
{
}
else
{
real_CRYPTO_set_id_callback
(
ssl_threadid
);
real_CRYPTO_set_id_callback
(
ssl_threadid
);
}
}
#endif
dlerror
();
dlerror
();
get_OpenSSL_function
(
CRYPTO_set_locking_callback
);
get_OpenSSL_function
(
CRYPTO_set_locking_callback
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment