Hello,

 This is a trivial patch fixing the following error messages when building
OpenSSL 1.0.0 beta3 under Windows with MSVC:

ssl\s23_clnt.c(276) : error C2220: warning treated as error - no object file 
generated
ssl\s23_clnt.c(276) : warning C4101: 'comp' : unreferenced local variable
ssl\s23_clnt.c(272) : warning C4101: 'j' : unreferenced local variable
ssl\ssl_asn1.c(123) : error C2220: warning treated as error - no object file 
generated
ssl\ssl_asn1.c(123) : warning C4101: 'cbuf' : unreferenced local variable
apps\openssl.c(367) : error C2220: warning treated as error - no object file 
generated
apps\openssl.c(367) : warning C4013: 'COMP_zlib_cleanup' undefined; assuming 
extern returning int

The first two fixes are completely trivial while I'm less sure about the
last one but it does let the build finish and shouldn't break anything.

 Thanks,
VZ

diff --git a/apps/apps.h b/apps/apps.h
index 4b0a0e1..95bd5ba 100755
--- a/apps/apps.h
+++ b/apps/apps.h
@@ -174,6 +174,10 @@ extern BIO *bio_err;
 #  define apps_shutdown()
 #else
 #  ifndef OPENSSL_NO_ENGINE
+#    ifdef OPENSSL_NO_COMP
+#       define COMP_zlib_cleanup()
+#    endif
+
 #    define apps_startup() \
                        do { do_pipe_sig(); CRYPTO_malloc_init(); \
                        ERR_load_crypto_strings(); 
OpenSSL_add_all_algorithms(); \
diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c
index a71311e..20cde4f 100755
--- a/ssl/s23_clnt.c
+++ b/ssl/s23_clnt.c
@@ -269,11 +269,14 @@ static int ssl23_client_hello(SSL *s)
        {
        unsigned char *buf;
        unsigned char *p,*d;
-       int i,j,ch_len;
+       int i,ch_len;
        unsigned long Time,l;
        int ssl2_compat;
        int version = 0, version_major, version_minor;
+#ifndef OPENSSL_NO_COMP
+       int j;
        SSL_COMP *comp;
+#endif
        int ret;
 
        ssl2_compat = (s->options & SSL_OP_NO_SSLv2) ? 0 : 1;
diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c
index 6cad971..6556b79 100755
--- a/ssl/ssl_asn1.c
+++ b/ssl/ssl_asn1.c
@@ -120,13 +120,14 @@ int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp)
        {
 #define LSIZE2 (sizeof(long)*2)
        int v1=0,v2=0,v3=0,v4=0,v5=0,v7=0,v8=0;
-       unsigned char buf[4],ibuf1[LSIZE2],ibuf2[LSIZE2], cbuf;
+       unsigned char buf[4],ibuf1[LSIZE2],ibuf2[LSIZE2];
        unsigned char ibuf3[LSIZE2],ibuf4[LSIZE2],ibuf5[LSIZE2];
 #ifndef OPENSSL_NO_TLSEXT
        int v6=0,v9=0,v10=0;
        unsigned char ibuf6[LSIZE2];
 #endif
 #ifndef OPENSSL_NO_COMP
+       unsigned char cbuf;
        int v11=0;
 #endif
        long l;

Attachment: pgp4uX7Z2NrnC.pgp
Description: PGP signature

Reply via email to