Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b3280ae2
提交
b3280ae2
authored
12月 06, 2011
作者:
Viktor Krikun
提交者:
Travis Cross
3月 31, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Send empty SAS during enrollment and other improvements
(refs #25)
上级
9cd14090
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
42 行增加
和
5 行删除
+42
-5
zrtp.c
src/zrtp.c
+4
-0
zrtp_iface_cache.c
src/zrtp_iface_cache.c
+2
-2
zrtp_pbx.c
src/zrtp_pbx.c
+36
-3
没有找到文件。
src/zrtp.c
浏览文件 @
b3280ae2
...
@@ -831,6 +831,10 @@ zrtp_status_t zrtp_profile_check(const zrtp_profile_t* profile, zrtp_global_t* z
...
@@ -831,6 +831,10 @@ zrtp_status_t zrtp_profile_check(const zrtp_profile_t* profile, zrtp_global_t* z
{
{
uint8_t
i
=
0
;
uint8_t
i
=
0
;
if
(
!
profile
||
!
zrtp
)
{
return
zrtp_status_bad_param
;
}
/*
/*
* Fail if the required base components are not present in the profile.
* Fail if the required base components are not present in the profile.
*/
*/
...
...
src/zrtp_iface_cache.c
浏览文件 @
b3280ae2
...
@@ -912,8 +912,8 @@ void zrtp_def_cache_foreach( zrtp_global_t *global,
...
@@ -912,8 +912,8 @@ void zrtp_def_cache_foreach( zrtp_global_t *global,
if
(
delete
)
{
if
(
delete
)
{
{
{
char
idstr
[
24
*
2
+
1
];
char
idstr
[
24
*
2
+
1
];
ZRTP_LOG
(
3
,(
_ZTU_
,
"\
z
rtp_def_cache_foreach() Delete element id=%s index=%u
\n
"
,
ZRTP_LOG
(
3
,(
_ZTU_
,
"
\
t
rtp_def_cache_foreach() Delete element id=%s index=%u
\n
"
,
hex2str
(
elem
->
id
,
sizeof
(
elem
->
id
),
idstr
,
sizeof
(
idstr
)),
hex2str
(
(
const
char
*
)
elem
->
id
,
sizeof
(
elem
->
id
),
idstr
,
sizeof
(
idstr
)),
elem
->
_index
));
elem
->
_index
));
}
}
...
...
src/zrtp_pbx.c
浏览文件 @
b3280ae2
...
@@ -299,6 +299,10 @@ zrtp_status_t _zrtp_machine_process_while_in_sasrelaying( zrtp_stream_t* stream,
...
@@ -299,6 +299,10 @@ zrtp_status_t _zrtp_machine_process_while_in_sasrelaying( zrtp_stream_t* stream,
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
zrtp_status_t
zrtp_stream_registration_start
(
zrtp_stream_t
*
stream
,
uint32_t
ssrc
)
zrtp_status_t
zrtp_stream_registration_start
(
zrtp_stream_t
*
stream
,
uint32_t
ssrc
)
{
{
if
(
!
stream
)
{
return
zrtp_status_bad_param
;
}
ZRTP_LOG
(
3
,(
_ZTU_
,
"START REGISTRATION STREAM ID=%u mode=%s state=%s.
\n
"
,
ZRTP_LOG
(
3
,(
_ZTU_
,
"START REGISTRATION STREAM ID=%u mode=%s state=%s.
\n
"
,
stream
->
id
,
zrtp_log_mode2str
(
stream
->
mode
),
zrtp_log_state2str
(
stream
->
state
)));
stream
->
id
,
zrtp_log_mode2str
(
stream
->
mode
),
zrtp_log_state2str
(
stream
->
state
)));
...
@@ -313,6 +317,10 @@ zrtp_status_t zrtp_stream_registration_start(zrtp_stream_t* stream, uint32_t ssr
...
@@ -313,6 +317,10 @@ zrtp_status_t zrtp_stream_registration_start(zrtp_stream_t* stream, uint32_t ssr
zrtp_status_t
zrtp_stream_registration_secure
(
zrtp_stream_t
*
stream
)
zrtp_status_t
zrtp_stream_registration_secure
(
zrtp_stream_t
*
stream
)
{
{
if
(
!
stream
)
{
return
zrtp_status_bad_param
;
}
ZRTP_LOG
(
3
,(
_ZTU_
,
"SECURE REGISTRATION STREAM ID=%u mode=%s state=%s.
\n
"
,
ZRTP_LOG
(
3
,(
_ZTU_
,
"SECURE REGISTRATION STREAM ID=%u mode=%s state=%s.
\n
"
,
stream
->
id
,
zrtp_log_mode2str
(
stream
->
mode
),
zrtp_log_state2str
(
stream
->
state
)));
stream
->
id
,
zrtp_log_mode2str
(
stream
->
mode
),
zrtp_log_state2str
(
stream
->
state
)));
...
@@ -331,6 +339,10 @@ zrtp_status_t zrtp_register_with_trusted_mitm(zrtp_stream_t* stream)
...
@@ -331,6 +339,10 @@ zrtp_status_t zrtp_register_with_trusted_mitm(zrtp_stream_t* stream)
zrtp_session_t
*
session
=
stream
->
session
;
zrtp_session_t
*
session
=
stream
->
session
;
zrtp_status_t
s
=
zrtp_status_bad_param
;
zrtp_status_t
s
=
zrtp_status_bad_param
;
if
(
!
stream
)
{
return
zrtp_status_bad_param
;
}
ZRTP_LOG
(
3
,(
_ZTU_
,
"MARKING this call as REGISTRATION ID=%u
\n
"
,
stream
->
id
));
ZRTP_LOG
(
3
,(
_ZTU_
,
"MARKING this call as REGISTRATION ID=%u
\n
"
,
stream
->
id
));
if
(
NULL
==
stream
->
zrtp
->
cb
.
cache_cb
.
on_get_mitm
)
{
if
(
NULL
==
stream
->
zrtp
->
cb
.
cache_cb
.
on_get_mitm
)
{
...
@@ -399,7 +411,11 @@ zrtp_status_t zrtp_register_with_trusted_mitm(zrtp_stream_t* stream)
...
@@ -399,7 +411,11 @@ zrtp_status_t zrtp_register_with_trusted_mitm(zrtp_stream_t* stream)
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
zrtp_status_t
zrtp_link_mitm_calls
(
zrtp_stream_t
*
stream1
,
zrtp_stream_t
*
stream2
)
zrtp_status_t
zrtp_link_mitm_calls
(
zrtp_stream_t
*
stream1
,
zrtp_stream_t
*
stream2
)
{
{
ZRTP_LOG
(
3
,(
_ZTU_
,
"Link to MiTM call together stream1=%u stream2=%u.
\n
"
,
stream1
->
id
,
stream2
->
id
));
if
(
!
stream1
||
!
stream2
)
{
return
zrtp_status_bad_param
;
}
ZRTP_LOG
(
3
,(
_ZTU_
,
"Link to MiTM call together stream1=%u stream2=%u.
\n
"
,
stream1
->
id
,
stream2
->
id
));
/* This APi is for MiTM endpoints only. */
/* This APi is for MiTM endpoints only. */
if
(
stream1
->
zrtp
->
is_mitm
)
{
if
(
stream1
->
zrtp
->
is_mitm
)
{
...
@@ -452,6 +468,10 @@ zrtp_status_t zrtp_update_remote_options( zrtp_stream_t* stream,
...
@@ -452,6 +468,10 @@ zrtp_status_t zrtp_update_remote_options( zrtp_stream_t* stream,
zrtp_status_t
s
=
zrtp_status_ok
;
zrtp_status_t
s
=
zrtp_status_ok
;
char
buff
[
256
];
char
buff
[
256
];
if
(
!
stream
)
{
return
zrtp_status_bad_param
;
}
ZRTP_LOG
(
3
,(
_ZTU_
,
"UPDATE REMOTE SAS OPTIONS mode. ID=%u
\n
"
,
stream
->
id
));
ZRTP_LOG
(
3
,(
_ZTU_
,
"UPDATE REMOTE SAS OPTIONS mode. ID=%u
\n
"
,
stream
->
id
));
ZRTP_LOG
(
3
,(
_ZTU_
,
"transf_sas=%s scheme=%d.
\n
"
,
transf_sas_value
?
ZRTP_LOG
(
3
,(
_ZTU_
,
"transf_sas=%s scheme=%d.
\n
"
,
transf_sas_value
?
hex2str
((
const
char
*
)
transf_sas_value
->
buffer
,
transf_sas_value
->
length
,
(
char
*
)
buff
,
sizeof
(
buff
))
:
"NULL"
,
hex2str
((
const
char
*
)
transf_sas_value
->
buffer
,
transf_sas_value
->
length
,
(
char
*
)
buff
,
sizeof
(
buff
))
:
"NULL"
,
...
@@ -515,6 +535,10 @@ zrtp_status_t zrtp_resolve_mitm_call( zrtp_stream_t* stream1,
...
@@ -515,6 +535,10 @@ zrtp_status_t zrtp_resolve_mitm_call( zrtp_stream_t* stream1,
zrtp_stream_t
*
non_enrolled
=
NULL
;
zrtp_stream_t
*
non_enrolled
=
NULL
;
zrtp_sas_id_t
mitm_sas_scheme
=
ZRTP_COMP_UNKN
;
zrtp_sas_id_t
mitm_sas_scheme
=
ZRTP_COMP_UNKN
;
zrtp_status_t
s
=
zrtp_status_ok
;
zrtp_status_t
s
=
zrtp_status_ok
;
if
(
!
stream1
||
!
stream2
)
{
return
zrtp_status_bad_param
;
}
ZRTP_LOG
(
3
,(
_ZTU_
,
"RESOLVE MITM CALL s1=%u, s2=%u...
\n
"
,
stream1
->
id
,
stream2
->
id
));
ZRTP_LOG
(
3
,(
_ZTU_
,
"RESOLVE MITM CALL s1=%u, s2=%u...
\n
"
,
stream1
->
id
,
stream2
->
id
));
...
@@ -605,8 +629,9 @@ zrtp_status_t zrtp_resolve_mitm_call( zrtp_stream_t* stream1,
...
@@ -605,8 +629,9 @@ zrtp_status_t zrtp_resolve_mitm_call( zrtp_stream_t* stream1,
return
s
;
return
s
;
}
}
/* NOTE: new request from Philip Zimmermann - always send SASRelay to BOTH parties. */
/* If non-enrolled party has SAS scheme different from chosen one - update */
/* If non-enrolled party has SAS scheme different from chosen one - update */
if
(
non_enrolled
->
session
->
sasscheme
->
base
.
id
!=
mitm_sas_scheme
)
{
/*if (non_enrolled->session->sasscheme->base.id != mitm_sas_scheme) { */
s
=
zrtp_update_remote_options
(
non_enrolled
,
s
=
zrtp_update_remote_options
(
non_enrolled
,
mitm_sas_scheme
,
mitm_sas_scheme
,
NULL
,
NULL
,
...
@@ -615,7 +640,7 @@ zrtp_status_t zrtp_resolve_mitm_call( zrtp_stream_t* stream1,
...
@@ -615,7 +640,7 @@ zrtp_status_t zrtp_resolve_mitm_call( zrtp_stream_t* stream1,
if
(
zrtp_status_ok
!=
s
)
{
if
(
zrtp_status_ok
!=
s
)
{
return
s
;
return
s
;
}
}
}
/*}*/
return
s
;
return
s
;
}
}
...
@@ -623,12 +648,20 @@ zrtp_status_t zrtp_resolve_mitm_call( zrtp_stream_t* stream1,
...
@@ -623,12 +648,20 @@ zrtp_status_t zrtp_resolve_mitm_call( zrtp_stream_t* stream1,
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
uint8_t
zrtp_is_user_enrolled
(
zrtp_stream_t
*
stream
)
uint8_t
zrtp_is_user_enrolled
(
zrtp_stream_t
*
stream
)
{
{
if
(
!
stream
)
{
return
zrtp_status_bad_param
;
}
return
(
(
stream
->
session
->
secrets
.
cached
&
ZRTP_BIT_PBX
)
&&
return
(
(
stream
->
session
->
secrets
.
cached
&
ZRTP_BIT_PBX
)
&&
(
stream
->
session
->
secrets
.
matches
&
ZRTP_BIT_PBX
)
);
(
stream
->
session
->
secrets
.
matches
&
ZRTP_BIT_PBX
)
);
}
}
zrtp_stream_t
*
zrtp_choose_one_enrolled
(
zrtp_stream_t
*
stream1
,
zrtp_stream_t
*
stream2
)
zrtp_stream_t
*
zrtp_choose_one_enrolled
(
zrtp_stream_t
*
stream1
,
zrtp_stream_t
*
stream2
)
{
{
if
(
!
stream1
||
!
stream2
)
{
return
NULL
;
}
if
(
zrtp_memcmp
(
stream1
->
session
->
zid
.
buffer
,
if
(
zrtp_memcmp
(
stream1
->
session
->
zid
.
buffer
,
stream2
->
session
->
zid
.
buffer
,
stream2
->
session
->
zid
.
buffer
,
stream1
->
session
->
zid
.
length
)
>
0
)
{
stream1
->
session
->
zid
.
length
)
>
0
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论