Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
0508faaa
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0508faaa
编写于
5月 28, 2015
作者:
M
Martin Storsjö
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rtmpdh: Pass the actual buffer size of the output secret key
Signed-off-by:
N
Martin Storsjö
<
martin@martin.st
>
上级
9f1b3050
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
5 deletion
+8
-5
libavformat/rtmpcrypt.c
libavformat/rtmpcrypt.c
+1
-1
libavformat/rtmpdh.c
libavformat/rtmpdh.c
+3
-2
libavformat/rtmpdh.h
libavformat/rtmpdh.h
+4
-2
未找到文件。
libavformat/rtmpcrypt.c
浏览文件 @
0508faaa
...
@@ -163,7 +163,7 @@ int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata,
...
@@ -163,7 +163,7 @@ int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata,
/* compute the shared secret secret in order to compute RC4 keys */
/* compute the shared secret secret in order to compute RC4 keys */
if
((
ret
=
ff_dh_compute_shared_secret_key
(
rt
->
dh
,
serverdata
+
server_pos
,
if
((
ret
=
ff_dh_compute_shared_secret_key
(
rt
->
dh
,
serverdata
+
server_pos
,
128
,
secret_key
))
<
0
)
128
,
secret_key
,
sizeof
(
secret_key
)
))
<
0
)
return
ret
;
return
ret
;
/* set output key */
/* set output key */
...
...
libavformat/rtmpdh.c
浏览文件 @
0508faaa
...
@@ -313,7 +313,8 @@ int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len)
...
@@ -313,7 +313,8 @@ int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len)
}
}
int
ff_dh_compute_shared_secret_key
(
FF_DH
*
dh
,
const
uint8_t
*
pub_key
,
int
ff_dh_compute_shared_secret_key
(
FF_DH
*
dh
,
const
uint8_t
*
pub_key
,
int
pub_key_len
,
uint8_t
*
secret_key
)
int
pub_key_len
,
uint8_t
*
secret_key
,
int
secret_key_len
)
{
{
FFBigNum
q1
=
NULL
,
pub_key_bn
=
NULL
;
FFBigNum
q1
=
NULL
,
pub_key_bn
=
NULL
;
int
ret
;
int
ret
;
...
@@ -333,7 +334,7 @@ int ff_dh_compute_shared_secret_key(FF_DH *dh, const uint8_t *pub_key,
...
@@ -333,7 +334,7 @@ int ff_dh_compute_shared_secret_key(FF_DH *dh, const uint8_t *pub_key,
/* when the public key is valid we have to compute the shared secret key */
/* when the public key is valid we have to compute the shared secret key */
if
((
ret
=
dh_is_valid_public_key
(
pub_key_bn
,
dh
->
p
,
q1
))
<
0
)
{
if
((
ret
=
dh_is_valid_public_key
(
pub_key_bn
,
dh
->
p
,
q1
))
<
0
)
{
goto
fail
;
goto
fail
;
}
else
if
((
ret
=
dh_compute_key
(
dh
,
pub_key_bn
,
pub
_key_len
,
}
else
if
((
ret
=
dh_compute_key
(
dh
,
pub_key_bn
,
secret
_key_len
,
secret_key
))
<
0
)
{
secret_key
))
<
0
)
{
ret
=
AVERROR
(
EINVAL
);
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
goto
fail
;
...
...
libavformat/rtmpdh.h
浏览文件 @
0508faaa
...
@@ -92,11 +92,13 @@ int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len);
...
@@ -92,11 +92,13 @@ int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len);
*
*
* @param dh a Diffie-Hellmann context, containing the private key
* @param dh a Diffie-Hellmann context, containing the private key
* @param pub_key the buffer containing the public key
* @param pub_key the buffer containing the public key
* @param pub_key_len the length of the buffer
* @param pub_key_len the length of the
public key
buffer
* @param secret_key the buffer where the secret key is written
* @param secret_key the buffer where the secret key is written
* @param secret_key_len the length of the secret key buffer
* @return length of the shared secret key on success, negative value otherwise
* @return length of the shared secret key on success, negative value otherwise
*/
*/
int
ff_dh_compute_shared_secret_key
(
FF_DH
*
dh
,
const
uint8_t
*
pub_key
,
int
ff_dh_compute_shared_secret_key
(
FF_DH
*
dh
,
const
uint8_t
*
pub_key
,
int
pub_key_len
,
uint8_t
*
secret_key
);
int
pub_key_len
,
uint8_t
*
secret_key
,
int
secret_key_len
);
#endif
/* AVFORMAT_RTMPDH_H */
#endif
/* AVFORMAT_RTMPDH_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录