Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
a87a0a6e
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
11 个月 前同步成功
通知
8
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a87a0a6e
编写于
12月 02, 2015
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cleanup: fix all sources that used HMAC_CTX_init
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
dc0099e1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
6 deletion
+6
-6
crypto/evp/p5_crpt2.c
crypto/evp/p5_crpt2.c
+2
-2
crypto/hmac/hmac.c
crypto/hmac/hmac.c
+2
-2
test/hmactest.c
test/hmactest.c
+2
-2
未找到文件。
crypto/evp/p5_crpt2.c
浏览文件 @
a87a0a6e
...
...
@@ -134,7 +134,7 @@ int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
HMAC_CTX_free
(
hctx_tpl
);
return
0
;
}
HMAC_CTX_
ini
t
(
hctx
);
HMAC_CTX_
rese
t
(
hctx
);
memcpy
(
p
,
digtmp
,
cplen
);
for
(
j
=
1
;
j
<
iter
;
j
++
)
{
if
(
!
HMAC_CTX_copy
(
hctx
,
hctx_tpl
))
{
...
...
@@ -148,7 +148,7 @@ int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
HMAC_CTX_free
(
hctx_tpl
);
return
0
;
}
HMAC_CTX_
ini
t
(
hctx
);
HMAC_CTX_
rese
t
(
hctx
);
for
(
k
=
0
;
k
<
cplen
;
k
++
)
p
[
k
]
^=
digtmp
[
k
];
}
...
...
crypto/hmac/hmac.c
浏览文件 @
a87a0a6e
...
...
@@ -131,7 +131,7 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
int
HMAC_Init
(
HMAC_CTX
*
ctx
,
const
void
*
key
,
int
len
,
const
EVP_MD
*
md
)
{
if
(
key
&&
md
)
HMAC_CTX_
ini
t
(
ctx
);
HMAC_CTX_
rese
t
(
ctx
);
return
HMAC_Init_ex
(
ctx
,
key
,
len
,
md
,
NULL
);
}
#endif
...
...
@@ -225,7 +225,7 @@ int HMAC_CTX_reset(HMAC_CTX *ctx)
int
HMAC_CTX_copy
(
HMAC_CTX
*
dctx
,
HMAC_CTX
*
sctx
)
{
if
(
!
HMAC_CTX_
ini
t
(
dctx
))
if
(
!
HMAC_CTX_
rese
t
(
dctx
))
goto
err
;
if
(
!
EVP_MD_CTX_copy_ex
(
dctx
->
i_ctx
,
sctx
->
i_ctx
))
goto
err
;
...
...
test/hmactest.c
浏览文件 @
a87a0a6e
...
...
@@ -193,7 +193,7 @@ int main(int argc, char *argv[])
}
printf
(
"test 4 ok
\n
"
);
test5:
HMAC_CTX_
ini
t
(
ctx
);
HMAC_CTX_
rese
t
(
ctx
);
if
(
HMAC_Init_ex
(
ctx
,
test
[
4
].
key
,
test
[
4
].
key_len
,
NULL
,
NULL
))
{
printf
(
"Should fail to initialise HMAC with empty MD (test 5)
\n
"
);
err
++
;
...
...
@@ -282,7 +282,7 @@ test5:
printf
(
"test 5 ok
\n
"
);
}
test6:
HMAC_CTX_
ini
t
(
ctx
);
HMAC_CTX_
rese
t
(
ctx
);
ctx2
=
HMAC_CTX_new
();
if
(
ctx2
==
NULL
)
{
printf
(
"HMAC malloc failure (test 6)
\n
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录