Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
7e418832
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
接近 2 年 前同步成功
通知
12
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看板
提交
7e418832
编写于
9月 22, 2015
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid structure access in crypto/ts
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
6a12a574
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
5 deletion
+8
-5
crypto/ts/ts_rsp_sign.c
crypto/ts/ts_rsp_sign.c
+3
-2
crypto/ts/ts_rsp_verify.c
crypto/ts/ts_rsp_verify.c
+5
-3
未找到文件。
crypto/ts/ts_rsp_sign.c
浏览文件 @
7e418832
...
...
@@ -784,12 +784,13 @@ static ESS_CERT_ID *ess_CERT_ID_new_init(X509 *cert, int issuer_needed)
{
ESS_CERT_ID
*
cid
=
NULL
;
GENERAL_NAME
*
name
=
NULL
;
unsigned
char
cert_sha1
[
SHA_DIGEST_LENGTH
];
X509_check_purpose
(
cert
,
-
1
,
0
);
if
((
cid
=
ESS_CERT_ID_new
())
==
NULL
)
goto
err
;
if
(
!
ASN1_OCTET_STRING_set
(
cid
->
hash
,
cert
->
sha1_hash
,
sizeof
(
cert
->
sha1_hash
)
))
X509_digest
(
cert
,
EVP_sha1
(),
cert_sha1
,
NULL
);
if
(
!
ASN1_OCTET_STRING_set
(
cid
->
hash
,
cert_sha1
,
SHA_DIGEST_LENGTH
))
goto
err
;
/* Setting the issuer/serial if requested. */
...
...
crypto/ts/ts_rsp_verify.c
浏览文件 @
7e418832
...
...
@@ -289,10 +289,13 @@ static ESS_SIGNING_CERT *ess_get_signing_cert(PKCS7_SIGNER_INFO *si)
static
int
ts_find_cert
(
STACK_OF
(
ESS_CERT_ID
)
*
cert_ids
,
X509
*
cert
)
{
int
i
;
unsigned
char
cert_sha1
[
SHA_DIGEST_LENGTH
];
if
(
!
cert_ids
||
!
cert
)
return
-
1
;
X509_digest
(
cert
,
EVP_sha1
(),
cert_sha1
,
NULL
);
/* Recompute SHA1 hash of certificate if necessary (side effect). */
X509_check_purpose
(
cert
,
-
1
,
0
);
...
...
@@ -300,9 +303,8 @@ static int ts_find_cert(STACK_OF(ESS_CERT_ID) *cert_ids, X509 *cert)
for
(
i
=
0
;
i
<
sk_ESS_CERT_ID_num
(
cert_ids
);
++
i
)
{
ESS_CERT_ID
*
cid
=
sk_ESS_CERT_ID_value
(
cert_ids
,
i
);
if
(
cid
->
hash
->
length
==
sizeof
(
cert
->
sha1_hash
)
&&
memcmp
(
cid
->
hash
->
data
,
cert
->
sha1_hash
,
sizeof
(
cert
->
sha1_hash
))
==
0
)
{
if
(
cid
->
hash
->
length
==
SHA_DIGEST_LENGTH
&&
memcmp
(
cid
->
hash
->
data
,
cert_sha1
,
SHA_DIGEST_LENGTH
)
==
0
)
{
ESS_ISSUER_SERIAL
*
is
=
cid
->
issuer_serial
;
if
(
!
is
||
!
ts_issuer_serial_cmp
(
is
,
cert
))
return
i
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录