Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
6cffb201
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看板
提交
6cffb201
编写于
24年前
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix ASN1_TYPE bug.
上级
4b0f00b7
无相关合并请求
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
6 deletion
+21
-6
CHANGES
CHANGES
+12
-0
crypto/asn1/a_type.c
crypto/asn1/a_type.c
+8
-6
crypto/asn1/asn1.h
crypto/asn1/asn1.h
+1
-0
未找到文件。
CHANGES
浏览文件 @
6cffb201
...
...
@@ -4,6 +4,18 @@
Changes between 0.9.5a and 0.9.6 [xx XXX 2000]
*) Fix for a nasty bug in ASN1_TYPE handling. ASN1_TYPE is used for
a general "ANY" type, as such it should be able to decode anything
including tagged types. However it didn't check the class so it would
wrongly interpret tagged types in the same way as their universal
counterpart and unknown types were just rejected. Changed so that the
tagged and unknown types are handled in the same way as a SEQUENCE:
that is the encoding is stored intact. There is also a new type
"V_ASN1_OTHER" which is used when the class is not universal, in this
case we have no idea what the actual type is so we just lump them all
together.
[Steve Henson]
*) On VMS, stdout may very well lead to a file that is written to
in a record-oriented fashion. That means that every write() will
write a separate record, which will be read separately by the
...
...
This diff is collapsed.
Click to expand it.
crypto/asn1/a_type.c
浏览文件 @
6cffb201
...
...
@@ -123,6 +123,8 @@ int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **pp)
break
;
case
V_ASN1_SET
:
case
V_ASN1_SEQUENCE
:
case
V_ASN1_OTHER
:
default:
if
(
a
->
value
.
set
==
NULL
)
r
=
0
;
else
...
...
@@ -159,6 +161,8 @@ ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, unsigned char **pp, long length)
inf
=
ASN1_get_object
(
&
q
,
&
len
,
&
tag
,
&
xclass
,
length
);
if
(
inf
&
0x80
)
goto
err
;
/* If not universal tag we've no idea what it is */
if
(
xclass
!=
V_ASN1_UNIVERSAL
)
tag
=
V_ASN1_OTHER
;
ASN1_TYPE_component_free
(
ret
);
...
...
@@ -245,6 +249,8 @@ ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, unsigned char **pp, long length)
break
;
case
V_ASN1_SET
:
case
V_ASN1_SEQUENCE
:
case
V_ASN1_OTHER
:
default:
/* Sets and sequences are left complete */
if
((
ret
->
value
.
set
=
ASN1_STRING_new
())
==
NULL
)
goto
err
;
ret
->
value
.
set
->
type
=
tag
;
...
...
@@ -252,9 +258,6 @@ ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, unsigned char **pp, long length)
if
(
!
ASN1_STRING_set
(
ret
->
value
.
set
,
p
,(
int
)
len
))
goto
err
;
p
+=
len
;
break
;
default:
ASN1err
(
ASN1_F_D2I_ASN1_TYPE
,
ASN1_R_BAD_TYPE
);
goto
err
;
}
ret
->
type
=
tag
;
...
...
@@ -333,10 +336,9 @@ static void ASN1_TYPE_component_free(ASN1_TYPE *a)
case
V_ASN1_UNIVERSALSTRING
:
case
V_ASN1_BMPSTRING
:
case
V_ASN1_UTF8STRING
:
ASN1_STRING_free
((
ASN1_STRING
*
)
a
->
value
.
ptr
);
break
;
case
V_ASN1_OTHER
:
default:
/* MEMORY LEAK */
ASN1_STRING_free
((
ASN1_STRING
*
)
a
->
value
.
ptr
);
break
;
}
a
->
type
=
0
;
...
...
This diff is collapsed.
Click to expand it.
crypto/asn1/asn1.h
浏览文件 @
6cffb201
...
...
@@ -83,6 +83,7 @@ extern "C" {
#define V_ASN1_PRIMATIVE_TAG 0x1f
#define V_ASN1_APP_CHOOSE -2
/* let the recipient choose */
#define V_ASN1_OTHER -3
/* used in ASN1_TYPE */
#define V_ASN1_NEG 0x100
/* negative flag */
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部