Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
db98bbc1
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看板
提交
db98bbc1
编写于
3月 24, 2006
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Initial support for generalized public key parameters.
上级
e4263314
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
84 addition
and
11 deletion
+84
-11
crypto/asn1/ameth_lib.c
crypto/asn1/ameth_lib.c
+11
-5
crypto/asn1/asn1_locl.h
crypto/asn1/asn1_locl.h
+5
-4
crypto/evp/evp.h
crypto/evp/evp.h
+6
-2
crypto/evp/p_lib.c
crypto/evp/p_lib.c
+5
-0
crypto/pem/pem.h
crypto/pem/pem.h
+2
-0
crypto/pem/pem_err.c
crypto/pem/pem_err.c
+1
-0
crypto/pem/pem_pkey.c
crypto/pem/pem_pkey.c
+54
-0
未找到文件。
crypto/asn1/ameth_lib.c
浏览文件 @
db98bbc1
...
...
@@ -70,15 +70,23 @@ extern const EVP_PKEY_ASN1_METHOD eckey_asn1_meth;
/* Keep this sorted in type order !! */
const
EVP_PKEY_ASN1_METHOD
*
standard_methods
[]
=
{
#ifndef OPENSSL_NO_RSA
&
rsa_asn1_meths
[
0
],
&
rsa_asn1_meths
[
1
],
#endif
#ifndef OPENSSL_NO_DH
&
dh_asn1_meth
,
#endif
#ifndef OPENSSL_NO_DSA
&
dsa_asn1_meths
[
0
],
&
dsa_asn1_meths
[
1
],
&
dsa_asn1_meths
[
2
],
&
dsa_asn1_meths
[
3
],
&
dsa_asn1_meths
[
4
],
#endif
#ifndef OPENSSL_NO_EC
&
eckey_asn1_meth
#endif
};
typedef
int
sk_cmp_fn_type
(
const
char
*
const
*
a
,
const
char
*
const
*
b
);
...
...
@@ -209,11 +217,9 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id,
ameth
->
pub_cmp
=
0
;
ameth
->
pub_print
=
0
;
ameth
->
priv_decode
=
0
;
ameth
->
priv_encode
=
0
;
ameth
->
priv_print
=
0
;
ameth
->
pkey_size
=
0
;
ameth
->
pkey_bits
=
0
;
...
...
@@ -225,7 +231,6 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id,
ameth
->
param_cmp
=
0
;
ameth
->
param_print
=
0
;
ameth
->
pkey_free
=
0
;
ameth
->
pkey_ctrl
=
0
;
...
...
@@ -279,8 +284,9 @@ void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
}
void
EVP_PKEY_asn1_set_param
(
EVP_PKEY_ASN1_METHOD
*
ameth
,
int
(
*
param_decode
)(
const
EVP_PKEY
*
pk
,
X509_PUBKEY
*
pub
),
int
(
*
param_encode
)(
X509_PUBKEY
*
pub
,
const
EVP_PKEY
*
pk
),
int
(
*
param_decode
)(
EVP_PKEY
*
pkey
,
const
unsigned
char
**
pder
,
int
derlen
),
int
(
*
param_encode
)(
const
EVP_PKEY
*
pkey
,
unsigned
char
**
pder
),
int
(
*
param_missing
)(
const
EVP_PKEY
*
pk
),
int
(
*
param_copy
)(
EVP_PKEY
*
to
,
const
EVP_PKEY
*
from
),
int
(
*
param_cmp
)(
const
EVP_PKEY
*
a
,
const
EVP_PKEY
*
b
),
...
...
crypto/asn1/asn1_locl.h
浏览文件 @
db98bbc1
/* asn1t.h */
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
* project 200
5
.
* project 200
6
.
*/
/* ====================================================================
* Copyright (c) 200
5
The OpenSSL Project. All rights reserved.
* Copyright (c) 200
6
The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -97,8 +97,9 @@ struct evp_pkey_asn1_method_st
int
(
*
pkey_size
)(
const
EVP_PKEY
*
pk
);
int
(
*
pkey_bits
)(
const
EVP_PKEY
*
pk
);
int
(
*
param_decode
)(
const
EVP_PKEY
*
pk
,
X509_PUBKEY
*
pub
);
int
(
*
param_encode
)(
X509_PUBKEY
*
pub
,
const
EVP_PKEY
*
pk
);
int
(
*
param_decode
)(
EVP_PKEY
*
pkey
,
const
unsigned
char
**
pder
,
int
derlen
);
int
(
*
param_encode
)(
const
EVP_PKEY
*
pkey
,
unsigned
char
**
pder
);
int
(
*
param_missing
)(
const
EVP_PKEY
*
pk
);
int
(
*
param_copy
)(
EVP_PKEY
*
to
,
const
EVP_PKEY
*
from
);
int
(
*
param_cmp
)(
const
EVP_PKEY
*
a
,
const
EVP_PKEY
*
b
);
...
...
crypto/evp/evp.h
浏览文件 @
db98bbc1
...
...
@@ -777,6 +777,7 @@ int EVP_PKEY_type(int type);
int
EVP_PKEY_bits
(
EVP_PKEY
*
pkey
);
int
EVP_PKEY_size
(
EVP_PKEY
*
pkey
);
int
EVP_PKEY_assign
(
EVP_PKEY
*
pkey
,
int
type
,
char
*
key
);
void
*
EVP_PKEY_get0
(
EVP_PKEY
*
pkey
);
#ifndef OPENSSL_NO_RSA
struct
rsa_st
;
...
...
@@ -868,14 +869,17 @@ void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
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
));
void
EVP_PKEY_asn1_set_param
(
EVP_PKEY_ASN1_METHOD
*
ameth
,
int
(
*
param_decode
)(
const
EVP_PKEY
*
pk
,
X509_PUBKEY
*
pub
),
int
(
*
param_encode
)(
X509_PUBKEY
*
pub
,
const
EVP_PKEY
*
pk
),
int
(
*
param_decode
)(
EVP_PKEY
*
pkey
,
const
unsigned
char
**
pder
,
int
derlen
),
int
(
*
param_encode
)(
const
EVP_PKEY
*
pkey
,
unsigned
char
**
pder
),
int
(
*
param_missing
)(
const
EVP_PKEY
*
pk
),
int
(
*
param_copy
)(
EVP_PKEY
*
to
,
const
EVP_PKEY
*
from
),
int
(
*
param_cmp
)(
const
EVP_PKEY
*
a
,
const
EVP_PKEY
*
b
),
int
(
*
param_print
)(
BIO
*
out
,
const
EVP_PKEY
*
pkey
,
int
indent
,
ASN1_PCTX
*
pctx
));
void
EVP_PKEY_asn1_set_free
(
EVP_PKEY_ASN1_METHOD
*
ameth
,
void
(
*
pkey_free
)(
EVP_PKEY
*
pkey
));
void
EVP_PKEY_asn1_set_ctrl
(
EVP_PKEY_ASN1_METHOD
*
ameth
,
...
...
crypto/evp/p_lib.c
浏览文件 @
db98bbc1
...
...
@@ -199,6 +199,11 @@ int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key)
return
(
key
!=
NULL
);
}
void
*
EVP_PKEY_get0
(
EVP_PKEY
*
pkey
)
{
return
pkey
->
pkey
.
ptr
;
}
#ifndef OPENSSL_NO_RSA
int
EVP_PKEY_set1_RSA
(
EVP_PKEY
*
pkey
,
RSA
*
key
)
{
...
...
crypto/pem/pem.h
浏览文件 @
db98bbc1
...
...
@@ -133,6 +133,7 @@ extern "C" {
#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
#define PEM_STRING_ECPARAMETERS "EC PARAMETERS"
#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
#define PEM_STRING_PARAMETERS "PARAMETERS"
/* Note that this structure is initialised by PEM_SealInit and cleaned up
by PEM_SealFinal (at least for now) */
...
...
@@ -724,6 +725,7 @@ void ERR_load_PEM_strings(void);
#define PEM_F_PEM_PK8PKEY 119
#define PEM_F_PEM_READ 108
#define PEM_F_PEM_READ_BIO 109
#define PEM_F_PEM_READ_BIO_PARAMETERS 140
#define PEM_F_PEM_READ_BIO_PRIVATEKEY 123
#define PEM_F_PEM_READ_PRIVATEKEY 124
#define PEM_F_PEM_SEALFINAL 110
...
...
crypto/pem/pem_err.c
浏览文件 @
db98bbc1
...
...
@@ -98,6 +98,7 @@ static ERR_STRING_DATA PEM_str_functs[]=
{
ERR_FUNC
(
PEM_F_PEM_PK8PKEY
),
"PEM_PK8PKEY"
},
{
ERR_FUNC
(
PEM_F_PEM_READ
),
"PEM_read"
},
{
ERR_FUNC
(
PEM_F_PEM_READ_BIO
),
"PEM_read_bio"
},
{
ERR_FUNC
(
PEM_F_PEM_READ_BIO_PARAMETERS
),
"PEM_READ_BIO_PARAMETERS"
},
{
ERR_FUNC
(
PEM_F_PEM_READ_BIO_PRIVATEKEY
),
"PEM_READ_BIO_PRIVATEKEY"
},
{
ERR_FUNC
(
PEM_F_PEM_READ_PRIVATEKEY
),
"PEM_READ_PRIVATEKEY"
},
{
ERR_FUNC
(
PEM_F_PEM_SEALFINAL
),
"PEM_SealFinal"
},
...
...
crypto/pem/pem_pkey.c
浏览文件 @
db98bbc1
...
...
@@ -149,6 +149,60 @@ int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
pem_str
,
bp
,(
char
*
)
x
,
enc
,
kstr
,
klen
,
cb
,
u
);
}
EVP_PKEY
*
PEM_read_bio_Parameters
(
BIO
*
bp
,
EVP_PKEY
**
x
,
pem_password_cb
*
cb
,
void
*
u
)
{
char
*
nm
=
NULL
;
const
unsigned
char
*
p
=
NULL
;
unsigned
char
*
data
=
NULL
;
long
len
;
int
slen
;
EVP_PKEY
*
ret
=
NULL
;
if
(
!
PEM_bytes_read_bio
(
&
data
,
&
len
,
&
nm
,
PEM_STRING_PARAMETERS
,
bp
,
cb
,
u
))
return
NULL
;
p
=
data
;
if
((
slen
=
pem_check_suffix
(
nm
,
"PARAMETERS"
))
>
0
)
{
const
EVP_PKEY_ASN1_METHOD
*
ameth
;
ameth
=
EVP_PKEY_asn1_find_str
(
nm
,
slen
);
if
(
!
ameth
||
!
ameth
->
param_decode
)
goto
err
;
ret
=
EVP_PKEY_new
();
if
(
!
ret
)
goto
err
;
if
(
!
ameth
->
param_decode
(
ret
,
&
p
,
len
))
{
EVP_PKEY_free
(
ret
);
ret
=
NULL
;
goto
err
;
}
if
(
x
)
{
if
(
*
x
)
EVP_PKEY_free
((
EVP_PKEY
*
)
*
x
);
*
x
=
ret
;
}
}
err:
if
(
ret
==
NULL
)
PEMerr
(
PEM_F_PEM_READ_BIO_PARAMETERS
,
ERR_R_ASN1_LIB
);
OPENSSL_free
(
nm
);
OPENSSL_free
(
data
);
return
(
ret
);
}
int
PEM_write_bio_Paramters
(
BIO
*
bp
,
EVP_PKEY
*
x
)
{
char
pem_str
[
80
];
if
(
!
x
->
ameth
||
!
x
->
ameth
->
param_encode
)
return
0
;
BIO_snprintf
(
pem_str
,
80
,
"%s PARAMETERS"
,
x
->
ameth
->
pem_str
);
return
PEM_ASN1_write_bio
(
(
i2d_of_void
*
)
openssl_fcast
(
x
->
ameth
->
param_encode
),
pem_str
,
bp
,(
char
*
)
x
,
NULL
,
NULL
,
0
,
0
,
NULL
);
}
#ifndef OPENSSL_NO_FP_API
EVP_PKEY
*
PEM_read_PrivateKey
(
FILE
*
fp
,
EVP_PKEY
**
x
,
pem_password_cb
*
cb
,
void
*
u
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录