Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
c81a1509
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看板
提交
c81a1509
编写于
11月 09, 2002
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
X509_NAME_cmp() now compares PrintableString and emailAddress with a value of type
ia5String correctly. PR: 244
上级
a8c12555
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
111 addition
and
3 deletion
+111
-3
CHANGES
CHANGES
+5
-0
crypto/x509/x509_cmp.c
crypto/x509/x509_cmp.c
+106
-3
未找到文件。
CHANGES
浏览文件 @
c81a1509
...
...
@@ -1997,6 +1997,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
Changes between 0.9.6g and 0.9.6h [xx XXX xxxx]
*) Change X509_NAME_cmp() so it applies the special rules on handling
DN values that are of type PrintableString, as well as RDNs of type
emailAddress where the value has the type ia5String.
[stefank@valicert.com via Richard Levitte]
*) Add a SSL_SESS_CACHE_NO_INTERNAL_STORE flag to take over half
the job SSL_SESS_CACHE_NO_INTERNAL_LOOKUP was inconsistently
doing, define a new flag (SSL_SESS_CACHE_NO_INTERNAL) to be
...
...
crypto/x509/x509_cmp.c
浏览文件 @
c81a1509
...
...
@@ -159,6 +159,99 @@ int X509_cmp(const X509 *a, const X509 *b)
}
#endif
/* Case insensitive string comparision */
static
int
nocase_cmp
(
const
ASN1_STRING
*
a
,
const
ASN1_STRING
*
b
)
{
int
i
;
if
(
a
->
length
!=
b
->
length
)
return
(
a
->
length
-
b
->
length
);
for
(
i
=
0
;
i
<
a
->
length
;
i
++
)
{
int
ca
,
cb
;
ca
=
tolower
(
a
->
data
[
i
]);
cb
=
tolower
(
b
->
data
[
i
]);
if
(
ca
!=
cb
)
return
(
ca
-
cb
);
}
return
0
;
}
/* Case insensitive string comparision with space normalization
* Space normalization - ignore leading, trailing spaces,
* multiple spaces between characters are replaced by single space
*/
static
int
nocase_spacenorm_cmp
(
const
ASN1_STRING
*
a
,
const
ASN1_STRING
*
b
)
{
unsigned
char
*
pa
=
NULL
,
*
pb
=
NULL
;
int
la
,
lb
;
la
=
a
->
length
;
lb
=
b
->
length
;
pa
=
a
->
data
;
pb
=
b
->
data
;
/* skip leading spaces */
while
(
la
>
0
&&
isspace
(
*
pa
))
{
la
--
;
pa
++
;
}
while
(
lb
>
0
&&
isspace
(
*
pb
))
{
lb
--
;
pb
++
;
}
/* skip trailing spaces */
while
(
la
>
0
&&
isspace
(
pa
[
la
-
1
]))
la
--
;
while
(
lb
>
0
&&
isspace
(
pb
[
lb
-
1
]))
lb
--
;
/* compare strings with space normalization */
while
(
la
>
0
&&
lb
>
0
)
{
int
ca
,
cb
;
/* compare character */
ca
=
tolower
(
*
pa
);
cb
=
tolower
(
*
pb
);
if
(
ca
!=
cb
)
return
(
ca
-
cb
);
pa
++
;
pb
++
;
la
--
;
lb
--
;
if
(
la
<=
0
||
lb
<=
0
)
break
;
/* is white space next character ? */
if
(
isspace
(
*
pa
)
&&
isspace
(
*
pb
))
{
/* skip remaining white spaces */
while
(
la
>
0
&&
isspace
(
*
pa
))
{
la
--
;
pa
++
;
}
while
(
lb
>
0
&&
isspace
(
*
pb
))
{
lb
--
;
pb
++
;
}
}
}
if
(
la
>
0
||
lb
>
0
)
return
la
-
lb
;
return
0
;
}
int
X509_NAME_cmp
(
const
X509_NAME
*
a
,
const
X509_NAME
*
b
)
{
int
i
,
j
;
...
...
@@ -172,10 +265,20 @@ int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b)
{
na
=
sk_X509_NAME_ENTRY_value
(
a
->
entries
,
i
);
nb
=
sk_X509_NAME_ENTRY_value
(
b
->
entries
,
i
);
j
=
na
->
value
->
length
-
nb
->
value
->
length
;
j
=
na
->
value
->
type
-
nb
->
value
->
type
;
if
(
j
)
return
(
j
);
j
=
memcmp
(
na
->
value
->
data
,
nb
->
value
->
data
,
na
->
value
->
length
);
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
);
}
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录