projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove some unnecessary OPENSSL_FIPS references
[oweals/openssl.git]
/
fips
/
cmac
/
fips_cmactest.c
diff --git
a/fips/cmac/fips_cmactest.c
b/fips/cmac/fips_cmactest.c
index cc07265370b2b349f3f7efdfa77d60552e3293c0..2c8c7664e9f04ef8572205a08b7041df2bf80f05 100644
(file)
--- a/
fips/cmac/fips_cmactest.c
+++ b/
fips/cmac/fips_cmactest.c
@@
-92,7
+92,11
@@
static int print_cmac_ver(const EVP_CIPHER *cipher, FILE *out,
unsigned char *Mac, int Maclen,
int Tlen);
unsigned char *Mac, int Maclen,
int Tlen);
+#ifdef FIPS_ALGVS
+int fips_cmactest_main(int argc, char **argv)
+#else
int main(int argc, char **argv)
int main(int argc, char **argv)
+#endif
{
FILE *in = NULL, *out = NULL;
int mode = 0; /* 0 => Generate, 1 => Verify */
{
FILE *in = NULL, *out = NULL;
int mode = 0; /* 0 => Generate, 1 => Verify */
@@
-102,9
+106,7
@@
int main(int argc, char **argv)
int known_keylen = 0; /* Only set when Klen_counts_keys = 1 */
const EVP_CIPHER *cipher = 0;
int ret = 1;
int known_keylen = 0; /* Only set when Klen_counts_keys = 1 */
const EVP_CIPHER *cipher = 0;
int ret = 1;
- fips_set_error_print();
- if(!FIPS_mode_set(1))
- goto end;
+ fips_algtest_init();
while (argc > 1 && argv[1][0] == '-')
{
while (argc > 1 && argv[1][0] == '-')
{
@@
-466,7
+468,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("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);
rc = 1;
}
CMAC_CTX_free(cmac_ctx);
@@
-479,7
+481,7
@@
static int print_cmac_ver(const EVP_CIPHER *cipher, FILE *out,
unsigned char *Mac, int Maclen,
int Tlen)
{
unsigned char *Mac, int Maclen,
int Tlen)
{
- int rc;
+ int rc
= 1
;
size_t reslen;
unsigned char res[128];
CMAC_CTX *cmac_ctx = CMAC_CTX_new();
size_t reslen;
unsigned char res[128];
CMAC_CTX *cmac_ctx = CMAC_CTX_new();
@@
-504,9
+506,9
@@
static int print_cmac_ver(const EVP_CIPHER *cipher, FILE *out,
else
{
if (!memcmp(Mac, res, Maclen))
else
{
if (!memcmp(Mac, res, Maclen))
- fputs("Result = P
\n"
, out);
+ fputs("Result = P
" RESP_EOL
, out);
else
else
- fputs("Result = F
\n"
, out);
+ fputs("Result = F
" RESP_EOL
, out);
}
CMAC_CTX_free(cmac_ctx);
return rc;
}
CMAC_CTX_free(cmac_ctx);
return rc;