Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
852bd350
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看板
提交
852bd350
编写于
4月 11, 2008
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix prototype for CMS_decrypt(), don't free up detached content.
上级
a5db50d0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
8 deletion
+26
-8
crypto/cms/cms.h
crypto/cms/cms.h
+1
-1
crypto/cms/cms_smime.c
crypto/cms/cms_smime.c
+25
-7
未找到文件。
crypto/cms/cms.h
浏览文件 @
852bd350
...
...
@@ -177,7 +177,7 @@ CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
const
EVP_CIPHER
*
cipher
,
unsigned
int
flags
);
int
CMS_decrypt
(
CMS_ContentInfo
*
cms
,
EVP_PKEY
*
pkey
,
X509
*
cert
,
BIO
*
d
ata
,
BIO
*
dcon
t
,
BIO
*
d
cont
,
BIO
*
ou
t
,
unsigned
int
flags
);
int
CMS_decrypt_set1_pkey
(
CMS_ContentInfo
*
cms
,
EVP_PKEY
*
pk
,
X509
*
cert
);
...
...
crypto/cms/cms_smime.c
浏览文件 @
852bd350
...
...
@@ -125,6 +125,23 @@ static int check_content(CMS_ContentInfo *cms)
return
1
;
}
static
void
do_free_upto
(
BIO
*
f
,
BIO
*
upto
)
{
if
(
upto
)
{
BIO
*
tbio
;
do
{
tbio
=
BIO_pop
(
f
);
BIO_free
(
f
);
f
=
tbio
;
}
while
(
f
!=
upto
);
}
else
BIO_free_all
(
f
);
}
int
CMS_data
(
CMS_ContentInfo
*
cms
,
BIO
*
out
,
unsigned
int
flags
)
{
BIO
*
cont
;
...
...
@@ -177,7 +194,7 @@ int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
r
=
cms_copy_content
(
out
,
cont
,
flags
);
if
(
r
)
r
=
cms_DigestedData_do_final
(
cms
,
cont
,
1
);
BIO_free_all
(
cont
);
do_free_upto
(
cont
,
d
cont
);
return
r
;
}
...
...
@@ -223,7 +240,7 @@ int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
if
(
!
cont
)
return
0
;
r
=
cms_copy_content
(
out
,
cont
,
flags
);
BIO_free_all
(
cont
);
do_free_upto
(
cont
,
d
cont
);
return
r
;
}
...
...
@@ -411,8 +428,9 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
err:
if
(
dcont
&&
(
tmpin
==
dcont
))
BIO_pop
(
cmsbio
);
BIO_free_all
(
cmsbio
);
do_free_upto
(
cmsbio
,
dcont
);
else
BIO_free_all
(
cmsbio
);
if
(
cms_certs
)
sk_X509_pop_free
(
cms_certs
,
X509_free
);
...
...
@@ -678,7 +696,7 @@ int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert,
if
(
!
cont
)
return
0
;
r
=
cms_copy_content
(
out
,
cont
,
flags
);
BIO_free_all
(
cont
);
do_free_upto
(
cont
,
d
cont
);
return
r
;
}
...
...
@@ -706,7 +724,7 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags)
ret
=
1
;
err:
BIO_free_all
(
cmsbio
);
do_free_upto
(
cmsbio
,
dcont
);
return
ret
;
...
...
@@ -733,7 +751,7 @@ int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
if
(
!
cont
)
return
0
;
r
=
cms_copy_content
(
out
,
cont
,
flags
);
BIO_free_all
(
cont
);
do_free_upto
(
cont
,
d
cont
);
return
r
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录