Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
722ca278
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看板
提交
722ca278
编写于
4月 02, 2001
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rewrite CHOICE field setting code to properly handle
combine in CHOICE options. This was causing d2i_DSAPublicKey() to misbehave.
上级
1c72eebf
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
13 deletion
+26
-13
CHANGES
CHANGES
+4
-0
crypto/asn1/tasn_dec.c
crypto/asn1/tasn_dec.c
+16
-12
crypto/asn1/tasn_new.c
crypto/asn1/tasn_new.c
+6
-1
未找到文件。
CHANGES
浏览文件 @
722ca278
...
...
@@ -4,6 +4,10 @@
Changes between 0.9.6 and 0.9.7 [xx XXX 2000]
*) Rewrite CHOICE field setting in ASN1_item_ex_d2i(). The old code
could not support the combine flag in choice fields.
[Steve Henson]
*) Change bctest to avoid here-documents inside command substitution
(workaround for FreeBSD /bin/sh bug).
[Bodo Moeller]
...
...
crypto/asn1/tasn_dec.c
浏览文件 @
722ca278
...
...
@@ -227,14 +227,24 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1
case
ASN1_ITYPE_CHOICE
:
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_D2I_PRE
,
pval
,
it
))
goto
auxerr
;
/* Allocate structure */
if
(
!*
pval
)
{
if
(
!
ASN1_item_ex_new
(
pval
,
it
))
{
errtt
=
tt
;
ASN1err
(
ASN1_F_ASN1_ITEM_EX_D2I
,
ERR_R_NESTED_ASN1_ERROR
);
goto
err
;
}
}
/* CHOICE type, try each possibility in turn */
pchval
=
NULL
;
p
=
*
in
;
for
(
i
=
0
,
tt
=
it
->
templates
;
i
<
it
->
tcount
;
i
++
,
tt
++
)
{
pchptr
=
asn1_get_field_ptr
(
pval
,
tt
);
/* We mark field as OPTIONAL so its absence
* can be recognised.
*/
ret
=
asn1_template_ex_d2i
(
&
pchval
,
&
p
,
len
,
tt
,
1
,
ctx
);
ret
=
asn1_template_ex_d2i
(
pchptr
,
&
p
,
len
,
tt
,
1
,
ctx
);
/* If field not present, try the next one */
if
(
ret
==
-
1
)
continue
;
/* If positive return, read OK, break loop */
...
...
@@ -247,20 +257,14 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1
/* Did we fall off the end without reading anything? */
if
(
i
==
it
->
tcount
)
{
/* If OPTIONAL, this is OK */
if
(
opt
)
return
-
1
;
if
(
opt
)
{
/* Free and zero it */
ASN1_item_ex_free
(
pval
,
it
);
return
-
1
;
}
ASN1err
(
ASN1_F_ASN1_ITEM_EX_D2I
,
ASN1_R_NO_MATCHING_CHOICE_TYPE
);
goto
err
;
}
/* Otherwise we got a match, allocate structure and populate it */
if
(
!*
pval
)
{
if
(
!
ASN1_item_ex_new
(
pval
,
it
))
{
errtt
=
tt
;
ASN1err
(
ASN1_F_ASN1_ITEM_EX_D2I
,
ERR_R_NESTED_ASN1_ERROR
);
goto
err
;
}
}
pchptr
=
asn1_get_field_ptr
(
pval
,
tt
);
*
pchptr
=
pchval
;
asn1_set_choice_selector
(
pval
,
i
,
it
);
*
in
=
p
;
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_D2I_POST
,
pval
,
it
))
...
...
crypto/asn1/tasn_new.c
浏览文件 @
722ca278
...
...
@@ -138,7 +138,12 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int
if
(
asn1_cb
)
{
i
=
asn1_cb
(
ASN1_OP_NEW_PRE
,
pval
,
it
);
if
(
!
i
)
goto
auxerr
;
if
(
i
==
2
)
return
1
;
if
(
i
==
2
)
{
#ifdef CRYPTO_MDEBUG
if
(
it
->
sname
)
CRYPTO_pop_info
();
#endif
return
1
;
}
}
if
(
!
combine
)
{
*
pval
=
OPENSSL_malloc
(
it
->
size
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录