Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
ff80280b
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
ff80280b
编写于
4月 06, 2008
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Set contentType attribute just before signing to allow encapsulated content
type to be set at any time in applications.
上级
e45641bd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
12 deletion
+20
-12
crypto/cms/cms_sd.c
crypto/cms/cms_sd.c
+20
-12
未找到文件。
crypto/cms/cms_sd.c
浏览文件 @
ff80280b
...
...
@@ -404,16 +404,17 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
if
(
!
(
flags
&
CMS_NOATTR
))
{
/* Copy content type across */
ASN1_OBJECT
*
ctype
=
OBJ_dup
(
sd
->
encapContentInfo
->
eContentType
);
if
(
!
ctype
)
goto
merr
;
i
=
CMS_signed_add1_attr_by_NID
(
si
,
NID_pkcs9_contentType
,
V_ASN1_OBJECT
,
ctype
,
-
1
);
ASN1_OBJECT_free
(
ctype
);
if
(
i
<=
0
)
goto
merr
;
/* Initialialize signed attributes strutucture so other
* attributes such as signing time etc are added later
* even if we add none here.
*/
if
(
!
si
->
signedAttrs
)
{
si
->
signedAttrs
=
sk_X509_ATTRIBUTE_new_null
();
if
(
!
si
->
signedAttrs
)
goto
merr
;
}
if
(
!
(
flags
&
CMS_NOSMIMECAP
))
{
STACK_OF
(
X509_ALGOR
)
*
smcap
=
NULL
;
...
...
@@ -615,7 +616,8 @@ void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, X509 **signer,
*
psig
=
si
->
signatureAlgorithm
;
}
static
int
cms_SignerInfo_content_sign
(
CMS_SignerInfo
*
si
,
BIO
*
chain
)
static
int
cms_SignerInfo_content_sign
(
CMS_ContentInfo
*
cms
,
CMS_SignerInfo
*
si
,
BIO
*
chain
)
{
EVP_MD_CTX
mctx
;
int
r
=
0
;
...
...
@@ -635,6 +637,8 @@ static int cms_SignerInfo_content_sign(CMS_SignerInfo *si, BIO *chain)
if
(
CMS_signed_get_attr_count
(
si
)
>=
0
)
{
ASN1_OBJECT
*
ctype
=
cms
->
d
.
signedData
->
encapContentInfo
->
eContentType
;
unsigned
char
md
[
EVP_MAX_MD_SIZE
];
unsigned
int
mdlen
;
EVP_DigestFinal_ex
(
&
mctx
,
md
,
&
mdlen
);
...
...
@@ -642,6 +646,10 @@ static int cms_SignerInfo_content_sign(CMS_SignerInfo *si, BIO *chain)
V_ASN1_OCTET_STRING
,
md
,
mdlen
))
goto
err
;
/* Copy content type across */
if
(
CMS_signed_add1_attr_by_NID
(
si
,
NID_pkcs9_contentType
,
V_ASN1_OBJECT
,
ctype
,
-
1
)
<=
0
)
goto
err
;
if
(
!
CMS_SignerInfo_sign
(
si
))
goto
err
;
}
...
...
@@ -683,7 +691,7 @@ int cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain)
for
(
i
=
0
;
i
<
sk_CMS_SignerInfo_num
(
sinfos
);
i
++
)
{
si
=
sk_CMS_SignerInfo_value
(
sinfos
,
i
);
if
(
!
cms_SignerInfo_content_sign
(
si
,
chain
))
if
(
!
cms_SignerInfo_content_sign
(
cms
,
si
,
chain
))
return
0
;
}
cms
->
d
.
signedData
->
encapContentInfo
->
partial
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录