提交 5b5700be authored 作者: Brian West's avatar Brian West

clean up

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13431 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 a6b7c47d
...@@ -446,7 +446,6 @@ static void zrtp_event_callback(zrtp_stream_t *stream, unsigned event) ...@@ -446,7 +446,6 @@ static void zrtp_event_callback(zrtp_stream_t *stream, unsigned event)
switch_set_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND); switch_set_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND);
switch_set_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_RECV); switch_set_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_RECV);
switch_set_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM); switch_set_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM);
rtp_session->zrtp_mitm_tries = 0;
if (zrtp_status_ok == zrtp_session_get(rtp_session->zrtp_session, &zrtp_session_info)) { if (zrtp_status_ok == zrtp_session_get(rtp_session->zrtp_session, &zrtp_session_info)) {
if (zrtp_session_info.sas_is_ready) { if (zrtp_session_info.sas_is_ready) {
...@@ -512,6 +511,7 @@ static void zrtp_event_callback(zrtp_stream_t *stream, unsigned event) ...@@ -512,6 +511,7 @@ static void zrtp_event_callback(zrtp_stream_t *stream, unsigned event)
switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND); switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND);
switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_RECV); switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_RECV);
switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM); switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM);
rtp_session->zrtp_mitm_tries = 0;
break; break;
case ZRTP_EVENT_NO_ZRTP: case ZRTP_EVENT_NO_ZRTP:
break; break;
...@@ -2260,7 +2260,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp ...@@ -2260,7 +2260,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp
if (zrtp_on && switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM) && switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_RECV)) { if (zrtp_on && switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM) && switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_RECV)) {
frame->extra_data = rtp_session->zrtp_ctx; frame->extra_data = rtp_session->zrtp_ctx;
switch_set_flag(frame, SFF_ZRTP); switch_set_flag(frame, SFF_ZRTP);
if (rtp_session->zrtp_mitm_tries > 1) { if (rtp_session->zrtp_mitm_tries > 10) {
switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM); switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM);
rtp_session->zrtp_mitm_tries = 0; rtp_session->zrtp_mitm_tries = 0;
} }
...@@ -2692,8 +2692,11 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra ...@@ -2692,8 +2692,11 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra
#ifdef ENABLE_ZRTP #ifdef ENABLE_ZRTP
if (zrtp_on && switch_test_flag(frame, SFF_ZRTP) && switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND)) { if (zrtp_on && switch_test_flag(frame, SFF_ZRTP) && switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND)) {
zrtp_resolve_mitm_call(frame->extra_data, rtp_session->zrtp_ctx); zrtp_resolve_mitm_call(frame->extra_data, rtp_session->zrtp_ctx);
switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM); if (rtp_session->zrtp_mitm_tries > 10) {
rtp_session->zrtp_mitm_tries = 0; switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM);
rtp_session->zrtp_mitm_tries = 0;
}
rtp_session->zrtp_mitm_tries++;
} }
#endif #endif
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论