fix set but unused warnings
This commit is contained in:
parent
29fd6746f5
commit
835d355b97
@ -554,7 +554,7 @@ static int proc_file(char *rqfile, char *rspfile)
|
|||||||
FILE *afp = NULL, *rfp = NULL;
|
FILE *afp = NULL, *rfp = NULL;
|
||||||
char ibuf[2048];
|
char ibuf[2048];
|
||||||
char tbuf[2048];
|
char tbuf[2048];
|
||||||
int ilen, len, ret = 0;
|
int len;
|
||||||
char algo[8] = "";
|
char algo[8] = "";
|
||||||
char amode[8] = "";
|
char amode[8] = "";
|
||||||
char atest[8] = "";
|
char atest[8] = "";
|
||||||
@ -605,7 +605,6 @@ static int proc_file(char *rqfile, char *rspfile)
|
|||||||
while (!err && (fgets(ibuf, sizeof(ibuf), afp)) != NULL)
|
while (!err && (fgets(ibuf, sizeof(ibuf), afp)) != NULL)
|
||||||
{
|
{
|
||||||
tidy_line(tbuf, ibuf);
|
tidy_line(tbuf, ibuf);
|
||||||
ilen = strlen(ibuf);
|
|
||||||
/* printf("step=%d ibuf=%s",step,ibuf); */
|
/* printf("step=%d ibuf=%s",step,ibuf); */
|
||||||
switch (step)
|
switch (step)
|
||||||
{
|
{
|
||||||
@ -784,7 +783,7 @@ static int proc_file(char *rqfile, char *rspfile)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = AESTest(&ctx, amode, akeysz, aKey, iVec,
|
AESTest(&ctx, amode, akeysz, aKey, iVec,
|
||||||
dir, /* 0 = decrypt, 1 = encrypt */
|
dir, /* 0 = decrypt, 1 = encrypt */
|
||||||
plaintext, ciphertext, len);
|
plaintext, ciphertext, len);
|
||||||
OutputValue("CIPHERTEXT",ciphertext,len,rfp,
|
OutputValue("CIPHERTEXT",ciphertext,len,rfp,
|
||||||
@ -822,7 +821,7 @@ static int proc_file(char *rqfile, char *rspfile)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = AESTest(&ctx, amode, akeysz, aKey, iVec,
|
AESTest(&ctx, amode, akeysz, aKey, iVec,
|
||||||
dir, /* 0 = decrypt, 1 = encrypt */
|
dir, /* 0 = decrypt, 1 = encrypt */
|
||||||
plaintext, ciphertext, len);
|
plaintext, ciphertext, len);
|
||||||
OutputValue("PLAINTEXT",(unsigned char *)plaintext,len,rfp,
|
OutputValue("PLAINTEXT",(unsigned char *)plaintext,len,rfp,
|
||||||
@ -872,7 +871,7 @@ int main(int argc, char **argv)
|
|||||||
char *rqlist = "req.txt", *rspfile = NULL;
|
char *rqlist = "req.txt", *rspfile = NULL;
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
char fn[250] = "", rfn[256] = "";
|
char fn[250] = "", rfn[256] = "";
|
||||||
int f_opt = 0, d_opt = 1;
|
int d_opt = 1;
|
||||||
fips_algtest_init();
|
fips_algtest_init();
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
@ -883,7 +882,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else if (strcasecmp(argv[1], "-f") == 0)
|
else if (strcasecmp(argv[1], "-f") == 0)
|
||||||
{
|
{
|
||||||
f_opt = 1;
|
|
||||||
d_opt = 0;
|
d_opt = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -271,7 +271,6 @@ static void xtstest(FILE *in, FILE *out)
|
|||||||
char *keyword, *value;
|
char *keyword, *value;
|
||||||
int inlen = 0;
|
int inlen = 0;
|
||||||
int encrypt = 0;
|
int encrypt = 0;
|
||||||
int rv;
|
|
||||||
long l;
|
long l;
|
||||||
unsigned char *key = NULL, *iv = NULL;
|
unsigned char *key = NULL, *iv = NULL;
|
||||||
unsigned char *inbuf = NULL, *outbuf = NULL;
|
unsigned char *inbuf = NULL, *outbuf = NULL;
|
||||||
@ -327,7 +326,7 @@ static void xtstest(FILE *in, FILE *out)
|
|||||||
{
|
{
|
||||||
FIPS_cipherinit(&ctx, xts, key, iv, encrypt);
|
FIPS_cipherinit(&ctx, xts, key, iv, encrypt);
|
||||||
outbuf = OPENSSL_malloc(inlen);
|
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);
|
OutputValue(encrypt ? "CT":"PT", outbuf, inlen, out, 0);
|
||||||
OPENSSL_free(inbuf);
|
OPENSSL_free(inbuf);
|
||||||
OPENSSL_free(outbuf);
|
OPENSSL_free(outbuf);
|
||||||
|
@ -273,7 +273,7 @@ static int tproc_file(char *rqfile, char *rspfile)
|
|||||||
char afn[256], rfn[256];
|
char afn[256], rfn[256];
|
||||||
FILE *afp = NULL, *rfp = NULL;
|
FILE *afp = NULL, *rfp = NULL;
|
||||||
char ibuf[2048], tbuf[2048];
|
char ibuf[2048], tbuf[2048];
|
||||||
int ilen, len, ret = 0;
|
int len;
|
||||||
char amode[8] = "";
|
char amode[8] = "";
|
||||||
char atest[100] = "";
|
char atest[100] = "";
|
||||||
int akeysz=0;
|
int akeysz=0;
|
||||||
@ -324,7 +324,6 @@ static int tproc_file(char *rqfile, char *rspfile)
|
|||||||
while (!err && (fgets(ibuf, sizeof(ibuf), afp)) != NULL)
|
while (!err && (fgets(ibuf, sizeof(ibuf), afp)) != NULL)
|
||||||
{
|
{
|
||||||
tidy_line(tbuf, ibuf);
|
tidy_line(tbuf, ibuf);
|
||||||
ilen = strlen(ibuf);
|
|
||||||
/* printf("step=%d ibuf=%s",step,ibuf);*/
|
/* printf("step=%d ibuf=%s",step,ibuf);*/
|
||||||
if(step == 3 && !strcmp(amode,"ECB"))
|
if(step == 3 && !strcmp(amode,"ECB"))
|
||||||
{
|
{
|
||||||
@ -555,7 +554,7 @@ static int tproc_file(char *rqfile, char *rspfile)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert(dir == 1);
|
assert(dir == 1);
|
||||||
ret = DESTest(&ctx, amode, akeysz, aKey, iVec,
|
DESTest(&ctx, amode, akeysz, aKey, iVec,
|
||||||
dir, /* 0 = decrypt, 1 = encrypt */
|
dir, /* 0 = decrypt, 1 = encrypt */
|
||||||
ciphertext, plaintext, len);
|
ciphertext, plaintext, len);
|
||||||
OutputValue("CIPHERTEXT",ciphertext,len,rfp,
|
OutputValue("CIPHERTEXT",ciphertext,len,rfp,
|
||||||
@ -595,7 +594,7 @@ static int tproc_file(char *rqfile, char *rspfile)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert(dir == 0);
|
assert(dir == 0);
|
||||||
ret = DESTest(&ctx, amode, akeysz, aKey, iVec,
|
DESTest(&ctx, amode, akeysz, aKey, iVec,
|
||||||
dir, /* 0 = decrypt, 1 = encrypt */
|
dir, /* 0 = decrypt, 1 = encrypt */
|
||||||
plaintext, ciphertext, len);
|
plaintext, ciphertext, len);
|
||||||
OutputValue("PLAINTEXT",(unsigned char *)plaintext,len,rfp,
|
OutputValue("PLAINTEXT",(unsigned char *)plaintext,len,rfp,
|
||||||
@ -645,7 +644,7 @@ int main(int argc, char **argv)
|
|||||||
char *rqlist = "req.txt", *rspfile = NULL;
|
char *rqlist = "req.txt", *rspfile = NULL;
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
char fn[250] = "", rfn[256] = "";
|
char fn[250] = "", rfn[256] = "";
|
||||||
int f_opt = 0, d_opt = 1;
|
int d_opt = 1;
|
||||||
|
|
||||||
fips_algtest_init();
|
fips_algtest_init();
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
@ -656,7 +655,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else if (fips_strcasecmp(argv[1], "-f") == 0)
|
else if (fips_strcasecmp(argv[1], "-f") == 0)
|
||||||
{
|
{
|
||||||
f_opt = 1;
|
|
||||||
d_opt = 0;
|
d_opt = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user