]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Minor cleanup to enable warning-free Windows build:
authorAdriaan de Jong <dejong@fox-it.com>
Mon, 31 Oct 2011 15:29:20 +0000 (16:29 +0100)
committerDavid Sommerseth <davids@redhat.com>
Mon, 21 Nov 2011 10:51:39 +0000 (11:51 +0100)
- 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 <dejong@fox-it.com>
Tested-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
crypto.c
pkcs11_polarssl.c
ssl_openssl.c
ssl_polarssl.c
ssl_verify_openssl.c
ssl_verify_polarssl.c

index 375d35ac3708ab06de1056690b1e30cb55f0e574..e6285781e363b1eb38f776e6a84777d8600fc5fb 100644 (file)
--- 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)
        {
index 4f8bf33935835253e17bb8b9805d2d5aa0e13bf0..0f9daab620ec35e83c5a2b0de8bc335e98db909e 100644 (file)
@@ -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);
 
index 1cc2bfb449ae3418e8b0dd27a373348ea5392f48..391968a9dd8aa09594bfa77dbd658b982654154e 100644 (file)
@@ -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)
     {
index 60d99a8bbf05a294f28ff1e5592c826be02dedfe..c50cf0a35c06e7caa0ede8a58e824da4141092b5 100644 (file)
@@ -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");
 
index 13c2f4edab41338b9b7b2fa0d735fd918222a1d6..e82f6f920fc38f3eda7d4638060324af827b99d8 100644 (file)
@@ -35,6 +35,7 @@
 #include "ssl_verify_backend.h"
 #include "ssl_openssl.h"
 #include <openssl/x509v3.h>
+#include <openssl/err.h>
 
 int
 verify_callback (int preverify_ok, X509_STORE_CTX * ctx)
index 7fdca1feaa42afc70e022421645f21ae492ba22e..699eb4733daa3c309e4a13b30941a342aef32747 100644 (file)
@@ -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];