Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
6b2ebe43
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
接近 2 年 前同步成功
通知
12
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看板
提交
6b2ebe43
编写于
2月 22, 2016
作者:
R
Rich Salz
提交者:
Rich Salz
2月 23, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add PKCS7_NO_DUAL_CONTENT flag
Signed-off-by:
N
Rich Salz
<
rsalz@openssl.org
>
Reviewed-by:
N
Tim Hudson
<
tjh@openssl.org
>
上级
893fe73a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
5 deletion
+21
-5
crypto/pkcs7/pk7_smime.c
crypto/pkcs7/pk7_smime.c
+12
-4
doc/crypto/PKCS7_verify.pod
doc/crypto/PKCS7_verify.pod
+8
-1
include/openssl/pkcs7.h
include/openssl/pkcs7.h
+1
-0
未找到文件。
crypto/pkcs7/pk7_smime.c
浏览文件 @
6b2ebe43
...
...
@@ -279,10 +279,18 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
return
0
;
}
/* Check for data and content: two sets of data */
if
(
!
PKCS7_get_detached
(
p7
)
&&
indata
)
{
PKCS7err
(
PKCS7_F_PKCS7_VERIFY
,
PKCS7_R_CONTENT_AND_DATA_PRESENT
);
return
0
;
if
(
flags
&
PKCS7_NO_DUAL_CONTENT
)
{
/*
* This was originally "#if 0" because we thought that only old broken
* Netscape did this. It turns out that Authenticode uses this kind
* of "extended" PKCS7 format, and things like UEFI secure boot and
* tools like osslsigncode need it. In Authenticode the verification
* process is different, but the existing PKCs7 verification works.
*/
if
(
!
PKCS7_get_detached
(
p7
)
&&
indata
)
{
PKCS7err
(
PKCS7_F_PKCS7_VERIFY
,
PKCS7_R_CONTENT_AND_DATA_PRESENT
);
return
0
;
}
}
sinfos
=
PKCS7_get_signer_info
(
p7
);
...
...
doc/crypto/PKCS7_verify.pod
浏览文件 @
6b2ebe43
...
...
@@ -8,6 +8,8 @@ PKCS7_verify, PKCS7_get0_signers - verify a PKCS#7 signedData structure
#include <openssl/pkcs7.h>
#define PKCS7_NO_DUAL_CONTENT
int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, BIO *indata, BIO *out, int flags);
STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags);
...
...
@@ -34,7 +36,12 @@ Normally the verify process proceeds as follows.
Initially some sanity checks are performed on B<p7>. The type of B<p7> must
be signedData. There must be at least one signature on the data and if
the content is detached B<indata> cannot be B<NULL>.
the content is detached B<indata> cannot be B<NULL>. If the content is
not detached and B<indata> is not B<NULL>, then the structure has both
embedded and external content. To treat this as an error, use the flag
B<PKCS7_NO_DUAL_CONTENT>.
The default behavior allows this, for compatibility with older
versions of OpenSSL.
An attempt is made to locate all the signer's certificates, first looking in
the B<certs> parameter (if it is not B<NULL>) and then looking in any certificates
...
...
include/openssl/pkcs7.h
浏览文件 @
6b2ebe43
...
...
@@ -237,6 +237,7 @@ DEFINE_STACK_OF(PKCS7)
# define PKCS7_NOCRL 0x2000
# define PKCS7_PARTIAL 0x4000
# define PKCS7_REUSE_DIGEST 0x8000
# define PKCS7_NO_DUAL_CONTENT 0x10000
/* Flags: for compatibility with older code */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录