Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
bf26d2e7
提交
bf26d2e7
authored
7月 18, 2018
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid crash when signaled fingerprint does not match the one in DTLS (fixes #209)
上级
e6ebeb97
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
22 行增加
和
16 行删除
+22
-16
DtlsTransport.hpp
worker/include/RTC/DtlsTransport.hpp
+1
-1
DtlsTransport.cpp
worker/src/RTC/DtlsTransport.cpp
+21
-15
没有找到文件。
worker/include/RTC/DtlsTransport.hpp
浏览文件 @
bf26d2e7
...
...
@@ -142,7 +142,7 @@ namespace RTC
bool
CheckStatus
(
int
returnCode
);
void
SendPendingOutgoingDtlsData
();
bool
SetTimeout
();
void
ProcessHandshake
();
bool
ProcessHandshake
();
bool
CheckRemoteFingerprint
();
void
ExtractSrtpKeys
(
RTC
::
SrtpSession
::
Profile
srtpProfile
);
RTC
::
SrtpSession
::
Profile
GetNegotiatedSrtpProfile
();
...
...
worker/src/RTC/DtlsTransport.cpp
浏览文件 @
bf26d2e7
...
...
@@ -859,8 +859,10 @@ namespace RTC
this
->
timer
->
Stop
();
// Process the handshake just once (ignore if DTLS renegotiation).
if
(
!
wasHandshakeDone
)
ProcessHandshake
();
if
(
!
wasHandshakeDone
&&
this
->
remoteFingerprint
.
algorithm
!=
FingerprintAlgorithm
::
NONE
)
return
ProcessHandshake
();
else
return
true
;
}
// Check if the peer sent close alert or a fatal error happened.
else
if
(((
SSL_get_shutdown
(
this
->
ssl
)
&
SSL_RECEIVED_SHUTDOWN
)
!=
0
)
||
err
==
SSL_ERROR_SSL
||
err
==
SSL_ERROR_SYSCALL
)
...
...
@@ -888,8 +890,10 @@ namespace RTC
return
false
;
}
return
true
;
else
{
return
true
;
}
}
inline
void
DtlsTransport
::
SendPendingOutgoingDtlsData
()
...
...
@@ -921,6 +925,10 @@ namespace RTC
{
MS_TRACE
();
MS_ASSERT
(
this
->
state
==
DtlsState
::
CONNECTING
||
this
->
state
==
DtlsState
::
CONNECTED
,
"invalid DTLS state"
);
int64_t
ret
;
struct
timeval
dtlsTimeout
;
uint64_t
timeoutMs
;
...
...
@@ -957,20 +965,13 @@ namespace RTC
return
false
;
}
inline
void
DtlsTransport
::
ProcessHandshake
()
inline
bool
DtlsTransport
::
ProcessHandshake
()
{
MS_TRACE
();
MS_ASSERT
(
this
->
handshakeDone
,
"handshake not done yet"
);
// If the remote fingerprint is not yet set then do nothing (this method
// will be called when the fingerprint is set).
if
(
this
->
remoteFingerprint
.
algorithm
==
FingerprintAlgorithm
::
NONE
)
{
MS_DEBUG_TAG
(
dtls
,
"remote fingerprint not yet set, waiting for it"
);
return
;
}
MS_ASSERT
(
this
->
remoteFingerprint
.
algorithm
!=
FingerprintAlgorithm
::
NONE
,
"remote fingerprint not set"
);
// Validate the remote fingerprint.
if
(
!
CheckRemoteFingerprint
())
...
...
@@ -981,7 +982,7 @@ namespace RTC
this
->
state
=
DtlsState
::
FAILED
;
this
->
listener
->
OnDtlsFailed
(
this
);
return
;
return
false
;
}
// Get the negotiated SRTP profile.
...
...
@@ -992,6 +993,8 @@ namespace RTC
{
// Extract the SRTP keys (will notify the listener with them).
ExtractSrtpKeys
(
srtpProfile
);
return
true
;
}
else
{
...
...
@@ -1004,6 +1007,8 @@ namespace RTC
// Set state and notify the listener.
this
->
state
=
DtlsState
::
FAILED
;
this
->
listener
->
OnDtlsFailed
(
this
);
return
false
;
}
}
...
...
@@ -1051,6 +1056,7 @@ namespace RTC
}
// Compare the remote fingerprint with the value given via signaling.
ret
=
X509_digest
(
certificate
,
hashFunction
,
binaryFingerprint
,
&
size
);
if
(
ret
==
0
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论