Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
1862dae8
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
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看板
提交
1862dae8
编写于
12月 01, 2004
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Perform partial comparison of different character types in X509_NAME_cmp().
上级
b7b46c9a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
12 deletion
+34
-12
CHANGES
CHANGES
+6
-0
crypto/x509/x509_cmp.c
crypto/x509/x509_cmp.c
+28
-12
未找到文件。
CHANGES
浏览文件 @
1862dae8
...
...
@@ -745,6 +745,12 @@
Changes between 0.9.7e and 0.9.7f [XX xxx XXXX]
*) Perform some character comparisons of different types in X509_NAME_cmp:
this is needed for some certificates that reencode DNs into UTF8Strings
(in violation of RFC3280) and can't or wont issue name rollover
certificates.
[Steve Henson]
*) Make an explicit check during certificate validation to see that
the CA setting in each certificate on the chain is correct. As a
side effect always do the following basic checks on extensions,
...
...
crypto/x509/x509_cmp.c
浏览文件 @
1862dae8
...
...
@@ -254,33 +254,49 @@ static int nocase_spacenorm_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
return
0
;
}
static
int
asn1_string_memcmp
(
ASN1_STRING
*
a
,
ASN1_STRING
*
b
)
{
int
j
;
j
=
a
->
length
-
b
->
length
;
if
(
j
)
return
j
;
return
memcmp
(
a
->
data
,
b
->
data
,
a
->
length
);
}
#define STR_TYPE_CMP (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_UTF8STRING)
int
X509_NAME_cmp
(
const
X509_NAME
*
a
,
const
X509_NAME
*
b
)
{
int
i
,
j
;
X509_NAME_ENTRY
*
na
,
*
nb
;
if
(
sk_X509_NAME_ENTRY_num
(
a
->
entries
)
!=
sk_X509_NAME_ENTRY_num
(
b
->
entries
))
return
sk_X509_NAME_ENTRY_num
(
a
->
entries
)
-
sk_X509_NAME_ENTRY_num
(
b
->
entries
);
unsigned
long
nabit
,
nbbit
;
j
=
sk_X509_NAME_ENTRY_num
(
a
->
entries
)
-
sk_X509_NAME_ENTRY_num
(
b
->
entries
);
if
(
j
)
return
j
;
for
(
i
=
sk_X509_NAME_ENTRY_num
(
a
->
entries
)
-
1
;
i
>=
0
;
i
--
)
{
na
=
sk_X509_NAME_ENTRY_value
(
a
->
entries
,
i
);
nb
=
sk_X509_NAME_ENTRY_value
(
b
->
entries
,
i
);
j
=
na
->
value
->
type
-
nb
->
value
->
type
;
if
(
j
)
return
(
j
);
if
(
na
->
value
->
type
==
V_ASN1_PRINTABLESTRING
)
if
(
j
)
{
nabit
=
ASN1_tag2bit
(
na
->
value
->
type
);
nbbit
=
ASN1_tag2bit
(
nb
->
value
->
type
);
if
(
!
(
nabit
&
STR_TYPE_CMP
)
||
!
(
nbbit
&
STR_TYPE_CMP
))
return
j
;
j
=
asn1_string_memcmp
(
na
->
value
,
nb
->
value
);
}
else
if
(
na
->
value
->
type
==
V_ASN1_PRINTABLESTRING
)
j
=
nocase_spacenorm_cmp
(
na
->
value
,
nb
->
value
);
else
if
(
na
->
value
->
type
==
V_ASN1_IA5STRING
&&
OBJ_obj2nid
(
na
->
object
)
==
NID_pkcs9_emailAddress
)
j
=
nocase_cmp
(
na
->
value
,
nb
->
value
);
else
{
j
=
na
->
value
->
length
-
nb
->
value
->
length
;
if
(
j
)
return
(
j
);
j
=
memcmp
(
na
->
value
->
data
,
nb
->
value
->
data
,
na
->
value
->
length
);
}
j
=
asn1_string_memcmp
(
na
->
value
,
nb
->
value
);
if
(
j
)
return
(
j
);
j
=
na
->
set
-
nb
->
set
;
if
(
j
)
return
(
j
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录