Avoid warnings on VC++ 2005.
[openssl.git] / ssl / s23_clnt.c
index 8bac26c5ac10dc33f9bc6d8ca0a9f2345d895dfb..1d1110b6f0259f86610b25eea81cf6d3a55bd841 100644 (file)
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 
-static SSL_METHOD *ssl23_get_client_method(int ver);
+static const SSL_METHOD *ssl23_get_client_method(int ver);
 static int ssl23_client_hello(SSL *s);
 static int ssl23_get_server_hello(SSL *s);
-static SSL_METHOD *ssl23_get_client_method(int ver)
+static const SSL_METHOD *ssl23_get_client_method(int ver)
        {
 #ifndef OPENSSL_NO_SSL2
        if (ver == SSL2_VERSION)
@@ -88,7 +88,7 @@ IMPLEMENT_ssl23_meth_func(SSLv23_client_method,
 int ssl23_connect(SSL *s)
        {
        BUF_MEM *buf=NULL;
-       unsigned long Time=time(NULL);
+       unsigned long Time=(unsigned long)time(NULL);
        void (*cb)(const SSL *ssl,int type,int val)=NULL;
        int ret= -1;
        int new_state,state;
@@ -236,7 +236,7 @@ static int ssl23_client_hello(SSL *s)
 #endif
 
                p=s->s3->client_random;
-               Time=time(NULL);                        /* Time */
+               Time=(unsigned long)time(NULL);         /* Time */
                l2n(Time,p);
                if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4) <= 0)
                        return -1;
@@ -349,7 +349,8 @@ static int ssl23_client_hello(SSL *s)
                        p+=i;
 
                        /* COMPRESSION */
-                       if (s->ctx->comp_methods == NULL)
+                       if ((s->options & SSL_OP_NO_COMPRESSION)
+                                               || !s->ctx->comp_methods)
                                j=0;
                        else
                                j=sk_SSL_COMP_num(s->ctx->comp_methods);