Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
854a225a
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看板
提交
854a225a
编写于
3月 14, 2009
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update from stable branch.
上级
e39acc1c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
9 deletion
+25
-9
CHANGES
CHANGES
+4
-0
crypto/asn1/tasn_dec.c
crypto/asn1/tasn_dec.c
+21
-9
未找到文件。
CHANGES
浏览文件 @
854a225a
...
@@ -748,6 +748,10 @@
...
@@ -748,6 +748,10 @@
Changes between 0.9.8j and 0.9.8k [xx XXX xxxx]
Changes between 0.9.8j and 0.9.8k [xx XXX xxxx]
*) Permit restricted recursion of ASN1 strings. This is needed in practice
to handle some structures.
[Steve Henson]
*) Improve efficiency of mem_gets: don't search whole buffer each time
*) Improve efficiency of mem_gets: don't search whole buffer each time
for a '\n'
for a '\n'
[Jeremy Shapiro <jnshapir@us.ibm.com>]
[Jeremy Shapiro <jnshapir@us.ibm.com>]
...
...
crypto/asn1/tasn_dec.c
浏览文件 @
854a225a
...
@@ -69,7 +69,7 @@ static int asn1_check_eoc(const unsigned char **in, long len);
...
@@ -69,7 +69,7 @@ static int asn1_check_eoc(const unsigned char **in, long len);
static
int
asn1_find_end
(
const
unsigned
char
**
in
,
long
len
,
char
inf
);
static
int
asn1_find_end
(
const
unsigned
char
**
in
,
long
len
,
char
inf
);
static
int
asn1_collect
(
BUF_MEM
*
buf
,
const
unsigned
char
**
in
,
long
len
,
static
int
asn1_collect
(
BUF_MEM
*
buf
,
const
unsigned
char
**
in
,
long
len
,
char
inf
,
int
tag
,
int
aclass
);
char
inf
,
int
tag
,
int
aclass
,
int
depth
);
static
int
collect_data
(
BUF_MEM
*
buf
,
const
unsigned
char
**
p
,
long
plen
);
static
int
collect_data
(
BUF_MEM
*
buf
,
const
unsigned
char
**
p
,
long
plen
);
...
@@ -882,7 +882,7 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,
...
@@ -882,7 +882,7 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,
* internally irrespective of the type. So instead just check
* internally irrespective of the type. So instead just check
* for UNIVERSAL class and ignore the tag.
* for UNIVERSAL class and ignore the tag.
*/
*/
if
(
!
asn1_collect
(
&
buf
,
&
p
,
plen
,
inf
,
-
1
,
V_ASN1_UNIVERSAL
))
if
(
!
asn1_collect
(
&
buf
,
&
p
,
plen
,
inf
,
-
1
,
V_ASN1_UNIVERSAL
,
0
))
{
{
free_cont
=
1
;
free_cont
=
1
;
goto
err
;
goto
err
;
...
@@ -1132,8 +1132,18 @@ static int asn1_find_end(const unsigned char **in, long len, char inf)
...
@@ -1132,8 +1132,18 @@ static int asn1_find_end(const unsigned char **in, long len, char inf)
* if it is indefinite length.
* if it is indefinite length.
*/
*/
#ifndef ASN1_MAX_STRING_NEST
/* This determines how many levels of recursion are permitted in ASN1
* string types. If it is not limited stack overflows can occur. If set
* to zero no recursion is allowed at all. Although zero should be adequate
* examples exist that require a value of 1. So 5 should be more than enough.
*/
#define ASN1_MAX_STRING_NEST 5
#endif
static
int
asn1_collect
(
BUF_MEM
*
buf
,
const
unsigned
char
**
in
,
long
len
,
static
int
asn1_collect
(
BUF_MEM
*
buf
,
const
unsigned
char
**
in
,
long
len
,
char
inf
,
int
tag
,
int
aclass
)
char
inf
,
int
tag
,
int
aclass
,
int
depth
)
{
{
const
unsigned
char
*
p
,
*
q
;
const
unsigned
char
*
p
,
*
q
;
long
plen
;
long
plen
;
...
@@ -1175,13 +1185,15 @@ static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len,
...
@@ -1175,13 +1185,15 @@ static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len,
/* If indefinite length constructed update max length */
/* If indefinite length constructed update max length */
if
(
cst
)
if
(
cst
)
{
{
#ifdef OPENSSL_ALLOW_NESTED_ASN1_STRINGS
if
(
depth
>=
ASN1_MAX_STRING_NEST
)
if
(
!
asn1_collect
(
buf
,
&
p
,
plen
,
ininf
,
tag
,
aclass
))
{
ASN1err
(
ASN1_F_ASN1_COLLECT
,
ASN1_R_NESTED_ASN1_STRING
);
return
0
;
}
if
(
!
asn1_collect
(
buf
,
&
p
,
plen
,
ininf
,
tag
,
aclass
,
depth
+
1
))
return
0
;
return
0
;
#else
ASN1err
(
ASN1_F_ASN1_COLLECT
,
ASN1_R_NESTED_ASN1_STRING
);
return
0
;
#endif
}
}
else
if
(
plen
&&
!
collect_data
(
buf
,
&
p
,
plen
))
else
if
(
plen
&&
!
collect_data
(
buf
,
&
p
,
plen
))
return
0
;
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录