Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
f9082268
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看板
提交
f9082268
编写于
8月 02, 2002
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix the ASN1 sanity check: correct header length
calculation and check overflow against LONG_MAX.
上级
909abce8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
4 deletion
+11
-4
CHANGES
CHANGES
+6
-0
crypto/asn1/asn1_lib.c
crypto/asn1/asn1_lib.c
+5
-4
未找到文件。
CHANGES
浏览文件 @
f9082268
...
@@ -1895,6 +1895,12 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
...
@@ -1895,6 +1895,12 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
Changes between 0.9.6e and 0.9.6f [XX xxx XXXX]
Changes between 0.9.6e and 0.9.6f [XX xxx XXXX]
*) Fix ASN1 checks. Check for overflow by comparing with LONG_MAX
and get fix the header length calculation.
[Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE>,
Alon Kantor <alonk@checkpoint.com> (and others),
Steve Henson]
*) Use proper error handling instead of 'assertions' in buffer
*) Use proper error handling instead of 'assertions' in buffer
overflow checks added in 0.9.6e. This prevents DoS (the
overflow checks added in 0.9.6e. This prevents DoS (the
assertions could call abort()).
assertions could call abort()).
...
...
crypto/asn1/asn1_lib.c
浏览文件 @
f9082268
...
@@ -57,6 +57,7 @@
...
@@ -57,6 +57,7 @@
*/
*/
#include <stdio.h>
#include <stdio.h>
#include <limits.h>
#include "cryptlib.h"
#include "cryptlib.h"
#include <openssl/asn1.h>
#include <openssl/asn1.h>
#include <openssl/asn1_mac.h>
#include <openssl/asn1_mac.h>
...
@@ -124,7 +125,7 @@ int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass,
...
@@ -124,7 +125,7 @@ int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass,
(int)(omax+ *pp));
(int)(omax+ *pp));
#endif
#endif
if
(
*
plength
>
(
omax
-
(
*
p
p
-
p
)))
if
(
*
plength
>
(
omax
-
(
*
p
-
*
p
p
)))
{
{
ASN1err
(
ASN1_F_ASN1_GET_OBJECT
,
ASN1_R_TOO_LONG
);
ASN1err
(
ASN1_F_ASN1_GET_OBJECT
,
ASN1_R_TOO_LONG
);
/* Set this so that even if things are not long enough
/* Set this so that even if things are not long enough
...
@@ -141,7 +142,7 @@ err:
...
@@ -141,7 +142,7 @@ err:
static
int
asn1_get_length
(
unsigned
char
**
pp
,
int
*
inf
,
long
*
rl
,
int
max
)
static
int
asn1_get_length
(
unsigned
char
**
pp
,
int
*
inf
,
long
*
rl
,
int
max
)
{
{
unsigned
char
*
p
=
*
pp
;
unsigned
char
*
p
=
*
pp
;
long
ret
=
0
;
unsigned
long
ret
=
0
;
int
i
;
int
i
;
if
(
max
--
<
1
)
return
(
0
);
if
(
max
--
<
1
)
return
(
0
);
...
@@ -170,10 +171,10 @@ static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
...
@@ -170,10 +171,10 @@ static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
else
else
ret
=
i
;
ret
=
i
;
}
}
if
(
ret
<
0
)
if
(
ret
>
LONG_MAX
)
return
0
;
return
0
;
*
pp
=
p
;
*
pp
=
p
;
*
rl
=
ret
;
*
rl
=
(
long
)
ret
;
return
(
1
);
return
(
1
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录