From: Adriaan de Jong Date: Mon, 31 Oct 2011 15:29:20 +0000 (+0100) Subject: Minor cleanup to enable warning-free Windows build: X-Git-Tag: v2.3-alpha1~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be960aad88a78967e6425be0d1dc36ea1af6f584;p=thirdparty%2Fopenvpn.git Minor cleanup to enable warning-free Windows build: - Changed int32_t to size_t - Removed some unused variables - Added missing include files - changed ordering to ensure variable declarations are before asserts Signed-off-by: Adriaan de Jong Tested-by: Samuli Seppänen Acked-by: David Sommerseth Signed-off-by: David Sommerseth --- diff --git a/crypto.c b/crypto.c index 375d35ac3..e6285781e 100644 --- a/crypto.c +++ b/crypto.c @@ -1336,11 +1336,10 @@ prng_uninit (void) void prng_bytes (uint8_t *output, int len) { - static int32_t processed = 0; + static size_t processed = 0; if (nonce_md) { - md_ctx_t ctx; const int md_size = md_kt_size (nonce_md); while (len > 0) { diff --git a/pkcs11_polarssl.c b/pkcs11_polarssl.c index 4f8bf3393..0f9daab62 100644 --- a/pkcs11_polarssl.c +++ b/pkcs11_polarssl.c @@ -40,7 +40,6 @@ pkcs11_init_tls_session(pkcs11h_certificate_t certificate, struct tls_root_ctx * const ssl_ctx) { int ret = 1; - pkcs11_context pkcs11_ctx; ASSERT (NULL != ssl_ctx); diff --git a/ssl_openssl.c b/ssl_openssl.c index 1cc2bfb44..391968a9d 100644 --- a/ssl_openssl.c +++ b/ssl_openssl.c @@ -38,6 +38,7 @@ #include "memdbg.h" #include "ssl_backend.h" #include "ssl_common.h" +#include "base64.h" #ifdef ENABLE_CRYPTOAPI #include "cryptoapi.h" @@ -349,7 +350,6 @@ tls_ctx_load_cryptoapi(struct tls_root_ctx *ctx, const char *cryptoapi_cert) static int tls_ctx_read_certificate_file(SSL_CTX *ctx, const char *file, X509 **x509) { - int j; BIO *in; int ret=0; X509 *x=NULL; @@ -480,10 +480,10 @@ tls_ctx_load_priv_file (struct tls_root_ctx *ctx, const char *priv_key_file #endif ) { - ASSERT(NULL != ctx); - int status; + ASSERT(NULL != ctx); + #if ENABLE_INLINE_FILES if (!strcmp (priv_key_file, INLINE_FILE_TAG) && priv_key_file_inline) { diff --git a/ssl_polarssl.c b/ssl_polarssl.c index 60d99a8bb..c50cf0a35 100644 --- a/ssl_polarssl.c +++ b/ssl_polarssl.c @@ -347,8 +347,6 @@ void tls_ctx_load_ca (struct tls_root_ctx *ctx, const char *ca_file, const char *ca_path, bool tls_server ) { - int status; - if (ca_path) msg(M_FATAL, "ERROR: PolarSSL cannot handle the capath directive"); diff --git a/ssl_verify_openssl.c b/ssl_verify_openssl.c index 13c2f4eda..e82f6f920 100644 --- a/ssl_verify_openssl.c +++ b/ssl_verify_openssl.c @@ -35,6 +35,7 @@ #include "ssl_verify_backend.h" #include "ssl_openssl.h" #include +#include int verify_callback (int preverify_ok, X509_STORE_CTX * ctx) diff --git a/ssl_verify_polarssl.c b/ssl_verify_polarssl.c index 7fdca1fea..699eb4733 100644 --- a/ssl_verify_polarssl.c +++ b/ssl_verify_polarssl.c @@ -191,7 +191,7 @@ x509_free_subject (char *subject) void x509_setenv (struct env_set *es, int cert_depth, x509_cert_t *cert) { - int i, ret; + int i; unsigned char c; const x509_name *name; char s[128];