projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Missing semicolon.
[openssl.git]
/
fips
/
aes
/
fips_gcmtest.c
diff --git
a/fips/aes/fips_gcmtest.c
b/fips/aes/fips_gcmtest.c
index 438014ff14f6623972d814b515741264f49a4ded..9f50857fb9075ed4cd67021d78dd2601af43655e 100644
(file)
--- a/
fips/aes/fips_gcmtest.c
+++ b/
fips/aes/fips_gcmtest.c
@@
-243,7
+243,7
@@
static void gcmtest(FILE *in, FILE *out, int encrypt)
}
rv = FIPS_cipher(&ctx, NULL, NULL, 0);
if (rv < 0)
}
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)
else
OutputValue("PT", pt, ptlen, out, 0);
if (iv)
@@
-261,16
+261,16
@@
static void gcmtest(FILE *in, FILE *out, int encrypt)
iv = aad = ct = pt = key = tag = NULL;
}
}
iv = aad = ct = pt = key = tag = NULL;
}
}
+ FIPS_cipher_ctx_cleanup(&ctx);
}
static void xtstest(FILE *in, FILE *out)
{
}
static void xtstest(FILE *in, FILE *out)
{
- char buf[2048];
- char lbuf[2048];
+ char buf[2048
00
];
+ char lbuf[2048
00
];
char *keyword, *value;
char *keyword, *value;
- int inlen;
+ int inlen
= 0
;
int encrypt = 0;
int encrypt = 0;
- int rv;
long l;
unsigned char *key = NULL, *iv = NULL;
unsigned char *inbuf = NULL, *outbuf = NULL;
long l;
unsigned char *key = NULL, *iv = NULL;
unsigned char *inbuf = NULL, *outbuf = NULL;
@@
-326,7
+326,7
@@
static void xtstest(FILE *in, FILE *out)
{
FIPS_cipherinit(&ctx, xts, key, iv, encrypt);
outbuf = OPENSSL_malloc(inlen);
{
FIPS_cipherinit(&ctx, xts, key, iv, encrypt);
outbuf = OPENSSL_malloc(inlen);
-
rv =
FIPS_cipher(&ctx, outbuf, inbuf, inlen);
+ FIPS_cipher(&ctx, outbuf, inbuf, inlen);
OutputValue(encrypt ? "CT":"PT", outbuf, inlen, out, 0);
OPENSSL_free(inbuf);
OPENSSL_free(outbuf);
OutputValue(encrypt ? "CT":"PT", outbuf, inlen, out, 0);
OPENSSL_free(inbuf);
OPENSSL_free(outbuf);
@@
-335,6
+335,7
@@
static void xtstest(FILE *in, FILE *out)
iv = key = inbuf = outbuf = NULL;
}
}
iv = key = inbuf = outbuf = NULL;
}
}
+ FIPS_cipher_ctx_cleanup(&ctx);
}
static void ccmtest(FILE *in, FILE *out)
}
static void ccmtest(FILE *in, FILE *out)
@@
-428,6
+429,8
@@
static void ccmtest(FILE *in, FILE *out)
}
else if (!strcmp(keyword,"Adata"))
{
}
else if (!strcmp(keyword,"Adata"))
{
+ if (Adata)
+ OPENSSL_free(Adata);
Adata = hex2bin_m(value, &l);
if (Alen && l != Alen)
{
Adata = hex2bin_m(value, &l);
if (Alen && l != Alen)
{
@@
-479,11
+482,11
@@
static void ccmtest(FILE *in, FILE *out)
{
if (rv == 0)
Payload[0] = 0;
{
if (rv == 0)
Payload[0] = 0;
- fputs("Result = Pass
\n"
, out);
+ fputs("Result = Pass
" RESP_EOL
, out);
OutputValue("Payload", Payload, len, out, 0);
}
else
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;
OPENSSL_free(CT);
OPENSSL_free(Payload);
CT = Payload = NULL;
@@
-493,10
+496,16
@@
static void ccmtest(FILE *in, FILE *out)
OPENSSL_free(Key);
if (Nonce)
OPENSSL_free(Nonce);
OPENSSL_free(Key);
if (Nonce)
OPENSSL_free(Nonce);
+ if (Adata)
+ OPENSSL_free(Adata);
FIPS_cipher_ctx_cleanup(&ctx);
}
FIPS_cipher_ctx_cleanup(&ctx);
}
-int main(int argc,char **argv)
+#ifdef FIPS_ALGVS
+int fips_gcmtest_main(int argc, char **argv)
+#else
+int main(int argc, char **argv)
+#endif
{
int encrypt;
int xts = 0, ccm = 0;
{
int encrypt;
int xts = 0, ccm = 0;