tests+timing - silence valgrind warning (memleak)

This commit is contained in:
Karel Miko 2017-06-19 20:09:20 +02:00
parent 03437a1bdd
commit e5f25b6553
3 changed files with 5 additions and 1 deletions

View File

@ -674,6 +674,7 @@ static const struct {
} }
t2 >>= 2; t2 >>= 2;
fprintf(stderr, "DSA-(%lu, %lu) make_key took %15"PRI64"u cycles\n", (unsigned long)groups[x].group*8, (unsigned long)groups[x].modulus*8, t2); fprintf(stderr, "DSA-(%lu, %lu) make_key took %15"PRI64"u cycles\n", (unsigned long)groups[x].group*8, (unsigned long)groups[x].modulus*8, t2);
dsa_free(&key);
} }
fprintf(stderr, "\n\n"); fprintf(stderr, "\n\n");
} }

View File

@ -23,7 +23,9 @@ int file_test(void)
len = sizeof(buf); len = sizeof(buf);
if ((in = fopen(fname, "rb")) == NULL) return CRYPT_FILE_NOTFOUND; if ((in = fopen(fname, "rb")) == NULL) return CRYPT_FILE_NOTFOUND;
if ((err = hash_filehandle(isha256, in, buf, &len)) != CRYPT_OK) return err; err = hash_filehandle(isha256, in, buf, &len);
fclose(in);
if (err != CRYPT_OK) return err;
if (compare_testvector(buf, len, exp_sha256, 32, "hash_filehandle", 1)) return 1; if (compare_testvector(buf, len, exp_sha256, 32, "hash_filehandle", 1)) return 1;
len = sizeof(buf); len = sizeof(buf);

View File

@ -193,6 +193,7 @@ static int rsa_compat_test(void)
fprintf(stderr, "RSA rsa_verify_hash_ex + LTC_PKCS_1_V1_5_NA1 failed\n"); fprintf(stderr, "RSA rsa_verify_hash_ex + LTC_PKCS_1_V1_5_NA1 failed\n");
return 1; return 1;
} }
rsa_free(&pubkey);
/* now try to export private/public and compare */ /* now try to export private/public and compare */
len = sizeof(buf); len = sizeof(buf);