Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
afff52a3
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看板
提交
afff52a3
编写于
3月 13, 2008
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Free up additional data in RecipientInfo structure
上级
8931b30d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
41 addition
and
9 deletion
+41
-9
crypto/cms/cms_asn1.c
crypto/cms/cms_asn1.c
+38
-9
crypto/cms/cms_lcl.h
crypto/cms/cms_lcl.h
+3
-0
未找到文件。
crypto/cms/cms_asn1.c
浏览文件 @
afff52a3
...
...
@@ -85,19 +85,20 @@ ASN1_NDEF_SEQUENCE(CMS_EncapsulatedContentInfo) = {
ASN1_NDEF_EXP_OPT
(
CMS_EncapsulatedContentInfo
,
eContent
,
ASN1_OCTET_STRING_NDEF
,
0
)
}
ASN1_NDEF_SEQUENCE_END
(
CMS_EncapsulatedContentInfo
)
/* Minor tweak to operation: free up
EVP_PKEY
*/
/* Minor tweak to operation: free up
signer key, cert
*/
static
int
cms_si_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
if
(
operation
==
ASN1_OP_FREE_POST
)
{
{
if
(
operation
==
ASN1_OP_FREE_POST
)
{
CMS_SignerInfo
*
si
=
(
CMS_SignerInfo
*
)
*
pval
;
if
(
si
->
pkey
)
EVP_PKEY_free
(
si
->
pkey
);
if
(
si
->
signer
)
X509_free
(
si
->
signer
);
}
}
return
1
;
}
}
ASN1_SEQUENCE_cb
(
CMS_SignerInfo
,
cms_si_cb
)
=
{
ASN1_SIMPLE
(
CMS_SignerInfo
,
version
,
LONG
),
...
...
@@ -211,13 +212,41 @@ ASN1_SEQUENCE(CMS_OtherRecipientInfo) = {
ASN1_OPT
(
CMS_OtherRecipientInfo
,
oriValue
,
ASN1_ANY
)
}
ASN1_SEQUENCE_END
(
CMS_OtherRecipientInfo
)
ASN1_CHOICE
(
CMS_RecipientInfo
)
=
{
/* Free up RecipientInfo additional data */
static
int
cms_ri_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
if
(
operation
==
ASN1_OP_FREE_POST
)
{
CMS_RecipientInfo
*
ri
=
(
CMS_RecipientInfo
*
)
*
pval
;
if
(
ri
->
type
==
CMS_RECIPINFO_TRANS
)
{
CMS_KeyTransRecipientInfo
*
ktri
=
ri
->
d
.
ktri
;
if
(
ktri
->
pkey
)
EVP_PKEY_free
(
ktri
->
pkey
);
if
(
ktri
->
recip
)
X509_free
(
ktri
->
recip
);
}
else
if
(
ri
->
type
==
CMS_RECIPINFO_KEK
)
{
CMS_KEKRecipientInfo
*
kekri
=
ri
->
d
.
kekri
;
if
(
kekri
->
key
)
{
OPENSSL_cleanse
(
kekri
->
key
,
kekri
->
keylen
);
OPENSSL_free
(
kekri
->
key
);
}
}
}
return
1
;
}
ASN1_CHOICE_cb
(
CMS_RecipientInfo
,
cms_ri_cb
)
=
{
ASN1_SIMPLE
(
CMS_RecipientInfo
,
d
.
ktri
,
CMS_KeyTransRecipientInfo
),
ASN1_IMP
(
CMS_RecipientInfo
,
d
.
kari
,
CMS_KeyAgreeRecipientInfo
,
1
),
ASN1_IMP
(
CMS_RecipientInfo
,
d
.
kekri
,
CMS_KEKRecipientInfo
,
2
),
ASN1_IMP
(
CMS_RecipientInfo
,
d
.
pwri
,
CMS_PasswordRecipientInfo
,
3
),
ASN1_IMP
(
CMS_RecipientInfo
,
d
.
ori
,
CMS_OtherRecipientInfo
,
4
)
}
ASN1_CHOICE_END
(
CMS_RecipientInfo
)
}
ASN1_CHOICE_END
_cb
(
CMS_RecipientInfo
,
CMS_RecipientInfo
,
type
)
ASN1_NDEF_SEQUENCE
(
CMS_EnvelopedData
)
=
{
ASN1_SIMPLE
(
CMS_EnvelopedData
,
version
,
LONG
),
...
...
@@ -275,7 +304,7 @@ ASN1_ADB(CMS_ContentInfo) = {
/* CMS streaming support */
static
int
cms_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
{
ASN1_STREAM_ARG
*
sarg
=
exarg
;
CMS_ContentInfo
*
cms
;
if
(
pval
)
...
...
@@ -300,7 +329,7 @@ static int cms_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
}
return
1
;
}
}
ASN1_NDEF_SEQUENCE_cb
(
CMS_ContentInfo
,
cms_cb
)
=
{
ASN1_SIMPLE
(
CMS_ContentInfo
,
contentType
,
ASN1_OBJECT
),
...
...
crypto/cms/cms_lcl.h
浏览文件 @
afff52a3
...
...
@@ -255,6 +255,9 @@ struct CMS_KEKRecipientInfo_st
CMS_KEKIdentifier
*
kekid
;
X509_ALGOR
*
keyEncryptionAlgorithm
;
ASN1_OCTET_STRING
*
encryptedKey
;
/* Extra Info symmetric key to use */
unsigned
char
*
key
;
size_t
keylen
;
};
struct
CMS_KEKIdentifier_st
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录