Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
8fa397a6
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看板
提交
8fa397a6
编写于
1月 10, 2012
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix warning (revert original patch)
上级
03cf7e78
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
8 deletion
+8
-8
crypto/ecdsa/ecdsatest.c
crypto/ecdsa/ecdsatest.c
+8
-8
未找到文件。
crypto/ecdsa/ecdsatest.c
浏览文件 @
8fa397a6
...
@@ -298,8 +298,8 @@ int test_builtin(BIO *out)
...
@@ -298,8 +298,8 @@ int test_builtin(BIO *out)
ECDSA_SIG
*
ecdsa_sig
=
NULL
;
ECDSA_SIG
*
ecdsa_sig
=
NULL
;
unsigned
char
digest
[
20
],
wrong_digest
[
20
];
unsigned
char
digest
[
20
],
wrong_digest
[
20
];
unsigned
char
*
signature
=
NULL
;
unsigned
char
*
signature
=
NULL
;
unsigned
char
*
sig_ptr
;
const
unsigned
char
*
sig_ptr
;
const
unsigned
char
*
csig_ptr
;
unsigned
char
*
sig_ptr2
;
unsigned
char
*
raw_buf
=
NULL
;
unsigned
char
*
raw_buf
=
NULL
;
unsigned
int
sig_len
,
degree
,
r_len
,
s_len
,
bn_len
,
buf_len
;
unsigned
int
sig_len
,
degree
,
r_len
,
s_len
,
bn_len
,
buf_len
;
int
nid
,
ret
=
0
;
int
nid
,
ret
=
0
;
...
@@ -441,8 +441,8 @@ int test_builtin(BIO *out)
...
@@ -441,8 +441,8 @@ int test_builtin(BIO *out)
/* Modify a single byte of the signature: to ensure we don't
/* Modify a single byte of the signature: to ensure we don't
* garble the ASN1 structure, we read the raw signature and
* garble the ASN1 structure, we read the raw signature and
* modify a byte in one of the bignums directly. */
* modify a byte in one of the bignums directly. */
c
sig_ptr
=
signature
;
sig_ptr
=
signature
;
if
((
ecdsa_sig
=
d2i_ECDSA_SIG
(
NULL
,
&
c
sig_ptr
,
sig_len
))
==
NULL
)
if
((
ecdsa_sig
=
d2i_ECDSA_SIG
(
NULL
,
&
sig_ptr
,
sig_len
))
==
NULL
)
{
{
BIO_printf
(
out
,
" failed
\n
"
);
BIO_printf
(
out
,
" failed
\n
"
);
goto
builtin_err
;
goto
builtin_err
;
...
@@ -474,8 +474,8 @@ int test_builtin(BIO *out)
...
@@ -474,8 +474,8 @@ int test_builtin(BIO *out)
(
BN_bin2bn
(
raw_buf
+
bn_len
,
bn_len
,
ecdsa_sig
->
s
)
==
NULL
))
(
BN_bin2bn
(
raw_buf
+
bn_len
,
bn_len
,
ecdsa_sig
->
s
)
==
NULL
))
goto
builtin_err
;
goto
builtin_err
;
sig_ptr
=
signature
;
sig_ptr
2
=
signature
;
sig_len
=
i2d_ECDSA_SIG
(
ecdsa_sig
,
&
sig_ptr
);
sig_len
=
i2d_ECDSA_SIG
(
ecdsa_sig
,
&
sig_ptr
2
);
if
(
ECDSA_verify
(
0
,
digest
,
20
,
signature
,
sig_len
,
eckey
)
==
1
)
if
(
ECDSA_verify
(
0
,
digest
,
20
,
signature
,
sig_len
,
eckey
)
==
1
)
{
{
BIO_printf
(
out
,
" failed
\n
"
);
BIO_printf
(
out
,
" failed
\n
"
);
...
@@ -487,8 +487,8 @@ int test_builtin(BIO *out)
...
@@ -487,8 +487,8 @@ int test_builtin(BIO *out)
(
BN_bin2bn
(
raw_buf
+
bn_len
,
bn_len
,
ecdsa_sig
->
s
)
==
NULL
))
(
BN_bin2bn
(
raw_buf
+
bn_len
,
bn_len
,
ecdsa_sig
->
s
)
==
NULL
))
goto
builtin_err
;
goto
builtin_err
;
sig_ptr
=
signature
;
sig_ptr
2
=
signature
;
sig_len
=
i2d_ECDSA_SIG
(
ecdsa_sig
,
&
sig_ptr
);
sig_len
=
i2d_ECDSA_SIG
(
ecdsa_sig
,
&
sig_ptr
2
);
if
(
ECDSA_verify
(
0
,
digest
,
20
,
signature
,
sig_len
,
eckey
)
!=
1
)
if
(
ECDSA_verify
(
0
,
digest
,
20
,
signature
,
sig_len
,
eckey
)
!=
1
)
{
{
BIO_printf
(
out
,
" failed
\n
"
);
BIO_printf
(
out
,
" failed
\n
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录