Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
e947f396
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e947f396
编写于
11月 16, 1999
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
New function X509_cmp().
上级
b7cfcfb7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
1 deletion
+22
-1
CHANGES
CHANGES
+6
-0
crypto/x509/x509.h
crypto/x509/x509.h
+2
-0
crypto/x509/x509_cmp.c
crypto/x509/x509_cmp.c
+11
-0
crypto/x509v3/v3_purp.c
crypto/x509v3/v3_purp.c
+3
-1
未找到文件。
CHANGES
浏览文件 @
e947f396
...
...
@@ -4,6 +4,12 @@
Changes between 0.9.4 and 0.9.5 [xx XXX 1999]
*) New function X509_cmp(). Oddly enough there wasn't a function
to compare two certificates. We do this by working out the SHA1
hash and comparing that. X509_cmp() will be needed by the trust
code.
[Steve Henson]
*) Correctly increment the reference count in the SSL_SESSION pointer
returned from SSL_get_session().
[Geoff Thorpe <geoff@eu.c2.net>]
...
...
crypto/x509/x509.h
浏览文件 @
e947f396
...
...
@@ -269,6 +269,7 @@ typedef struct x509_st
unsigned
long
ex_kusage
;
unsigned
long
ex_xkusage
;
unsigned
long
ex_nscert
;
unsigned
char
sha1_hash
[
SHA_DIGEST_LENGTH
];
X509_CERT_AUX
*
aux
;
}
X509
;
...
...
@@ -869,6 +870,7 @@ unsigned long X509_issuer_name_hash(X509 *a);
int
X509_subject_name_cmp
(
X509
*
a
,
X509
*
b
);
unsigned
long
X509_subject_name_hash
(
X509
*
x
);
int
X509_cmp
(
X509
*
a
,
X509
*
b
);
int
X509_NAME_cmp
(
X509_NAME
*
a
,
X509_NAME
*
b
);
unsigned
long
X509_NAME_hash
(
X509_NAME
*
x
);
...
...
crypto/x509/x509_cmp.c
浏览文件 @
e947f396
...
...
@@ -61,6 +61,7 @@
#include <openssl/asn1.h>
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
int
X509_issuer_and_serial_cmp
(
X509
*
a
,
X509
*
b
)
{
...
...
@@ -135,6 +136,16 @@ unsigned long X509_subject_name_hash(X509 *x)
{
return
(
X509_NAME_hash
(
x
->
cert_info
->
subject
));
}
/* Compare two certificates: they must be identical for
* this to work.
*/
int
X509_cmp
(
X509
*
a
,
X509
*
b
)
{
/* ensure hash is valid */
X509_check_purpose
(
a
,
-
1
,
0
);
X509_check_purpose
(
b
,
-
1
,
0
);
return
memcmp
(
a
->
sha1_hash
,
b
->
sha1_hash
,
SHA_DIGEST_LENGTH
);
}
int
X509_NAME_cmp
(
X509_NAME
*
a
,
X509_NAME
*
b
)
{
...
...
crypto/x509v3/v3_purp.c
浏览文件 @
e947f396
...
...
@@ -103,12 +103,13 @@ int X509_check_purpose(X509 *x, int id, int ca)
x509v3_cache_extensions
(
x
);
CRYPTO_w_unlock
(
CRYPTO_LOCK_X509
);
}
if
(
id
==
-
1
)
return
1
;
idx
=
x509_purpose_get_idx
(
id
);
if
(
idx
==
-
1
)
return
-
1
;
pt
=
sk_X509_PURPOSE_value
(
xptable
,
idx
);
return
pt
->
check_purpose
(
pt
,
x
,
ca
);
}
...
...
@@ -199,6 +200,7 @@ static void x509v3_cache_extensions(X509 *x)
STACK_OF
(
ASN1_OBJECT
)
*
extusage
;
int
i
;
if
(
x
->
ex_flags
&
EXFLAG_SET
)
return
;
X509_digest
(
x
,
EVP_sha1
(),
x
->
sha1_hash
,
NULL
);
/* Does subject name match issuer ? */
if
(
X509_NAME_cmp
(
X509_get_subject_name
(
x
),
X509_get_issuer_name
(
x
)))
x
->
ex_flags
|=
EXFLAG_SS
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录