Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
245c6bc3
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看板
提交
245c6bc3
编写于
8月 17, 2016
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Constify private key decode.
Reviewed-by:
N
Richard Levitte
<
levitte@openssl.org
>
上级
ac4e2577
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
20 addition
and
20 deletion
+20
-20
crypto/asn1/ameth_lib.c
crypto/asn1/ameth_lib.c
+1
-1
crypto/asn1/p8_pkey.c
crypto/asn1/p8_pkey.c
+2
-2
crypto/dh/dh_ameth.c
crypto/dh/dh_ameth.c
+2
-2
crypto/dsa/dsa_ameth.c
crypto/dsa/dsa_ameth.c
+2
-2
crypto/ec/ec_ameth.c
crypto/ec/ec_ameth.c
+2
-2
crypto/ec/ecx_meth.c
crypto/ec/ecx_meth.c
+3
-3
crypto/evp/evp_pkey.c
crypto/evp/evp_pkey.c
+2
-2
crypto/include/internal/asn1_int.h
crypto/include/internal/asn1_int.h
+1
-1
crypto/rsa/rsa_ameth.c
crypto/rsa/rsa_ameth.c
+1
-1
include/openssl/evp.h
include/openssl/evp.h
+1
-1
include/openssl/x509.h
include/openssl/x509.h
+3
-3
未找到文件。
crypto/asn1/ameth_lib.c
浏览文件 @
245c6bc3
...
...
@@ -324,7 +324,7 @@ void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
void
EVP_PKEY_asn1_set_private
(
EVP_PKEY_ASN1_METHOD
*
ameth
,
int
(
*
priv_decode
)
(
EVP_PKEY
*
pk
,
PKCS8_PRIV_KEY_INFO
const
PKCS8_PRIV_KEY_INFO
*
p8inf
),
int
(
*
priv_encode
)
(
PKCS8_PRIV_KEY_INFO
*
p8
,
const
EVP_PKEY
*
pk
),
...
...
crypto/asn1/p8_pkey.c
浏览文件 @
245c6bc3
...
...
@@ -50,9 +50,9 @@ int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj,
return
1
;
}
int
PKCS8_pkey_get0
(
ASN1_OBJECT
**
ppkalg
,
int
PKCS8_pkey_get0
(
const
ASN1_OBJECT
**
ppkalg
,
const
unsigned
char
**
pk
,
int
*
ppklen
,
X509_ALGOR
**
pa
,
PKCS8_PRIV_KEY_INFO
*
p8
)
const
X509_ALGOR
**
pa
,
const
PKCS8_PRIV_KEY_INFO
*
p8
)
{
if
(
ppkalg
)
*
ppkalg
=
p8
->
pkeyalg
->
algorithm
;
...
...
crypto/dh/dh_ameth.c
浏览文件 @
245c6bc3
...
...
@@ -147,14 +147,14 @@ static int dh_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
* explicitly included and the pubkey must be recalculated.
*/
static
int
dh_priv_decode
(
EVP_PKEY
*
pkey
,
PKCS8_PRIV_KEY_INFO
*
p8
)
static
int
dh_priv_decode
(
EVP_PKEY
*
pkey
,
const
PKCS8_PRIV_KEY_INFO
*
p8
)
{
const
unsigned
char
*
p
,
*
pm
;
int
pklen
,
pmlen
;
int
ptype
;
const
void
*
pval
;
const
ASN1_STRING
*
pstr
;
X509_ALGOR
*
palg
;
const
X509_ALGOR
*
palg
;
ASN1_INTEGER
*
privkey
=
NULL
;
DH
*
dh
=
NULL
;
...
...
crypto/dsa/dsa_ameth.c
浏览文件 @
245c6bc3
...
...
@@ -130,14 +130,14 @@ static int dsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
* AlgorithmIdentifier the pubkey must be recalculated.
*/
static
int
dsa_priv_decode
(
EVP_PKEY
*
pkey
,
PKCS8_PRIV_KEY_INFO
*
p8
)
static
int
dsa_priv_decode
(
EVP_PKEY
*
pkey
,
const
PKCS8_PRIV_KEY_INFO
*
p8
)
{
const
unsigned
char
*
p
,
*
pm
;
int
pklen
,
pmlen
;
int
ptype
;
const
void
*
pval
;
const
ASN1_STRING
*
pstr
;
X509_ALGOR
*
palg
;
const
X509_ALGOR
*
palg
;
ASN1_INTEGER
*
privkey
=
NULL
;
BN_CTX
*
ctx
=
NULL
;
...
...
crypto/ec/ec_ameth.c
浏览文件 @
245c6bc3
...
...
@@ -179,13 +179,13 @@ static int eckey_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
return
-
2
;
}
static
int
eckey_priv_decode
(
EVP_PKEY
*
pkey
,
PKCS8_PRIV_KEY_INFO
*
p8
)
static
int
eckey_priv_decode
(
EVP_PKEY
*
pkey
,
const
PKCS8_PRIV_KEY_INFO
*
p8
)
{
const
unsigned
char
*
p
=
NULL
;
const
void
*
pval
;
int
ptype
,
pklen
;
EC_KEY
*
eckey
=
NULL
;
X509_ALGOR
*
palg
;
const
X509_ALGOR
*
palg
;
if
(
!
PKCS8_pkey_get0
(
NULL
,
&
p
,
&
pklen
,
&
palg
,
p8
))
return
0
;
...
...
crypto/ec/ecx_meth.c
浏览文件 @
245c6bc3
...
...
@@ -32,7 +32,7 @@ typedef enum {
}
ecx_key_op_t
;
/* Setup EVP_PKEY using public, private or generation */
static
int
ecx_key_op
(
EVP_PKEY
*
pkey
,
X509_ALGOR
*
palg
,
static
int
ecx_key_op
(
EVP_PKEY
*
pkey
,
const
X509_ALGOR
*
palg
,
const
unsigned
char
*
p
,
int
plen
,
ecx_key_op_t
op
)
{
X25519_KEY
*
xkey
;
...
...
@@ -135,12 +135,12 @@ static int ecx_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
return
!
CRYPTO_memcmp
(
akey
->
pubkey
,
bkey
->
pubkey
,
X25519_KEYLEN
);
}
static
int
ecx_priv_decode
(
EVP_PKEY
*
pkey
,
PKCS8_PRIV_KEY_INFO
*
p8
)
static
int
ecx_priv_decode
(
EVP_PKEY
*
pkey
,
const
PKCS8_PRIV_KEY_INFO
*
p8
)
{
const
unsigned
char
*
p
;
int
plen
;
ASN1_OCTET_STRING
*
oct
=
NULL
;
X509_ALGOR
*
palg
;
const
X509_ALGOR
*
palg
;
int
rv
;
if
(
!
PKCS8_pkey_get0
(
NULL
,
&
p
,
&
plen
,
&
palg
,
p8
))
...
...
crypto/evp/evp_pkey.c
浏览文件 @
245c6bc3
...
...
@@ -18,10 +18,10 @@
/* Extract a private key from a PKCS8 structure */
EVP_PKEY
*
EVP_PKCS82PKEY
(
PKCS8_PRIV_KEY_INFO
*
p8
)
EVP_PKEY
*
EVP_PKCS82PKEY
(
const
PKCS8_PRIV_KEY_INFO
*
p8
)
{
EVP_PKEY
*
pkey
=
NULL
;
ASN1_OBJECT
*
algoid
;
const
ASN1_OBJECT
*
algoid
;
char
obj_tmp
[
80
];
if
(
!
PKCS8_pkey_get0
(
&
algoid
,
NULL
,
NULL
,
NULL
,
p8
))
...
...
crypto/include/internal/asn1_int.h
浏览文件 @
245c6bc3
...
...
@@ -22,7 +22,7 @@ struct evp_pkey_asn1_method_st {
int
(
*
pub_cmp
)
(
const
EVP_PKEY
*
a
,
const
EVP_PKEY
*
b
);
int
(
*
pub_print
)
(
BIO
*
out
,
const
EVP_PKEY
*
pkey
,
int
indent
,
ASN1_PCTX
*
pctx
);
int
(
*
priv_decode
)
(
EVP_PKEY
*
pk
,
PKCS8_PRIV_KEY_INFO
*
p8inf
);
int
(
*
priv_decode
)
(
EVP_PKEY
*
pk
,
const
PKCS8_PRIV_KEY_INFO
*
p8inf
);
int
(
*
priv_encode
)
(
PKCS8_PRIV_KEY_INFO
*
p8
,
const
EVP_PKEY
*
pk
);
int
(
*
priv_print
)
(
BIO
*
out
,
const
EVP_PKEY
*
pkey
,
int
indent
,
ASN1_PCTX
*
pctx
);
...
...
crypto/rsa/rsa_ameth.c
浏览文件 @
245c6bc3
...
...
@@ -101,7 +101,7 @@ static int rsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
return
1
;
}
static
int
rsa_priv_decode
(
EVP_PKEY
*
pkey
,
PKCS8_PRIV_KEY_INFO
*
p8
)
static
int
rsa_priv_decode
(
EVP_PKEY
*
pkey
,
const
PKCS8_PRIV_KEY_INFO
*
p8
)
{
const
unsigned
char
*
p
;
int
pklen
;
...
...
include/openssl/evp.h
浏览文件 @
245c6bc3
...
...
@@ -1068,7 +1068,7 @@ void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
int
(
*
pkey_bits
)
(
const
EVP_PKEY
*
pk
));
void
EVP_PKEY_asn1_set_private
(
EVP_PKEY_ASN1_METHOD
*
ameth
,
int
(
*
priv_decode
)
(
EVP_PKEY
*
pk
,
PKCS8_PRIV_KEY_INFO
const
PKCS8_PRIV_KEY_INFO
*
p8inf
),
int
(
*
priv_encode
)
(
PKCS8_PRIV_KEY_INFO
*
p8
,
const
EVP_PKEY
*
pk
),
...
...
include/openssl/x509.h
浏览文件 @
245c6bc3
...
...
@@ -961,15 +961,15 @@ X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen,
DECLARE_ASN1_FUNCTIONS
(
PKCS8_PRIV_KEY_INFO
)
EVP_PKEY
*
EVP_PKCS82PKEY
(
PKCS8_PRIV_KEY_INFO
*
p8
);
EVP_PKEY
*
EVP_PKCS82PKEY
(
const
PKCS8_PRIV_KEY_INFO
*
p8
);
PKCS8_PRIV_KEY_INFO
*
EVP_PKEY2PKCS8
(
EVP_PKEY
*
pkey
);
int
PKCS8_pkey_set0
(
PKCS8_PRIV_KEY_INFO
*
priv
,
ASN1_OBJECT
*
aobj
,
int
version
,
int
ptype
,
void
*
pval
,
unsigned
char
*
penc
,
int
penclen
);
int
PKCS8_pkey_get0
(
ASN1_OBJECT
**
ppkalg
,
int
PKCS8_pkey_get0
(
const
ASN1_OBJECT
**
ppkalg
,
const
unsigned
char
**
pk
,
int
*
ppklen
,
X509_ALGOR
**
pa
,
PKCS8_PRIV_KEY_INFO
*
p8
);
const
X509_ALGOR
**
pa
,
const
PKCS8_PRIV_KEY_INFO
*
p8
);
const
STACK_OF
(
X509_ATTRIBUTE
)
*
PKCS8_pkey_get0_attrs
(
const
PKCS8_PRIV_KEY_INFO
*
p8
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录