Remove unused parameters in tests.

This commit is contained in:
Brian Smith 2016-02-14 13:32:24 -10:00
parent f9db33d0f4
commit 8435da899b
7 changed files with 28 additions and 26 deletions

View File

@ -116,12 +116,12 @@ static bool test_mod_exp_mont(FILE *fp, BN_CTX *ctx);
static bool test_mod_exp_mont_consttime(FILE *fp, BN_CTX *ctx);
static bool test_exp(FILE *fp, BN_CTX *ctx);
static bool test_exp_mod_zero(void);
static bool test_small_prime(FILE *fp, BN_CTX *ctx);
static bool test_mod_exp_mont5(FILE *fp, BN_CTX *ctx);
static bool test_bn2bin_padded(BN_CTX *ctx);
static bool test_dec2bn(BN_CTX *ctx);
static bool test_hex2bn(BN_CTX *ctx);
static bool test_asc2bn(BN_CTX *ctx);
static bool test_small_prime(FILE *fp);
static bool test_mod_exp_mont5(BN_CTX *ctx);
static bool test_bn2bin_padded();
static bool test_dec2bn();
static bool test_hex2bn();
static bool test_asc2bn();
static bool test_rand();
static bool test_asn1();
@ -277,7 +277,7 @@ int main(int argc, char *argv[]) {
message(bc_file.get(), "BN_mod_exp_mont_consttime");
if (!test_mod_exp_mont_consttime(bc_file.get(), ctx.get()) ||
!test_mod_exp_mont5(bc_file.get(), ctx.get())) {
!test_mod_exp_mont5(ctx.get())) {
return 1;
}
flush_fp(bc_file.get());
@ -290,15 +290,15 @@ int main(int argc, char *argv[]) {
flush_fp(bc_file.get());
message(bc_file.get(), "Small prime generation");
if (!test_small_prime(bc_file.get(), ctx.get())) {
if (!test_small_prime(bc_file.get())) {
return 1;
}
flush_fp(bc_file.get());
if (!test_bn2bin_padded(ctx.get()) ||
!test_dec2bn(ctx.get()) ||
!test_hex2bn(ctx.get()) ||
!test_asc2bn(ctx.get()) ||
if (!test_bn2bin_padded() ||
!test_dec2bn() ||
!test_hex2bn() ||
!test_asc2bn() ||
!test_rand() ||
!test_asn1()) {
return 1;
@ -1124,7 +1124,7 @@ static bool test_mod_exp_mont_consttime(FILE *fp, BN_CTX *ctx) {
// Test constant-time modular exponentiation with 1024-bit inputs,
// which on x86_64 cause a different code branch to be taken.
static bool test_mod_exp_mont5(FILE *fp, BN_CTX *ctx) {
static bool test_mod_exp_mont5(BN_CTX *ctx) {
ScopedBIGNUM a(BN_new());
ScopedBIGNUM p(BN_new());
ScopedBIGNUM m(BN_new());
@ -1253,7 +1253,7 @@ static bool test_exp_mod_zero(void) {
return true;
}
static bool test_small_prime(FILE *fp, BN_CTX *ctx) {
static bool test_small_prime(FILE *fp) {
static const unsigned kBits = 10;
ScopedBIGNUM r(BN_new());
@ -1270,7 +1270,7 @@ static bool test_small_prime(FILE *fp, BN_CTX *ctx) {
return true;
}
static bool test_bn2bin_padded(BN_CTX *ctx) {
static bool test_bn2bin_padded() {
uint8_t zeros[256], out[256], reference[128];
memset(zeros, 0, sizeof(zeros));
@ -1346,7 +1346,7 @@ static int DecimalToBIGNUM(ScopedBIGNUM *out, const char *in) {
return ret;
}
static bool test_dec2bn(BN_CTX *ctx) {
static bool test_dec2bn() {
ScopedBIGNUM bn;
int ret = DecimalToBIGNUM(&bn, "0");
if (ret != 1 || !BN_is_zero(bn.get()) || BN_is_negative(bn.get())) {
@ -1381,7 +1381,7 @@ static bool test_dec2bn(BN_CTX *ctx) {
return true;
}
static bool test_hex2bn(BN_CTX *ctx) {
static bool test_hex2bn() {
ScopedBIGNUM bn;
int ret = HexToBIGNUM(&bn, "0");
if (ret != 1 || !BN_is_zero(bn.get()) || BN_is_negative(bn.get())) {
@ -1424,7 +1424,7 @@ static ScopedBIGNUM ASCIIToBIGNUM(const char *in) {
return ScopedBIGNUM(raw);
}
static bool test_asc2bn(BN_CTX *ctx) {
static bool test_asc2bn() {
ScopedBIGNUM bn = ASCIIToBIGNUM("0");
if (!bn || !BN_is_zero(bn.get()) || BN_is_negative(bn.get())) {
fprintf(stderr, "BN_asc2bn gave a bad result.\n");

View File

@ -233,7 +233,7 @@ static int signed_test_values[] = {
0, 1, -1, 1024, -1024, 12345, -12345,
32000, -32000, INT_MAX, INT_MIN, INT_MAX - 1, INT_MIN + 1};
int main(int argc, char* argv[]) {
int main(void) {
unsigned int a, b, i, j;
int c, d;
uint8_t e, f;

View File

@ -109,7 +109,7 @@ static bool VerifyECDSASig(int digest_nid, const uint8_t *digest,
// TestTamperedSig verifies that signature verification fails when a valid
// signature is tampered with. |ecdsa_sig| must be a valid signature, which will
// be modified. TestTamperedSig returns true on success, false on failure.
static bool TestTamperedSig(FILE *out, int digest_nid, const uint8_t *digest,
static bool TestTamperedSig(int digest_nid, const uint8_t *digest,
size_t digest_len, ECDSA_SIG *ecdsa_sig,
const EC_GROUP *group, const EC_POINT *pub_key,
const BIGNUM *order) {
@ -266,7 +266,7 @@ static bool TestBuiltin(FILE *out) {
ScopedECDSA_SIG ecdsa_sig(ECDSA_SIG_from_bytes(signature.data(),
signature.size()));
if (!ecdsa_sig ||
!TestTamperedSig(out, NID_sha1, digest, 20, ecdsa_sig.get(), group,
!TestTamperedSig(NID_sha1, digest, 20, ecdsa_sig.get(), group,
EC_KEY_get0_public_key(eckey.get()), order)) {
fprintf(out, "TestTamperedSig failed for %s\n", kCurves[n].name);
return false;

View File

@ -24,7 +24,7 @@
#include "../test/file_test.h"
static bool TestPoly1305(FileTest *t, void *arg) {
static bool TestPoly1305(FileTest *t, void * /*arg*/) {
std::vector<uint8_t> key, in, mac;
if (!t->GetBytes(&key, "Key") ||
!t->GetBytes(&in, "Input") ||

View File

@ -19,7 +19,7 @@
#include <openssl/type_check.h>
int main(int argc, char **argv) {
int main(void) {
CRYPTO_refcount_t count = 0;
CRYPTO_refcount_inc(&count);

View File

@ -264,6 +264,8 @@ static bool TestRSA(const uint8_t *der, size_t der_len,
}
/* ring: OAEP padding is not implemented yet. */
(void)oaep_ciphertext;
(void)oaep_ciphertext_len;
#if 0
ciphertext_len = 0;
if (!RSA_encrypt(key.get(), &ciphertext_len, ciphertext, sizeof(ciphertext),
@ -491,7 +493,7 @@ static bool TestBadExponent() {
return true;
}
int main(int argc, char *argv[]) {
int main(void) {
CRYPTO_library_init();
if (!TestRSA(kKey1, sizeof(kKey1) - 1, kOAEPCiphertext1,

View File

@ -188,7 +188,7 @@ static int test_thread_local(void) {
return 1;
}
int main(int argc, char **argv) {
int main(void) {
if (!test_once() ||
!test_thread_local()) {
return 1;
@ -199,7 +199,7 @@ int main(int argc, char **argv) {
#else /* OPENSSL_NO_THREADS */
int main(int argc, char **argv) {
int main(void) {
return 0;
}