Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
034292ad
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
8 个月 前同步成功
通知
8
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
034292ad
编写于
6月 24, 1999
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix d2i_ASN1_INTEGER() and i2d_ASN1_INTEGER() so it correctly works out
the length of negative integers.
上级
946cbf67
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
14 deletion
+14
-14
CHANGES
CHANGES
+8
-0
crypto/asn1/a_int.c
crypto/asn1/a_int.c
+6
-14
未找到文件。
CHANGES
浏览文件 @
034292ad
...
...
@@ -4,6 +4,14 @@
Changes between 0.9.3a and 0.9.4
*) Fix a bug in d2i_ASN1_INTEGER() and i2d_ASN1_INTEGER() which can mess
up the length of negative integers. This has now been simplified to just
store the length when it is first determined and use it later, rather
than trying to keep track of where data is copied and updating it to
point to the end.
[Steve Henson, reported by Brien Wheeler
<bwheeler@authentica-security.com>]
*) Add a new function PKCS7_signatureVerify. This allows the verification
of a PKCS#7 signature but with the signing certificate passed to the
function itself. This contrasts with PKCS7_dataVerify which assumes the
...
...
crypto/asn1/a_int.c
浏览文件 @
034292ad
...
...
@@ -125,13 +125,8 @@ int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
ASN1_put_object
(
&
p
,
0
,
ret
,
V_ASN1_INTEGER
,
V_ASN1_UNIVERSAL
);
if
(
pad
)
*
(
p
++
)
=
pb
;
if
(
a
->
length
==
0
)
*
(
p
++
)
=
0
;
else
if
(
t
==
V_ASN1_INTEGER
)
{
memcpy
(
p
,
a
->
data
,(
unsigned
int
)
a
->
length
);
p
+=
a
->
length
;
}
if
(
a
->
length
==
0
)
*
(
p
++
)
=
0
;
else
if
(
t
==
V_ASN1_INTEGER
)
memcpy
(
p
,
a
->
data
,(
unsigned
int
)
a
->
length
);
else
{
/* Begin at the end of the encoding */
n
=
a
->
data
+
a
->
length
-
1
;
...
...
@@ -148,10 +143,9 @@ int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
i
--
;
/* Complement any octets left */
for
(;
i
>
0
;
i
--
)
*
(
p
--
)
=
*
(
n
--
)
^
0xff
;
p
+=
a
->
length
;
}
*
pp
=
p
;
*
pp
+=
r
;
return
(
r
);
}
...
...
@@ -159,7 +153,7 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
long
length
)
{
ASN1_INTEGER
*
ret
=
NULL
;
unsigned
char
*
p
,
*
to
,
*
s
;
unsigned
char
*
p
,
*
to
,
*
s
,
*
pend
;
long
len
;
int
inf
,
tag
,
xclass
;
int
i
;
...
...
@@ -174,6 +168,7 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
p
=
*
pp
;
inf
=
ASN1_get_object
(
&
p
,
&
len
,
&
tag
,
&
xclass
,
length
);
pend
=
p
+
len
;
if
(
inf
&
0x80
)
{
i
=
ASN1_R_BAD_OBJECT_HEADER
;
...
...
@@ -220,13 +215,11 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
if
(
!
i
)
{
*
s
=
1
;
s
[
len
]
=
0
;
p
+=
len
;
len
++
;
}
else
{
*
(
to
--
)
=
(
*
(
p
--
)
^
0xff
)
+
1
;
i
--
;
for
(;
i
>
0
;
i
--
)
*
(
to
--
)
=
*
(
p
--
)
^
0xff
;
p
+=
len
;
}
}
else
{
ret
->
type
=
V_ASN1_INTEGER
;
...
...
@@ -236,14 +229,13 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
len
--
;
}
memcpy
(
s
,
p
,(
int
)
len
);
p
+=
len
;
}
if
(
ret
->
data
!=
NULL
)
Free
((
char
*
)
ret
->
data
);
ret
->
data
=
s
;
ret
->
length
=
(
int
)
len
;
if
(
a
!=
NULL
)
(
*
a
)
=
ret
;
*
pp
=
p
;
*
pp
=
p
end
;
return
(
ret
);
err:
ASN1err
(
ASN1_F_D2I_ASN1_INTEGER
,
i
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录