Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
288fe07a
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
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,发现更多精彩内容 >>
提交
288fe07a
编写于
9月 11, 2011
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix 3DES Monte Carlo test file output which previously outputted
extra bogus lines. Update fipsalgtest.pl to tolerate the old format.
上级
7fdcb457
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
28 addition
and
7 deletion
+28
-7
fips/des/fips_desmovs.c
fips/des/fips_desmovs.c
+11
-7
fips/fipsalgtest.pl
fips/fipsalgtest.pl
+17
-0
未找到文件。
fips/des/fips_desmovs.c
浏览文件 @
288fe07a
...
...
@@ -177,7 +177,6 @@ static void do_mct(char *amode,
printf
(
"Unrecognized mode: %s
\n
"
,
amode
);
EXIT
(
1
);
}
for
(
i
=
0
;
i
<
400
;
++
i
)
{
int
j
;
...
...
@@ -277,7 +276,7 @@ static int proc_file(char *rqfile, char *rspfile)
char
atest
[
100
]
=
""
;
int
akeysz
=
0
;
unsigned
char
iVec
[
20
],
aKey
[
40
];
int
dir
=
-
1
,
err
=
0
,
step
=
0
;
int
dir
=
-
1
,
err
=
0
,
step
=
0
,
echo
=
1
;
unsigned
char
plaintext
[
2048
];
unsigned
char
ciphertext
[
2048
];
char
*
rp
;
...
...
@@ -383,6 +382,8 @@ static int proc_file(char *rqfile, char *rspfile)
n
=
strlen
(
xp
+
1
)
-
1
;
strncpy
(
amode
,
xp
+
1
,
n
);
amode
[
n
]
=
'\0'
;
if
(
!
strcmp
(
atest
,
"Monte"
))
echo
=
0
;
/* amode[3] = '\0'; */
if
(
VERBOSE
)
printf
(
"Test=%s, Mode=%s
\n
"
,
atest
,
amode
);
...
...
@@ -439,7 +440,7 @@ static int proc_file(char *rqfile, char *rspfile)
numkeys
=
atoi
(
ibuf
+
10
);
break
;
}
if
(
echo
)
fputs
(
ibuf
,
rfp
);
if
(
!
fips_strncasecmp
(
ibuf
,
"KEY = "
,
6
))
{
...
...
@@ -495,6 +496,7 @@ static int proc_file(char *rqfile, char *rspfile)
break
;
case
3
:
/* IV = xxxx */
if
(
echo
)
fputs
(
ibuf
,
rfp
);
if
(
fips_strncasecmp
(
ibuf
,
"IV = "
,
5
)
!=
0
)
{
...
...
@@ -516,6 +518,7 @@ static int proc_file(char *rqfile, char *rspfile)
break
;
case
4
:
/* PLAINTEXT = xxxx */
if
(
echo
)
fputs
(
ibuf
,
rfp
);
if
(
fips_strncasecmp
(
ibuf
,
"PLAINTEXT = "
,
12
)
!=
0
)
{
...
...
@@ -558,6 +561,7 @@ static int proc_file(char *rqfile, char *rspfile)
break
;
case
5
:
/* CIPHERTEXT = xxxx */
if
(
echo
)
fputs
(
ibuf
,
rfp
);
if
(
fips_strncasecmp
(
ibuf
,
"CIPHERTEXT = "
,
13
)
!=
0
)
{
...
...
fips/fipsalgtest.pl
浏览文件 @
288fe07a
...
...
@@ -1090,6 +1090,7 @@ sub cmp_file {
my
(
$tname
,
$rsp
,
$tst
)
=
@_
;
my
(
$rspf
,
$tstf
);
my
(
$rspline
,
$tstline
);
my
$monte
=
0
;
if
(
!
open
(
$rspf
,
$rsp
)
)
{
print
STDERR
"
ERROR: can't open request file
$rsp
\n
";
return
0
;
...
...
@@ -1098,6 +1099,7 @@ sub cmp_file {
print
STDERR
"
ERROR: can't open output file
$tst
\n
";
return
0
;
}
$monte
=
1
if
(
$rsp
=~
/Monte[123]/
);
for
(
;
;
)
{
$rspline
=
next_line
(
$rspf
);
$tstline
=
next_line
(
$tstf
);
...
...
@@ -1105,6 +1107,21 @@ sub cmp_file {
print
STDERR
"
DEBUG:
$tname
file comparison OK
\n
"
if
$debug
;
return
1
;
}
# Workaround for old broken DES3 MCT format which added bogus
# extra lines: after [ENCRYPT] or [DECRYPT] skip until first
# COUNT line.
if
(
$monte
)
{
if
(
$rspline
=~
/CRYPT/
)
{
do
{
$rspline
=
next_line
(
$rspf
);
}
while
(
defined
(
$rspline
)
&&
$rspline
!~
/COUNT/
);
}
if
(
$tstline
=~
/CRYPT/
)
{
do
{
$tstline
=
next_line
(
$tstf
);
}
while
(
defined
(
$tstline
)
&&
$tstline
!~
/COUNT/
);
}
}
if
(
!
defined
(
$rspline
)
)
{
print
STDERR
"
ERROR:
$tname
EOF on
$rsp
\n
";
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录