Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
4cc2bbab
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4cc2bbab
编写于
10月 01, 2011
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make fips algorithm test utilities use RESP_EOL for end of line character(s).
This should be CRLF even under *nix.
上级
04c3aa5c
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
88 addition
and
66 deletion
+88
-66
fips/aes/fips_aesavs.c
fips/aes/fips_aesavs.c
+12
-11
fips/aes/fips_gcmtest.c
fips/aes/fips_gcmtest.c
+3
-3
fips/cmac/fips_cmactest.c
fips/cmac/fips_cmactest.c
+3
-3
fips/des/fips_desmovs.c
fips/des/fips_desmovs.c
+14
-13
fips/dsa/fips_dssvs.c
fips/dsa/fips_dssvs.c
+16
-17
fips/ecdsa/fips_ecdsavs.c
fips/ecdsa/fips_ecdsavs.c
+3
-3
fips/fips_utl.h
fips/fips_utl.h
+27
-6
fips/hmac/fips_hmactest.c
fips/hmac/fips_hmactest.c
+1
-1
fips/rsa/fips_rsastest.c
fips/rsa/fips_rsastest.c
+3
-3
fips/rsa/fips_rsavtest.c
fips/rsa/fips_rsavtest.c
+2
-2
fips/sha/fips_shatest.c
fips/sha/fips_shatest.c
+4
-4
未找到文件。
fips/aes/fips_aesavs.c
浏览文件 @
4cc2bbab
...
...
@@ -283,7 +283,7 @@ static int do_mct(char *amode,
/* printf("Iteration %d\n", i); */
if
(
i
>
0
)
{
fprintf
(
rfp
,
"COUNT = %d
\n
"
,
i
);
fprintf
(
rfp
,
"COUNT = %d
"
RESP_EOL
,
i
);
OutputValue
(
"KEY"
,
key
[
i
],
nkeysz
,
rfp
,
0
);
if
(
imode
!=
ECB
)
/* ECB */
OutputValue
(
"IV"
,
iv
[
i
],
AES_BLOCK_SIZE
,
rfp
,
0
);
...
...
@@ -419,7 +419,7 @@ static int do_mct(char *amode,
/* Output Ciphertext | Plaintext */
OutputValue
(
t_tag
[
dir
],
dir
?
ctext
[
j
]
:
ptext
[
j
],
len
,
rfp
,
imode
==
CFB1
);
fprintf
(
rfp
,
"
\n
"
);
/* add separator */
fprintf
(
rfp
,
RESP_EOL
);
/* add separator */
/* Compute next KEY */
if
(
dir
==
XENCRYPT
)
...
...
@@ -622,7 +622,7 @@ static int proc_file(char *rqfile, char *rspfile)
}
else
{
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
++
step
;
}
}
...
...
@@ -638,11 +638,12 @@ static int proc_file(char *rqfile, char *rspfile)
if
(
akeysz
)
{
/* insert current time & date */
time_t
rtim
=
time
(
0
);
fprintf
(
rfp
,
"# %s"
,
ctime
(
&
rtim
));
fputs
(
"# "
,
rfp
);
copy_line
(
ctime
(
&
rtim
),
rfp
);
}
else
{
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
if
(
strncmp
(
pp
,
"AESVS "
,
6
)
==
0
)
{
strcpy
(
algo
,
"AES"
);
...
...
@@ -674,7 +675,7 @@ static int proc_file(char *rqfile, char *rspfile)
case
1
:
/* [ENCRYPT] | [DECRYPT] */
if
(
ibuf
[
0
]
==
'['
)
{
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
++
step
;
if
(
fips_strncasecmp
(
ibuf
,
"[ENCRYPT]"
,
9
)
==
0
)
dir
=
1
;
...
...
@@ -697,7 +698,7 @@ static int proc_file(char *rqfile, char *rspfile)
step
=
2
;
case
2
:
/* KEY = xxxx */
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
if
(
*
ibuf
==
'\n'
)
break
;
if
(
!
fips_strncasecmp
(
ibuf
,
"COUNT = "
,
8
))
...
...
@@ -729,7 +730,7 @@ static int proc_file(char *rqfile, char *rspfile)
break
;
case
3
:
/* IV = xxxx */
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
if
(
fips_strncasecmp
(
ibuf
,
"IV = "
,
5
)
!=
0
)
{
printf
(
"Missing IV
\n
"
);
...
...
@@ -750,7 +751,7 @@ static int proc_file(char *rqfile, char *rspfile)
break
;
case
4
:
/* PLAINTEXT = xxxx */
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
if
(
fips_strncasecmp
(
ibuf
,
"PLAINTEXT = "
,
12
)
!=
0
)
{
printf
(
"Missing PLAINTEXT
\n
"
);
...
...
@@ -794,7 +795,7 @@ static int proc_file(char *rqfile, char *rspfile)
break
;
case
5
:
/* CIPHERTEXT = xxxx */
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
if
(
fips_strncasecmp
(
ibuf
,
"CIPHERTEXT = "
,
13
)
!=
0
)
{
printf
(
"Missing KEY
\n
"
);
...
...
@@ -839,7 +840,7 @@ static int proc_file(char *rqfile, char *rspfile)
}
else
if
(
strcmp
(
atest
,
"MCT"
)
!=
0
)
{
/* MCT already added terminating nl */
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
}
step
=
1
;
break
;
...
...
fips/aes/fips_gcmtest.c
浏览文件 @
4cc2bbab
...
...
@@ -243,7 +243,7 @@ static void gcmtest(FILE *in, FILE *out, int encrypt)
}
rv
=
FIPS_cipher
(
&
ctx
,
NULL
,
NULL
,
0
);
if
(
rv
<
0
)
fprintf
(
out
,
"FAIL
\n
"
);
fprintf
(
out
,
"FAIL
"
RESP_EOL
);
else
OutputValue
(
"PT"
,
pt
,
ptlen
,
out
,
0
);
if
(
iv
)
...
...
@@ -479,11 +479,11 @@ static void ccmtest(FILE *in, FILE *out)
{
if
(
rv
==
0
)
Payload
[
0
]
=
0
;
fputs
(
"Result = Pass
\n
"
,
out
);
fputs
(
"Result = Pass
"
RESP_EOL
,
out
);
OutputValue
(
"Payload"
,
Payload
,
len
,
out
,
0
);
}
else
fputs
(
"Result = Fail
\n
"
,
out
);
fputs
(
"Result = Fail
"
RESP_EOL
,
out
);
OPENSSL_free
(
CT
);
OPENSSL_free
(
Payload
);
CT
=
Payload
=
NULL
;
...
...
fips/cmac/fips_cmactest.c
浏览文件 @
4cc2bbab
...
...
@@ -464,7 +464,7 @@ static int print_cmac_gen(const EVP_CIPHER *cipher, FILE *out,
fputs
(
"Mac = "
,
out
);
for
(
i
=
0
;
i
<
Tlen
;
i
++
)
fprintf
(
out
,
"%02x"
,
res
[
i
]);
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
rc
=
1
;
}
CMAC_CTX_free
(
cmac_ctx
);
...
...
@@ -502,9 +502,9 @@ static int print_cmac_ver(const EVP_CIPHER *cipher, FILE *out,
else
{
if
(
!
memcmp
(
Mac
,
res
,
Maclen
))
fputs
(
"Result = P
\n
"
,
out
);
fputs
(
"Result = P
"
RESP_EOL
,
out
);
else
fputs
(
"Result = F
\n
"
,
out
);
fputs
(
"Result = F
"
RESP_EOL
,
out
);
}
CMAC_CTX_free
(
cmac_ctx
);
return
rc
;
...
...
fips/des/fips_desmovs.c
浏览文件 @
4cc2bbab
...
...
@@ -186,7 +186,7 @@ static void do_mct(char *amode,
EVP_CIPHER_CTX
ctx
;
FIPS_cipher_ctx_init
(
&
ctx
);
fprintf
(
rfp
,
"
\n
COUNT = %d
\n
"
,
i
);
fprintf
(
rfp
,
RESP_EOL
"COUNT = %d"
RESP_EOL
,
i
);
if
(
kp
==
1
)
OutputValue
(
"KEY"
,
akey
,
8
,
rfp
,
0
);
else
...
...
@@ -341,7 +341,7 @@ static int proc_file(char *rqfile, char *rspfile)
}
else
{
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
++
step
;
}
}
...
...
@@ -357,11 +357,12 @@ static int proc_file(char *rqfile, char *rspfile)
if
(
*
amode
)
{
/* insert current time & date */
time_t
rtim
=
time
(
0
);
fprintf
(
rfp
,
"# %s"
,
ctime
(
&
rtim
));
fputs
(
"# "
,
rfp
);
copy_line
(
ctime
(
&
rtim
),
rfp
);
}
else
{
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
if
(
!
strncmp
(
pp
,
"INVERSE "
,
8
)
||
!
strncmp
(
pp
,
"DES "
,
4
)
||
!
strncmp
(
pp
,
"TDES "
,
5
)
||
!
strncmp
(
pp
,
"PERMUTATION "
,
12
)
...
...
@@ -397,7 +398,7 @@ static int proc_file(char *rqfile, char *rspfile)
break
;
if
(
ibuf
[
0
]
==
'['
)
{
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
++
step
;
if
(
fips_strncasecmp
(
ibuf
,
"[ENCRYPT]"
,
9
)
==
0
)
dir
=
1
;
...
...
@@ -422,17 +423,17 @@ static int proc_file(char *rqfile, char *rspfile)
case
2
:
/* KEY = xxxx */
if
(
*
ibuf
==
'\n'
)
{
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
break
;
}
if
(
!
fips_strncasecmp
(
ibuf
,
"COUNT = "
,
8
))
{
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
break
;
}
if
(
!
fips_strncasecmp
(
ibuf
,
"COUNT="
,
6
))
{
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
break
;
}
if
(
!
fips_strncasecmp
(
ibuf
,
"NumKeys = "
,
10
))
...
...
@@ -441,7 +442,7 @@ static int proc_file(char *rqfile, char *rspfile)
break
;
}
if
(
echo
)
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
if
(
!
fips_strncasecmp
(
ibuf
,
"KEY = "
,
6
))
{
akeysz
=
64
;
...
...
@@ -497,7 +498,7 @@ static int proc_file(char *rqfile, char *rspfile)
case
3
:
/* IV = xxxx */
if
(
echo
)
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
if
(
fips_strncasecmp
(
ibuf
,
"IV = "
,
5
)
!=
0
)
{
printf
(
"Missing IV
\n
"
);
...
...
@@ -519,7 +520,7 @@ static int proc_file(char *rqfile, char *rspfile)
case
4
:
/* PLAINTEXT = xxxx */
if
(
echo
)
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
if
(
fips_strncasecmp
(
ibuf
,
"PLAINTEXT = "
,
12
)
!=
0
)
{
printf
(
"Missing PLAINTEXT
\n
"
);
...
...
@@ -562,7 +563,7 @@ static int proc_file(char *rqfile, char *rspfile)
case
5
:
/* CIPHERTEXT = xxxx */
if
(
echo
)
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
if
(
fips_strncasecmp
(
ibuf
,
"CIPHERTEXT = "
,
13
)
!=
0
)
{
printf
(
"Missing KEY
\n
"
);
...
...
@@ -608,7 +609,7 @@ static int proc_file(char *rqfile, char *rspfile)
}
else
if
(
strcmp
(
atest
,
"MCT"
)
!=
0
)
{
/* MCT already added terminating nl */
fputs
(
ibuf
,
rfp
);
copy_line
(
ibuf
,
rfp
);
}
step
=
1
;
break
;
...
...
fips/dsa/fips_dssvs.c
浏览文件 @
4cc2bbab
...
...
@@ -101,7 +101,7 @@ static void primes(FILE *in, FILE *out)
pp
=
BN_new
();
do_hex2bn
(
&
pp
,
value
);
fprintf
(
out
,
"result= %c
\n
"
,
fprintf
(
out
,
"result= %c
"
RESP_EOL
,
BN_is_prime_ex
(
pp
,
20
,
NULL
,
NULL
)
?
'P'
:
'F'
);
}
}
...
...
@@ -190,13 +190,12 @@ static void pqg(FILE *in, FILE *out)
seed
,
M_EVP_MD_size
(
md
),
out
,
0
);
if
(
!
dsa2
)
{
fprintf
(
out
,
"c = %d
\n
"
,
counter
);
fprintf
(
out
,
"H = %lx
\n\n
"
,
h
);
fprintf
(
out
,
"c = %d
"
RESP_EOL
,
counter
);
fprintf
(
out
,
"H = %lx
"
RESP_EOL
RESP_EOL
,
h
);
}
else
{
fprintf
(
out
,
"counter = %d
\n
"
,
counter
);
fputs
(
"
\n
"
,
out
);
fprintf
(
out
,
"counter = %d"
RESP_EOL
RESP_EOL
,
counter
);
}
}
}
...
...
@@ -343,16 +342,16 @@ static void pqgver(FILE *in, FILE *out)
if
(
idx
>=
0
)
{
if
(
BN_cmp
(
dsa
->
g
,
g
))
fprintf
(
out
,
"Result = F
\n
"
);
fprintf
(
out
,
"Result = F
"
RESP_EOL
);
else
fprintf
(
out
,
"Result = P
\n
"
);
fprintf
(
out
,
"Result = P
"
RESP_EOL
);
}
else
if
(
BN_cmp
(
dsa
->
p
,
p
)
||
BN_cmp
(
dsa
->
q
,
q
)
||
(
!
part_test
&&
((
BN_cmp
(
dsa
->
g
,
g
)
||
(
counter
!=
counter2
)
||
(
h
!=
h2
)))))
fprintf
(
out
,
"Result = F
\n
"
);
fprintf
(
out
,
"Result = F
"
RESP_EOL
);
else
fprintf
(
out
,
"Result = P
\n
"
);
fprintf
(
out
,
"Result = P
"
RESP_EOL
);
BN_free
(
p
);
BN_free
(
q
);
BN_free
(
g
);
...
...
@@ -470,13 +469,13 @@ static void keyver(FILE *in, FILE *out)
paramcheck
=
-
1
;
}
if
(
paramcheck
!=
1
)
fprintf
(
out
,
"Result = F
\n
"
);
fprintf
(
out
,
"Result = F
"
RESP_EOL
);
else
{
if
(
!
BN_mod_exp
(
Y2
,
g
,
X
,
p
,
ctx
)
||
BN_cmp
(
Y2
,
Y
))
fprintf
(
out
,
"Result = F
\n
"
);
fprintf
(
out
,
"Result = F
"
RESP_EOL
);
else
fprintf
(
out
,
"Result = P
\n
"
);
fprintf
(
out
,
"Result = P
"
RESP_EOL
);
}
BN_free
(
X
);
BN_free
(
Y
);
...
...
@@ -537,7 +536,7 @@ static void keypair(FILE *in, FILE *out)
do_bn_print_name
(
out
,
"P"
,
dsa
->
p
);
do_bn_print_name
(
out
,
"Q"
,
dsa
->
q
);
do_bn_print_name
(
out
,
"G"
,
dsa
->
g
);
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
while
(
n
--
)
{
...
...
@@ -546,7 +545,7 @@ static void keypair(FILE *in, FILE *out)
do_bn_print_name
(
out
,
"X"
,
dsa
->
priv_key
);
do_bn_print_name
(
out
,
"Y"
,
dsa
->
pub_key
);
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
}
}
}
...
...
@@ -594,7 +593,7 @@ static void siggen(FILE *in, FILE *out)
do_bn_print_name
(
out
,
"P"
,
dsa
->
p
);
do_bn_print_name
(
out
,
"Q"
,
dsa
->
q
);
do_bn_print_name
(
out
,
"G"
,
dsa
->
g
);
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
}
else
if
(
!
strcmp
(
keyword
,
"Msg"
))
{
...
...
@@ -616,7 +615,7 @@ static void siggen(FILE *in, FILE *out)
do_bn_print_name
(
out
,
"R"
,
sig
->
r
);
do_bn_print_name
(
out
,
"S"
,
sig
->
s
);
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
FIPS_dsa_sig_free
(
sig
);
FIPS_md_ctx_cleanup
(
&
mctx
);
}
...
...
@@ -685,7 +684,7 @@ static void sigver(FILE *in, FILE *out)
no_err
=
0
;
FIPS_md_ctx_cleanup
(
&
mctx
);
fprintf
(
out
,
"Result = %c
\n\n
"
,
r
==
1
?
'P'
:
'F'
);
fprintf
(
out
,
"Result = %c
"
RESP_EOL
RESP_EOL
,
r
==
1
?
'P'
:
'F'
);
}
}
}
...
...
fips/ecdsa/fips_ecdsavs.c
浏览文件 @
4cc2bbab
...
...
@@ -234,7 +234,7 @@ static int KeyPair(FILE *in, FILE *out)
do_bn_print_name
(
out
,
"d"
,
d
);
do_bn_print_name
(
out
,
"Qx"
,
Qx
);
do_bn_print_name
(
out
,
"Qy"
,
Qy
);
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
EC_KEY_free
(
key
);
}
...
...
@@ -287,7 +287,7 @@ static int PKV(FILE *in, FILE *out)
no_err
=
1
;
rv
=
EC_KEY_set_public_key_affine_coordinates
(
key
,
Qx
,
Qy
);
no_err
=
0
;
fprintf
(
out
,
"Result = %s
\n
"
,
rv
?
"P"
:
"F"
);
fprintf
(
out
,
"Result = %s
"
RESP_EOL
,
rv
?
"P"
:
"F"
);
}
}
...
...
@@ -453,7 +453,7 @@ static int SigVer(FILE *in, FILE *out)
rv
=
FIPS_ecdsa_verify_ctx
(
key
,
&
mctx
,
sig
);
no_err
=
0
;
fprintf
(
out
,
"Result = %s
\n
"
,
rv
?
"P"
:
"F"
);
fprintf
(
out
,
"Result = %s
"
RESP_EOL
,
rv
?
"P"
:
"F"
);
}
}
...
...
fips/fips_utl.h
浏览文件 @
4cc2bbab
...
...
@@ -52,6 +52,12 @@
#include <openssl/fips_rand.h>
#include <openssl/objects.h>
#ifdef OPENSSL_SYS_WIN32
#define RESP_EOL "\n"
#else
#define RESP_EOL "\r\n"
#endif
int
hex2bin
(
const
char
*
in
,
unsigned
char
*
out
);
unsigned
char
*
hex2bin_m
(
const
char
*
in
,
long
*
plen
);
int
do_hex2bn
(
BIGNUM
**
pr
,
const
char
*
in
);
...
...
@@ -61,6 +67,7 @@ int parse_line(char **pkw, char **pval, char *linebuf, char *olinebuf);
int
parse_line2
(
char
**
pkw
,
char
**
pval
,
char
*
linebuf
,
char
*
olinebuf
,
int
eol
);
BIGNUM
*
hex2bn
(
const
char
*
in
);
int
tidy_line
(
char
*
linebuf
,
char
*
olinebuf
);
int
copy_line
(
const
char
*
in
,
FILE
*
ofp
);
int
bint2bin
(
const
char
*
in
,
int
len
,
unsigned
char
*
out
);
int
bin2bint
(
const
unsigned
char
*
in
,
int
len
,
char
*
out
);
void
PrintValue
(
char
*
tag
,
unsigned
char
*
val
,
int
len
);
...
...
@@ -74,9 +81,9 @@ static int no_err;
static
void
put_err_cb
(
int
lib
,
int
func
,
int
reason
,
const
char
*
file
,
int
line
)
{
if
(
no_err
)
return
;
fprintf
(
stderr
,
"ERROR:%08lX:lib=%d,func=%d,reason=%d"
if
(
no_err
)
return
;
fprintf
(
stderr
,
"ERROR:%08lX:lib=%d,func=%d,reason=%d"
":file=%s:line=%d
\n
"
,
ERR_PACK
(
lib
,
func
,
reason
),
lib
,
func
,
reason
,
file
,
line
);
...
...
@@ -257,7 +264,7 @@ int do_bn_print_name(FILE *out, const char *name, const BIGNUM *bn)
r
=
do_bn_print
(
out
,
bn
);
if
(
!
r
)
return
0
;
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
return
1
;
}
...
...
@@ -373,6 +380,20 @@ int tidy_line(char *linebuf, char *olinebuf)
return
1
;
}
/* Copy supplied line to ofp replacing \n with \r\n */
int
copy_line
(
const
char
*
in
,
FILE
*
ofp
)
{
const
char
*
p
;
p
=
strchr
(
in
,
'\n'
);
if
(
p
)
{
fwrite
(
in
,
1
,
(
size_t
)(
p
-
in
),
ofp
);
fputs
(
RESP_EOL
,
ofp
);
}
else
fputs
(
in
,
ofp
);
return
1
;
}
/* NB: this return the number of _bits_ read */
int
bint2bin
(
const
char
*
in
,
int
len
,
unsigned
char
*
out
)
...
...
@@ -412,7 +433,7 @@ void OutputValue(char *tag, unsigned char *val, int len, FILE *rfp,int bitmode)
if
(
bitmode
)
{
olen
=
bin2bint
(
val
,
len
,
obuf
);
fprintf
(
rfp
,
"%s = %.*s
\n
"
,
tag
,
olen
,
obuf
);
fprintf
(
rfp
,
"%s = %.*s
"
RESP_EOL
,
tag
,
olen
,
obuf
);
}
else
{
...
...
@@ -420,7 +441,7 @@ void OutputValue(char *tag, unsigned char *val, int len, FILE *rfp,int bitmode)
fprintf
(
rfp
,
"%s = "
,
tag
);
for
(
i
=
0
;
i
<
len
;
i
++
)
fprintf
(
rfp
,
"%02x"
,
val
[
i
]);
fputs
(
"
\n
"
,
rfp
);
fputs
(
RESP_EOL
,
rfp
);
}
#if VERBOSE
...
...
fips/hmac/fips_hmactest.c
浏览文件 @
4cc2bbab
...
...
@@ -313,7 +313,7 @@ static int print_hmac(const EVP_MD *emd, FILE *out,
fputs
(
"Mac = "
,
out
);
for
(
i
=
0
;
i
<
Tlen
;
i
++
)
fprintf
(
out
,
"%02x"
,
md
[
i
]);
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
return
1
;
}
...
...
fips/rsa/fips_rsastest.c
浏览文件 @
4cc2bbab
...
...
@@ -276,9 +276,9 @@ int rsa_stest(FILE *out, FILE *in, int Saltlen)
BN_free
(
bn_e
);
fputs
(
"n = "
,
out
);
do_bn_print
(
out
,
rsa
->
n
);
fputs
(
"
\n
e = "
,
out
);
fputs
(
RESP_EOL
"
e = "
,
out
);
do_bn_print
(
out
,
rsa
->
e
);
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
current_keylen
=
keylen
;
}
...
...
@@ -352,7 +352,7 @@ static int rsa_printsig(FILE *out, RSA *rsa, const EVP_MD *dgst,
for
(
i
=
0
;
i
<
siglen
;
i
++
)
fprintf
(
out
,
"%02X"
,
sigbuf
[
i
]);
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
ret
=
1
;
...
...
fips/rsa/fips_rsavtest.c
浏览文件 @
4cc2bbab
...
...
@@ -355,9 +355,9 @@ static int rsa_printver(FILE *out,
goto
error
;
if
(
r
==
0
)
fputs
(
"Result = F
\n
"
,
out
);
fputs
(
"Result = F
"
RESP_EOL
,
out
);
else
fputs
(
"Result = P
\n
"
,
out
);
fputs
(
"Result = P
"
RESP_EOL
,
out
);
ret
=
1
;
...
...
fips/sha/fips_shatest.c
浏览文件 @
4cc2bbab
...
...
@@ -305,7 +305,7 @@ static int print_dgst(const EVP_MD *emd, FILE *out,
fputs
(
"MD = "
,
out
);
for
(
i
=
0
;
i
<
mdlen
;
i
++
)
fprintf
(
out
,
"%02x"
,
md
[
i
]);
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
return
1
;
}
...
...
@@ -337,7 +337,7 @@ static int print_monte(const EVP_MD *md, FILE *out,
memcpy
(
m2
,
Seed
,
SeedLen
);
memcpy
(
m3
,
Seed
,
SeedLen
);
fputs
(
"
\n
"
,
out
);
fputs
(
RESP_EOL
,
out
);
for
(
j
=
0
;
j
<
100
;
j
++
)
{
...
...
@@ -355,11 +355,11 @@ static int print_monte(const EVP_MD *md, FILE *out,
m3
=
p
;
FIPS_digestfinal
(
&
ctx
,
m3
,
&
m3len
);
}
fprintf
(
out
,
"COUNT = %d
\n
"
,
j
);
fprintf
(
out
,
"COUNT = %d
"
RESP_EOL
,
j
);
fputs
(
"MD = "
,
out
);
for
(
k
=
0
;
k
<
m3len
;
k
++
)
fprintf
(
out
,
"%02x"
,
m3
[
k
]);
fputs
(
"
\n\n
"
,
out
);
fputs
(
RESP_EOL
RESP_EOL
,
out
);
memcpy
(
m1
,
m3
,
m3len
);
memcpy
(
m2
,
m3
,
m3len
);
m1len
=
m2len
=
m3len
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录