Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
b6995add
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
8 个月 前同步成功
通知
8
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b6995add
编写于
5月 15, 2005
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make -CSP option work again in pkcs12 utility by checking for
attribute in EVP_PKEY structure.
上级
8ccd06c6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
104 addition
and
0 deletion
+104
-0
CHANGES
CHANGES
+5
-0
apps/pkcs12.c
apps/pkcs12.c
+4
-0
crypto/evp/evp.h
crypto/evp/evp.h
+1
-0
crypto/evp/evp_pkey.c
crypto/evp/evp_pkey.c
+62
-0
crypto/evp/p_lib.c
crypto/evp/p_lib.c
+2
-0
crypto/pkcs12/p12_crt.c
crypto/pkcs12/p12_crt.c
+12
-0
crypto/x509/x509.h
crypto/x509/x509.h
+18
-0
未找到文件。
CHANGES
浏览文件 @
b6995add
...
...
@@ -4,6 +4,11 @@
Changes between 0.9.7h and 0.9.8 [xx XXX xxxx]
*) Add attribute functions to EVP_PKEY structure. Modify
PKCS12_create() to recognize a CSP name attribute and
use it. Make -CSP option work again in pkcs12 utility.
[Steve Henson]
*) Add new functionality to the bn blinding code:
- automatic re-creation of the BN_BLINDING parameters after
a fixed number of uses (currently 32)
...
...
apps/pkcs12.c
浏览文件 @
b6995add
...
...
@@ -538,6 +538,10 @@ int MAIN(int argc, char **argv)
catmp
=
(
unsigned
char
*
)
sk_value
(
canames
,
i
);
X509_alias_set1
(
sk_X509_value
(
certs
,
i
),
catmp
,
-
1
);
}
if
(
csp_name
&&
key
)
EVP_PKEY_add1_attr_by_NID
(
key
,
NID_ms_csp_name
,
MBSTRING_ASC
,
(
unsigned
char
*
)
csp_name
,
-
1
);
#ifdef CRYPTO_MDEBUG
...
...
crypto/evp/evp.h
浏览文件 @
b6995add
...
...
@@ -795,6 +795,7 @@ struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey);
EVP_PKEY
*
EVP_PKEY_new
(
void
);
void
EVP_PKEY_free
(
EVP_PKEY
*
pkey
);
EVP_PKEY
*
d2i_PublicKey
(
int
type
,
EVP_PKEY
**
a
,
const
unsigned
char
**
pp
,
long
length
);
int
i2d_PublicKey
(
EVP_PKEY
*
a
,
unsigned
char
**
pp
);
...
...
crypto/evp/evp_pkey.c
浏览文件 @
b6995add
...
...
@@ -709,3 +709,65 @@ static int eckey_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
return
ret
;
}
#endif
/* EVP_PKEY attribute functions */
int
EVP_PKEY_get_attr_count
(
const
EVP_PKEY
*
key
)
{
return
X509at_get_attr_count
(
key
->
attributes
);
}
int
EVP_PKEY_get_attr_by_NID
(
const
EVP_PKEY
*
key
,
int
nid
,
int
lastpos
)
{
return
X509at_get_attr_by_NID
(
key
->
attributes
,
nid
,
lastpos
);
}
int
EVP_PKEY_get_attr_by_OBJ
(
const
EVP_PKEY
*
key
,
ASN1_OBJECT
*
obj
,
int
lastpos
)
{
return
X509at_get_attr_by_OBJ
(
key
->
attributes
,
obj
,
lastpos
);
}
X509_ATTRIBUTE
*
EVP_PKEY_get_attr
(
const
EVP_PKEY
*
key
,
int
loc
)
{
return
X509at_get_attr
(
key
->
attributes
,
loc
);
}
X509_ATTRIBUTE
*
EVP_PKEY_delete_attr
(
EVP_PKEY
*
key
,
int
loc
)
{
return
X509at_delete_attr
(
key
->
attributes
,
loc
);
}
int
EVP_PKEY_add1_attr
(
EVP_PKEY
*
key
,
X509_ATTRIBUTE
*
attr
)
{
if
(
X509at_add1_attr
(
&
key
->
attributes
,
attr
))
return
1
;
return
0
;
}
int
EVP_PKEY_add1_attr_by_OBJ
(
EVP_PKEY
*
key
,
const
ASN1_OBJECT
*
obj
,
int
type
,
const
unsigned
char
*
bytes
,
int
len
)
{
if
(
X509at_add1_attr_by_OBJ
(
&
key
->
attributes
,
obj
,
type
,
bytes
,
len
))
return
1
;
return
0
;
}
int
EVP_PKEY_add1_attr_by_NID
(
EVP_PKEY
*
key
,
int
nid
,
int
type
,
const
unsigned
char
*
bytes
,
int
len
)
{
if
(
X509at_add1_attr_by_NID
(
&
key
->
attributes
,
nid
,
type
,
bytes
,
len
))
return
1
;
return
0
;
}
int
EVP_PKEY_add1_attr_by_txt
(
EVP_PKEY
*
key
,
const
char
*
attrname
,
int
type
,
const
unsigned
char
*
bytes
,
int
len
)
{
if
(
X509at_add1_attr_by_txt
(
&
key
->
attributes
,
attrname
,
type
,
bytes
,
len
))
return
1
;
return
0
;
}
crypto/evp/p_lib.c
浏览文件 @
b6995add
...
...
@@ -451,6 +451,8 @@ void EVP_PKEY_free(EVP_PKEY *x)
}
#endif
EVP_PKEY_free_it
(
x
);
if
(
x
->
attributes
)
sk_X509_ATTRIBUTE_pop_free
(
x
->
attributes
,
X509_ATTRIBUTE_free
);
OPENSSL_free
(
x
);
}
...
...
crypto/pkcs12/p12_crt.c
浏览文件 @
b6995add
...
...
@@ -122,9 +122,21 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
if
(
pkey
)
{
int
cspidx
;
bag
=
PKCS12_add_key
(
&
bags
,
pkey
,
keytype
,
iter
,
nid_key
,
pass
);
if
(
!
bag
)
goto
err
;
cspidx
=
EVP_PKEY_get_attr_by_NID
(
pkey
,
NID_ms_csp_name
,
-
1
);
if
(
cspidx
>=
0
)
{
X509_ATTRIBUTE
*
cspattr
;
cspattr
=
EVP_PKEY_get_attr
(
pkey
,
cspidx
);
if
(
!
X509at_add1_attr
(
&
bag
->
attrib
,
cspattr
))
goto
err
;
}
if
(
name
&&
!
PKCS12_add_friendlyname
(
bag
,
name
,
-
1
))
goto
err
;
if
(
keyidlen
&&
!
PKCS12_add_localkeyid
(
bag
,
keyid
,
keyidlen
))
...
...
crypto/x509/x509.h
浏览文件 @
b6995add
...
...
@@ -1201,6 +1201,24 @@ int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr);
ASN1_OBJECT
*
X509_ATTRIBUTE_get0_object
(
X509_ATTRIBUTE
*
attr
);
ASN1_TYPE
*
X509_ATTRIBUTE_get0_type
(
X509_ATTRIBUTE
*
attr
,
int
idx
);
int
EVP_PKEY_get_attr_count
(
const
EVP_PKEY
*
key
);
int
EVP_PKEY_get_attr_by_NID
(
const
EVP_PKEY
*
key
,
int
nid
,
int
lastpos
);
int
EVP_PKEY_get_attr_by_OBJ
(
const
EVP_PKEY
*
key
,
ASN1_OBJECT
*
obj
,
int
lastpos
);
X509_ATTRIBUTE
*
EVP_PKEY_get_attr
(
const
EVP_PKEY
*
key
,
int
loc
);
X509_ATTRIBUTE
*
EVP_PKEY_delete_attr
(
EVP_PKEY
*
key
,
int
loc
);
int
EVP_PKEY_add1_attr
(
EVP_PKEY
*
key
,
X509_ATTRIBUTE
*
attr
);
int
EVP_PKEY_add1_attr_by_OBJ
(
EVP_PKEY
*
key
,
const
ASN1_OBJECT
*
obj
,
int
type
,
const
unsigned
char
*
bytes
,
int
len
);
int
EVP_PKEY_add1_attr_by_NID
(
EVP_PKEY
*
key
,
int
nid
,
int
type
,
const
unsigned
char
*
bytes
,
int
len
);
int
EVP_PKEY_add1_attr_by_txt
(
EVP_PKEY
*
key
,
const
char
*
attrname
,
int
type
,
const
unsigned
char
*
bytes
,
int
len
);
int
X509_verify_cert
(
X509_STORE_CTX
*
ctx
);
/* lookup a cert from a X509 STACK */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录