Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
af170194
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
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,发现更多精彩内容 >>
提交
af170194
编写于
10月 07, 2015
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
embed OCSP_CERTID
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
47c9a1b5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
23 deletion
+22
-23
crypto/ocsp/ocsp_asn.c
crypto/ocsp/ocsp_asn.c
+3
-3
crypto/ocsp/ocsp_lcl.h
crypto/ocsp/ocsp_lcl.h
+3
-3
crypto/ocsp/ocsp_lib.c
crypto/ocsp/ocsp_lib.c
+6
-7
crypto/ocsp/ocsp_prn.c
crypto/ocsp/ocsp_prn.c
+3
-3
crypto/ocsp/ocsp_srv.c
crypto/ocsp/ocsp_srv.c
+3
-3
crypto/ocsp/ocsp_vfy.c
crypto/ocsp/ocsp_vfy.c
+4
-4
未找到文件。
crypto/ocsp/ocsp_asn.c
浏览文件 @
af170194
...
...
@@ -71,9 +71,9 @@ IMPLEMENT_ASN1_FUNCTIONS(OCSP_SIGNATURE)
ASN1_SEQUENCE
(
OCSP_CERTID
)
=
{
ASN1_EMBED
(
OCSP_CERTID
,
hashAlgorithm
,
X509_ALGOR
),
ASN1_
SIMPLE
(
OCSP_CERTID
,
issuerNameHash
,
ASN1_OCTET_STRING
),
ASN1_
SIMPLE
(
OCSP_CERTID
,
issuerKeyHash
,
ASN1_OCTET_STRING
),
ASN1_
SIMPLE
(
OCSP_CERTID
,
serialNumber
,
ASN1_INTEGER
)
ASN1_
EMBED
(
OCSP_CERTID
,
issuerNameHash
,
ASN1_OCTET_STRING
),
ASN1_
EMBED
(
OCSP_CERTID
,
issuerKeyHash
,
ASN1_OCTET_STRING
),
ASN1_
EMBED
(
OCSP_CERTID
,
serialNumber
,
ASN1_INTEGER
)
}
ASN1_SEQUENCE_END
(
OCSP_CERTID
)
IMPLEMENT_ASN1_FUNCTIONS
(
OCSP_CERTID
)
...
...
crypto/ocsp/ocsp_lcl.h
浏览文件 @
af170194
...
...
@@ -72,9 +72,9 @@
*/
struct
ocsp_cert_id_st
{
X509_ALGOR
hashAlgorithm
;
ASN1_OCTET_STRING
*
issuerNameHash
;
ASN1_OCTET_STRING
*
issuerKeyHash
;
ASN1_INTEGER
*
serialNumber
;
ASN1_OCTET_STRING
issuerNameHash
;
ASN1_OCTET_STRING
issuerKeyHash
;
ASN1_INTEGER
serialNumber
;
};
/*- Request ::= SEQUENCE {
...
...
crypto/ocsp/ocsp_lib.c
浏览文件 @
af170194
...
...
@@ -123,19 +123,18 @@ OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
if
(
!
X509_NAME_digest
(
issuerName
,
dgst
,
md
,
&
i
))
goto
digerr
;
if
(
!
(
ASN1_OCTET_STRING_set
(
cid
->
issuerNameHash
,
md
,
i
)))
if
(
!
(
ASN1_OCTET_STRING_set
(
&
cid
->
issuerNameHash
,
md
,
i
)))
goto
err
;
/* Calculate the issuerKey hash, excluding tag and length */
if
(
!
EVP_Digest
(
issuerKey
->
data
,
issuerKey
->
length
,
md
,
&
i
,
dgst
,
NULL
))
goto
err
;
if
(
!
(
ASN1_OCTET_STRING_set
(
cid
->
issuerKeyHash
,
md
,
i
)))
if
(
!
(
ASN1_OCTET_STRING_set
(
&
cid
->
issuerKeyHash
,
md
,
i
)))
goto
err
;
if
(
serialNumber
)
{
ASN1_INTEGER_free
(
cid
->
serialNumber
);
if
((
cid
->
serialNumber
=
ASN1_INTEGER_dup
(
serialNumber
))
==
NULL
)
if
(
ASN1_STRING_copy
(
&
cid
->
serialNumber
,
serialNumber
)
==
0
)
goto
err
;
}
return
cid
;
...
...
@@ -152,10 +151,10 @@ int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b)
ret
=
OBJ_cmp
(
a
->
hashAlgorithm
.
algorithm
,
b
->
hashAlgorithm
.
algorithm
);
if
(
ret
)
return
ret
;
ret
=
ASN1_OCTET_STRING_cmp
(
a
->
issuerNameHash
,
b
->
issuerNameHash
);
ret
=
ASN1_OCTET_STRING_cmp
(
&
a
->
issuerNameHash
,
&
b
->
issuerNameHash
);
if
(
ret
)
return
ret
;
return
ASN1_OCTET_STRING_cmp
(
a
->
issuerKeyHash
,
b
->
issuerKeyHash
);
return
ASN1_OCTET_STRING_cmp
(
&
a
->
issuerKeyHash
,
&
b
->
issuerKeyHash
);
}
int
OCSP_id_cmp
(
OCSP_CERTID
*
a
,
OCSP_CERTID
*
b
)
...
...
@@ -164,7 +163,7 @@ int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b)
ret
=
OCSP_id_issuer_cmp
(
a
,
b
);
if
(
ret
)
return
ret
;
return
ASN1_INTEGER_cmp
(
a
->
serialNumber
,
b
->
serialNumber
);
return
ASN1_INTEGER_cmp
(
&
a
->
serialNumber
,
&
b
->
serialNumber
);
}
/*
...
...
crypto/ocsp/ocsp_prn.c
浏览文件 @
af170194
...
...
@@ -77,11 +77,11 @@ static int ocsp_certid_print(BIO *bp, OCSP_CERTID *a, int indent)
BIO_printf
(
bp
,
"%*sHash Algorithm: "
,
indent
,
""
);
i2a_ASN1_OBJECT
(
bp
,
a
->
hashAlgorithm
.
algorithm
);
BIO_printf
(
bp
,
"
\n
%*sIssuer Name Hash: "
,
indent
,
""
);
i2a_ASN1_STRING
(
bp
,
a
->
issuerNameHash
,
V_ASN1_OCTET_STRING
);
i2a_ASN1_STRING
(
bp
,
&
a
->
issuerNameHash
,
V_ASN1_OCTET_STRING
);
BIO_printf
(
bp
,
"
\n
%*sIssuer Key Hash: "
,
indent
,
""
);
i2a_ASN1_STRING
(
bp
,
a
->
issuerKeyHash
,
V_ASN1_OCTET_STRING
);
i2a_ASN1_STRING
(
bp
,
&
a
->
issuerKeyHash
,
V_ASN1_OCTET_STRING
);
BIO_printf
(
bp
,
"
\n
%*sSerial Number: "
,
indent
,
""
);
i2a_ASN1_INTEGER
(
bp
,
a
->
serialNumber
);
i2a_ASN1_INTEGER
(
bp
,
&
a
->
serialNumber
);
BIO_printf
(
bp
,
"
\n
"
);
return
1
;
}
...
...
crypto/ocsp/ocsp_srv.c
浏览文件 @
af170194
...
...
@@ -96,11 +96,11 @@ int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
if
(
pmd
)
*
pmd
=
cid
->
hashAlgorithm
.
algorithm
;
if
(
piNameHash
)
*
piNameHash
=
cid
->
issuerNameHash
;
*
piNameHash
=
&
cid
->
issuerNameHash
;
if
(
pikeyHash
)
*
pikeyHash
=
cid
->
issuerKeyHash
;
*
pikeyHash
=
&
cid
->
issuerKeyHash
;
if
(
pserial
)
*
pserial
=
cid
->
serialNumber
;
*
pserial
=
&
cid
->
serialNumber
;
return
1
;
}
...
...
crypto/ocsp/ocsp_vfy.c
浏览文件 @
af170194
...
...
@@ -324,16 +324,16 @@ static int ocsp_match_issuerid(X509 *cert, OCSP_CERTID *cid,
mdlen
=
EVP_MD_size
(
dgst
);
if
(
mdlen
<
0
)
return
-
1
;
if
((
cid
->
issuerNameHash
->
length
!=
mdlen
)
||
(
cid
->
issuerKeyHash
->
length
!=
mdlen
))
if
((
cid
->
issuerNameHash
.
length
!=
mdlen
)
||
(
cid
->
issuerKeyHash
.
length
!=
mdlen
))
return
0
;
iname
=
X509_get_subject_name
(
cert
);
if
(
!
X509_NAME_digest
(
iname
,
dgst
,
md
,
NULL
))
return
-
1
;
if
(
memcmp
(
md
,
cid
->
issuerNameHash
->
data
,
mdlen
))
if
(
memcmp
(
md
,
cid
->
issuerNameHash
.
data
,
mdlen
))
return
0
;
X509_pubkey_digest
(
cert
,
dgst
,
md
,
NULL
);
if
(
memcmp
(
md
,
cid
->
issuerKeyHash
->
data
,
mdlen
))
if
(
memcmp
(
md
,
cid
->
issuerKeyHash
.
data
,
mdlen
))
return
0
;
return
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录