Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
caf044cb
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
caf044cb
编写于
10月 10, 2003
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Retrieve correct content to sign when the
type is "other".
上级
a08ced78
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
26 deletion
+25
-26
CHANGES
CHANGES
+4
-0
crypto/pkcs7/pk7_doit.c
crypto/pkcs7/pk7_doit.c
+21
-26
未找到文件。
CHANGES
浏览文件 @
caf044cb
...
...
@@ -555,6 +555,10 @@
differing sizes.
[Richard Levitte]
Changes between 0.9.7c and 0.9.7d [xx XXX XXXX]
*) Use the correct content when signing type "other".
[Steve Henson]
Changes between 0.9.7b and 0.9.7c [30 Sep 2003]
*) Fix various bugs revealed by running the NISCC test suite:
...
...
crypto/pkcs7/pk7_doit.c
浏览文件 @
caf044cb
...
...
@@ -91,12 +91,14 @@ static int PKCS7_type_is_other(PKCS7* p7)
}
static
int
PKCS7_type_is_octet_string
(
PKCS7
*
p7
)
static
ASN1_OCTET_STRING
*
PKCS7_get_octet_string
(
PKCS7
*
p7
)
{
if
(
0
==
PKCS7_type_is_other
(
p7
)
)
return
0
;
return
(
V_ASN1_OCTET_STRING
==
p7
->
d
.
other
->
type
)
?
1
:
0
;
if
(
PKCS7_type_is_data
(
p7
))
return
p7
->
d
.
data
;
if
(
PKCS7_type_is_other
(
p7
)
&&
p7
->
d
.
other
&&
(
p7
->
d
.
other
->
type
==
V_ASN1_OCTET_STRING
))
return
p7
->
d
.
other
->
value
.
octet_string
;
return
NULL
;
}
BIO
*
PKCS7_dataInit
(
PKCS7
*
p7
,
BIO
*
bio
)
...
...
@@ -250,29 +252,22 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
btmp
=
NULL
;
}
if
(
bio
==
NULL
)
{
if
(
bio
==
NULL
)
{
if
(
PKCS7_is_detached
(
p7
))
bio
=
BIO_new
(
BIO_s_null
());
else
{
if
(
PKCS7_type_is_signed
(
p7
)
)
{
if
(
PKCS7_type_is_data
(
p7
->
d
.
sign
->
contents
))
{
ASN1_OCTET_STRING
*
os
;
os
=
p7
->
d
.
sign
->
contents
->
d
.
data
;
if
(
os
->
length
>
0
)
bio
=
BIO_new_mem_buf
(
os
->
data
,
os
->
length
);
}
else
if
(
PKCS7_type_is_octet_string
(
p7
->
d
.
sign
->
contents
)
)
{
ASN1_OCTET_STRING
*
os
;
os
=
p7
->
d
.
sign
->
contents
->
d
.
other
->
value
.
octet_string
;
if
(
os
->
length
>
0
)
bio
=
BIO_new_mem_buf
(
os
->
data
,
os
->
length
);
}
}
if
(
bio
==
NULL
)
{
else
{
ASN1_OCTET_STRING
*
os
;
os
=
PKCS7_get_octet_string
(
p7
->
d
.
sign
->
contents
);
if
(
os
&&
os
->
length
>
0
)
bio
=
BIO_new_mem_buf
(
os
->
data
,
os
->
length
);
if
(
bio
==
NULL
)
{
bio
=
BIO_new
(
BIO_s_mem
());
BIO_set_mem_eof_return
(
bio
,
0
);
}
}
}
}
BIO_push
(
out
,
bio
);
bio
=
NULL
;
...
...
@@ -311,7 +306,7 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
switch
(
i
)
{
case
NID_pkcs7_signed
:
data_body
=
p7
->
d
.
sign
->
contents
->
d
.
data
;
data_body
=
PKCS7_get_octet_string
(
p7
->
d
.
sign
->
contents
)
;
md_sk
=
p7
->
d
.
sign
->
md_algs
;
break
;
case
NID_pkcs7_signedAndEnveloped
:
...
...
@@ -531,9 +526,9 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
break
;
case
NID_pkcs7_signed
:
si_sk
=
p7
->
d
.
sign
->
signer_info
;
os
=
p7
->
d
.
sign
->
contents
->
d
.
data
;
os
=
PKCS7_get_octet_string
(
p7
->
d
.
sign
->
contents
)
;
/* If detached data then the content is excluded */
if
(
p7
->
detached
)
{
if
(
PKCS7_type_is_data
(
p7
->
d
.
sign
->
contents
)
&&
p7
->
detached
)
{
M_ASN1_OCTET_STRING_free
(
os
);
p7
->
d
.
sign
->
contents
->
d
.
data
=
NULL
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录