Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
29fa0a1a
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,发现更多精彩内容 >>
提交
29fa0a1a
编写于
3月 22, 2016
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make X509_PUBKEY opaque
Reviewed-by:
N
Matt Caswell
<
matt@openssl.org
>
上级
91829e45
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
21 deletion
+27
-21
crypto/asn1/t_spki.c
crypto/asn1/t_spki.c
+3
-1
crypto/x509/x509_cmp.c
crypto/x509/x509_cmp.c
+0
-7
crypto/x509/x_pubkey.c
crypto/x509/x_pubkey.c
+15
-0
crypto/x509v3/v3_skey.c
crypto/x509v3/v3_skey.c
+9
-6
include/openssl/x509.h
include/openssl/x509.h
+0
-7
未找到文件。
crypto/asn1/t_spki.c
浏览文件 @
29fa0a1a
...
...
@@ -70,10 +70,12 @@ int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
{
EVP_PKEY
*
pkey
;
ASN1_IA5STRING
*
chal
;
ASN1_OBJECT
*
spkioid
;
int
i
,
n
;
char
*
s
;
BIO_printf
(
out
,
"Netscape SPKI:
\n
"
);
i
=
OBJ_obj2nid
(
spki
->
spkac
->
pubkey
->
algor
->
algorithm
);
X509_PUBKEY_get0_param
(
&
spkioid
,
NULL
,
NULL
,
NULL
,
spki
->
spkac
->
pubkey
);
i
=
OBJ_obj2nid
(
spkioid
);
BIO_printf
(
out
,
" Public Key Algorithm: %s
\n
"
,
(
i
==
NID_undef
)
?
"UNKNOWN"
:
OBJ_nid2ln
(
i
));
pkey
=
X509_PUBKEY_get
(
spki
->
spkac
->
pubkey
);
...
...
crypto/x509/x509_cmp.c
浏览文件 @
29fa0a1a
...
...
@@ -318,13 +318,6 @@ EVP_PKEY *X509_get_pubkey(X509 *x)
return
X509_PUBKEY_get
(
x
->
cert_info
.
key
);
}
ASN1_BIT_STRING
*
X509_get0_pubkey_bitstr
(
const
X509
*
x
)
{
if
(
!
x
)
return
NULL
;
return
x
->
cert_info
.
key
->
public_key
;
}
int
X509_check_private_key
(
X509
*
x
,
EVP_PKEY
*
k
)
{
EVP_PKEY
*
xk
;
...
...
crypto/x509/x_pubkey.c
浏览文件 @
29fa0a1a
...
...
@@ -61,9 +61,17 @@
#include <openssl/x509.h>
#include "internal/asn1_int.h"
#include "internal/evp_int.h"
#include "internal/x509_int.h"
#include <openssl/rsa.h>
#include <openssl/dsa.h>
struct
X509_pubkey_st
{
X509_ALGOR
*
algor
;
ASN1_BIT_STRING
*
public_key
;
EVP_PKEY
*
pkey
;
CRYPTO_RWLOCK
*
lock
;
};
/* Minor tweak to operation: free up EVP_PKEY */
static
int
pubkey_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
...
...
@@ -375,3 +383,10 @@ int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
*
pa
=
pub
->
algor
;
return
1
;
}
ASN1_BIT_STRING
*
X509_get0_pubkey_bitstr
(
const
X509
*
x
)
{
if
(
x
==
NULL
)
return
NULL
;
return
x
->
cert_info
.
key
->
public_key
;
}
crypto/x509v3/v3_skey.c
浏览文件 @
29fa0a1a
...
...
@@ -104,7 +104,9 @@ static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method,
X509V3_CTX
*
ctx
,
char
*
str
)
{
ASN1_OCTET_STRING
*
oct
;
ASN1_BIT_STRING
*
pk
;
X509_PUBKEY
*
pubkey
;
const
unsigned
char
*
pk
;
int
pklen
;
unsigned
char
pkey_dig
[
EVP_MAX_MD_SIZE
];
unsigned
int
diglen
;
...
...
@@ -125,17 +127,18 @@ static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method,
}
if
(
ctx
->
subject_req
)
p
k
=
ctx
->
subject_req
->
req_info
.
pubkey
->
public_
key
;
p
ubkey
=
ctx
->
subject_req
->
req_info
.
pub
key
;
else
p
k
=
ctx
->
subject_cert
->
cert_info
.
key
->
public_
key
;
p
ubkey
=
ctx
->
subject_cert
->
cert_info
.
key
;
if
(
!
pk
)
{
if
(
pubkey
==
NULL
)
{
X509V3err
(
X509V3_F_S2I_SKEY_ID
,
X509V3_R_NO_PUBLIC_KEY
);
goto
err
;
}
if
(
!
EVP_Digest
(
pk
->
data
,
pk
->
length
,
pkey_dig
,
&
diglen
,
EVP_sha1
(),
NULL
))
X509_PUBKEY_get0_param
(
NULL
,
&
pk
,
&
pklen
,
NULL
,
pubkey
);
if
(
!
EVP_Digest
(
pk
,
pklen
,
pkey_dig
,
&
diglen
,
EVP_sha1
(),
NULL
))
goto
err
;
if
(
!
ASN1_OCTET_STRING_set
(
oct
,
pkey_dig
,
diglen
))
{
...
...
include/openssl/x509.h
浏览文件 @
29fa0a1a
...
...
@@ -120,13 +120,6 @@ typedef struct X509_val_st {
ASN1_TIME
*
notAfter
;
}
X509_VAL
;
struct
X509_pubkey_st
{
X509_ALGOR
*
algor
;
ASN1_BIT_STRING
*
public_key
;
EVP_PKEY
*
pkey
;
CRYPTO_RWLOCK
*
lock
;
};
typedef
struct
X509_sig_st
X509_SIG
;
typedef
struct
X509_name_entry_st
X509_NAME_ENTRY
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录