From: Dr. Stephen Henson Date: Sun, 9 Aug 2009 16:02:50 +0000 (+0000) Subject: Fix signed/unsigned warnings and make several functions static. X-Git-Tag: OpenSSL_0_9_8m-beta1~147 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=c4b3503b4bc8c70e548df084bf4c5cea25c85c28 Fix signed/unsigned warnings and make several functions static. --- diff --git a/fips/dsa/fips_dsa_key.c b/fips/dsa/fips_dsa_key.c index b5f8cfa1d0..9f21033b21 100644 --- a/fips/dsa/fips_dsa_key.c +++ b/fips/dsa/fips_dsa_key.c @@ -78,7 +78,7 @@ void FIPS_corrupt_dsa_keygen(void) static int dsa_builtin_keygen(DSA *dsa); -int fips_check_dsa(DSA *dsa) +static int fips_check_dsa(DSA *dsa) { EVP_PKEY pk; unsigned char tbs[] = "DSA Pairwise Check Data"; diff --git a/fips/dsa/fips_dsa_sign.c b/fips/dsa/fips_dsa_sign.c index 32ea0b0fea..7a4d51d734 100644 --- a/fips/dsa/fips_dsa_sign.c +++ b/fips/dsa/fips_dsa_sign.c @@ -70,6 +70,7 @@ * case of a DSA signature. */ +#if 0 int FIPS_dsa_size(DSA *r) { int ilen; @@ -83,6 +84,7 @@ int FIPS_dsa_size(DSA *r) */ return ilen * 2 + 6; } +#endif /* Tiny ASN1 encoder for DSA_SIG structure. We can assume r, s smaller than * 0x80 octets as by the DSA standards they will be less than 2^160 diff --git a/fips/hmac/fips_hmac.c b/fips/hmac/fips_hmac.c index 7c49c9882a..69a10da843 100644 --- a/fips/hmac/fips_hmac.c +++ b/fips/hmac/fips_hmac.c @@ -88,7 +88,7 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, reset=1; j=M_EVP_MD_block_size(md); - OPENSSL_assert(j <= sizeof ctx->key); + OPENSSL_assert(j <= (int)sizeof ctx->key); if (j < len) { EVP_DigestInit_ex(&ctx->md_ctx,md, impl); @@ -98,7 +98,7 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, } else { - OPENSSL_assert(len <= sizeof ctx->key); + OPENSSL_assert(len <= (int)sizeof ctx->key); memcpy(ctx->key,key,len); ctx->key_length=len; } diff --git a/fips/hmac/fips_hmac_selftest.c b/fips/hmac/fips_hmac_selftest.c index a697770732..73455ffee2 100644 --- a/fips/hmac/fips_hmac_selftest.c +++ b/fips/hmac/fips_hmac_selftest.c @@ -111,7 +111,7 @@ static const HMAC_KAT vector[] = { int FIPS_selftest_hmac() { - int n; + size_t n; unsigned int outlen; unsigned char out[EVP_MAX_MD_SIZE]; const EVP_MD *md; diff --git a/fips/rand/fips_rand.c b/fips/rand/fips_rand.c index 58453e996d..9492b157c1 100644 --- a/fips/rand/fips_rand.c +++ b/fips/rand/fips_rand.c @@ -114,7 +114,7 @@ void FIPS_rng_stick(void) fips_prng_fail = 1; } -void fips_rand_prng_reset(FIPS_PRNG_CTX *ctx) +static void fips_rand_prng_reset(FIPS_PRNG_CTX *ctx) { ctx->seeded = 0; ctx->keyed = 0; @@ -192,7 +192,7 @@ static int fips_set_prng_seed(FIPS_PRNG_CTX *ctx, return 1; } -int fips_set_test_mode(FIPS_PRNG_CTX *ctx) +static int fips_set_test_mode(FIPS_PRNG_CTX *ctx) { if (ctx->keyed) { diff --git a/fips/rsa/fips_rsa_gen.c b/fips/rsa/fips_rsa_gen.c index 90aaa2f095..5739a1ebef 100644 --- a/fips/rsa/fips_rsa_gen.c +++ b/fips/rsa/fips_rsa_gen.c @@ -82,7 +82,7 @@ void FIPS_corrupt_rsa_keygen(void) fips_rsa_pairwise_fail = 1; } -int fips_check_rsa(RSA *rsa) +static int fips_check_rsa(RSA *rsa) { const unsigned char tbs[] = "RSA Pairwise Check Data"; unsigned char *ctbuf = NULL, *ptbuf = NULL;