Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4cac512b
提交
4cac512b
authored
2月 04, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change ssl symbol visibility to specific places in core only
上级
16fa338b
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
76 行增加
和
75 行删除
+76
-75
switch_core.h
src/include/switch_core.h
+0
-7
switch_ssl.h
src/include/switch_ssl.h
+14
-61
switch_core_cert.c
src/switch_core_cert.c
+61
-0
switch_core_media.c
src/switch_core_media.c
+0
-1
switch_rtp.c
src/switch_rtp.c
+1
-6
没有找到文件。
src/include/switch_core.h
浏览文件 @
4cac512b
...
...
@@ -40,12 +40,6 @@
#define SWITCH_CORE_H
#include <switch.h>
#include <openssl/pem.h>
#include <openssl/conf.h>
#include <openssl/x509v3.h>
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#endif
SWITCH_BEGIN_EXTERN_C
#define SWITCH_MAX_CORE_THREAD_SESSION_OBJS 128
...
...
@@ -2518,7 +2512,6 @@ SWITCH_DECLARE(pid_t) switch_fork(void);
SWITCH_DECLARE
(
int
)
switch_core_gen_certs
(
const
char
*
prefix
);
SWITCH_DECLARE
(
int
)
switch_core_cert_gen_fingerprint
(
const
char
*
prefix
,
dtls_fingerprint_t
*
fp
);
SWITCH_DECLARE
(
int
)
switch_core_cert_expand_fingerprint
(
dtls_fingerprint_t
*
fp
,
const
char
*
str
);
SWITCH_DECLARE
(
int
)
switch_core_cert_extract_fingerprint
(
X509
*
x509
,
dtls_fingerprint_t
*
fp
);
SWITCH_DECLARE
(
int
)
switch_core_cert_verify
(
dtls_fingerprint_t
*
fp
);
SWITCH_END_EXTERN_C
...
...
src/include/switch_ssl.h
浏览文件 @
4cac512b
...
...
@@ -37,70 +37,23 @@
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#include <openssl/crypto.h>
#include <openssl/pem.h>
#include <openssl/conf.h>
#include <openssl/x509v3.h>
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#endif
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/bio.h>
static
switch_mutex_t
**
ssl_mutexes
;
static
switch_memory_pool_t
*
ssl_pool
=
NULL
;
static
int
ssl_count
=
0
;
static
inline
void
switch_ssl_ssl_lock_callback
(
int
mode
,
int
type
,
char
*
file
,
int
line
)
{
if
(
mode
&
CRYPTO_LOCK
)
{
switch_mutex_lock
(
ssl_mutexes
[
type
]);
}
else
{
switch_mutex_unlock
(
ssl_mutexes
[
type
]);
}
}
static
inline
unsigned
long
switch_ssl_ssl_thread_id
(
void
)
{
return
(
unsigned
long
)
switch_thread_self
();
}
static
inline
void
switch_ssl_init_ssl_locks
(
void
)
{
int
i
,
num
;
if
(
ssl_count
==
0
)
{
num
=
CRYPTO_num_locks
();
ssl_mutexes
=
OPENSSL_malloc
(
CRYPTO_num_locks
()
*
sizeof
(
switch_mutex_t
*
));
switch_assert
(
ssl_mutexes
!=
NULL
);
switch_core_new_memory_pool
(
&
ssl_pool
);
for
(
i
=
0
;
i
<
num
;
i
++
)
{
switch_mutex_init
(
&
(
ssl_mutexes
[
i
]),
SWITCH_MUTEX_NESTED
,
ssl_pool
);
switch_assert
(
ssl_mutexes
[
i
]
!=
NULL
);
}
CRYPTO_set_id_callback
(
switch_ssl_ssl_thread_id
);
CRYPTO_set_locking_callback
((
void
(
*
)(
int
,
int
,
const
char
*
,
int
))
switch_ssl_ssl_lock_callback
);
}
ssl_count
++
;
}
static
inline
void
switch_ssl_destroy_ssl_locks
()
{
int
i
;
if
(
ssl_count
==
1
)
{
CRYPTO_set_locking_callback
(
NULL
);
for
(
i
=
0
;
i
<
CRYPTO_num_locks
();
i
++
)
{
if
(
ssl_mutexes
[
i
])
{
switch_mutex_destroy
(
ssl_mutexes
[
i
]);
}
}
SWITCH_DECLARE
(
int
)
switch_core_cert_extract_fingerprint
(
X509
*
x509
,
dtls_fingerprint_t
*
fp
);
OPENSSL_free
(
ssl_mutexes
);
ssl_count
--
;
}
}
#else
static
inline
void
switch_ssl_init_ssl_locks
(
void
)
{
return
;
}
static
inline
void
switch_ssl_destroy_ssl_locks
(
void
)
{
return
;
}
static
inline
int
switch_core_cert_extract_fingerprint
(
void
*
x509
,
dtls_fingerprint_t
*
fp
)
{
return
0
;
}
#endif
SWITCH_DECLARE
(
void
)
switch_ssl_destroy_ssl_locks
(
void
);
SWITCH_DECLARE
(
void
)
switch_ssl_init_ssl_locks
(
void
);
#endif
src/switch_core_cert.c
浏览文件 @
4cac512b
...
...
@@ -30,7 +30,68 @@
*/
#include <switch.h>
#include <switch_ssl.h>
static
switch_mutex_t
**
ssl_mutexes
;
static
switch_memory_pool_t
*
ssl_pool
=
NULL
;
static
int
ssl_count
=
0
;
static
inline
void
switch_ssl_ssl_lock_callback
(
int
mode
,
int
type
,
char
*
file
,
int
line
)
{
if
(
mode
&
CRYPTO_LOCK
)
{
switch_mutex_lock
(
ssl_mutexes
[
type
]);
}
else
{
switch_mutex_unlock
(
ssl_mutexes
[
type
]);
}
}
static
inline
unsigned
long
switch_ssl_ssl_thread_id
(
void
)
{
return
(
unsigned
long
)
switch_thread_self
();
}
SWITCH_DECLARE
(
void
)
switch_ssl_init_ssl_locks
(
void
)
{
int
i
,
num
;
if
(
ssl_count
==
0
)
{
num
=
CRYPTO_num_locks
();
ssl_mutexes
=
OPENSSL_malloc
(
CRYPTO_num_locks
()
*
sizeof
(
switch_mutex_t
*
));
switch_assert
(
ssl_mutexes
!=
NULL
);
switch_core_new_memory_pool
(
&
ssl_pool
);
for
(
i
=
0
;
i
<
num
;
i
++
)
{
switch_mutex_init
(
&
(
ssl_mutexes
[
i
]),
SWITCH_MUTEX_NESTED
,
ssl_pool
);
switch_assert
(
ssl_mutexes
[
i
]
!=
NULL
);
}
CRYPTO_set_id_callback
(
switch_ssl_ssl_thread_id
);
CRYPTO_set_locking_callback
((
void
(
*
)(
int
,
int
,
const
char
*
,
int
))
switch_ssl_ssl_lock_callback
);
}
ssl_count
++
;
}
SWITCH_DECLARE
(
void
)
switch_ssl_destroy_ssl_locks
(
void
)
{
int
i
;
if
(
ssl_count
==
1
)
{
CRYPTO_set_locking_callback
(
NULL
);
for
(
i
=
0
;
i
<
CRYPTO_num_locks
();
i
++
)
{
if
(
ssl_mutexes
[
i
])
{
switch_mutex_destroy
(
ssl_mutexes
[
i
]);
}
}
OPENSSL_free
(
ssl_mutexes
);
ssl_count
--
;
}
}
static
const
EVP_MD
*
get_evp_by_name
(
const
char
*
name
)
{
...
...
src/switch_core_media.c
浏览文件 @
4cac512b
...
...
@@ -1055,7 +1055,6 @@ SWITCH_DECLARE(void) switch_core_media_prepare_codecs(switch_core_session_t *ses
goto
ready
;
}
if
((
ocodec
=
switch_channel_get_variable
(
session
->
channel
,
SWITCH_ORIGINATOR_CODEC_VARIABLE
)))
{
if
(
!
codec_string
||
(
smh
->
media_flags
[
SCMF_DISABLE_TRANSCODING
]))
{
codec_string
=
ocodec
;
...
...
src/switch_rtp.c
浏览文件 @
4cac512b
...
...
@@ -49,12 +49,7 @@
#include <srtp.h>
#include <srtp_priv.h>
#include <switch_version.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/bio.h>
#include <switch_ssl.h>
#define READ_INC(rtp_session) switch_mutex_lock(rtp_session->read_mutex); rtp_session->reading++
#define READ_DEC(rtp_session) switch_mutex_unlock(rtp_session->read_mutex); rtp_session->reading--
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论