use TLS1_get_version macro to check version so TLS v1.2 changes don't interfere with...
[openssl.git] / ssl / s3_srvr.c
index 9a2be88..74af5dc 100644 (file)
@@ -611,7 +611,7 @@ int ssl3_accept(SSL *s)
 #endif
                                s->init_num = 0;
                                }
-                       else if (s->version >= TLS1_2_VERSION)
+                       else if (TLS1_get_version(s) >= TLS1_2_VERSION)
                                {
                                s->state=SSL3_ST_SR_CERT_VRFY_A;
                                s->init_num=0;
@@ -1380,7 +1380,7 @@ int ssl3_get_client_hello(SSL *s)
                s->s3->tmp.new_cipher=s->session->cipher;
                }
 
-       if (s->version < TLS1_2_VERSION || !(s->verify_mode & SSL_VERIFY_PEER))
+       if (TLS1_get_version(s) < TLS1_2_VERSION || !(s->verify_mode & SSL_VERIFY_PEER))
                {
                if (!ssl3_digest_cached_records(s))
                        goto f_err;
@@ -1915,7 +1915,7 @@ int ssl3_send_server_key_exchange(SSL *s)
                         * and p points to the space at the end. */
 #ifndef OPENSSL_NO_RSA
                        if (pkey->type == EVP_PKEY_RSA
-                                       && s->version < TLS1_2_VERSION)
+                                       && TLS1_get_version(s) < TLS1_2_VERSION)
                                {
                                q=md_buf;
                                j=0;
@@ -1948,7 +1948,7 @@ int ssl3_send_server_key_exchange(SSL *s)
                                {
                                /* For TLS1.2 and later send signature
                                 * algorithm */
-                               if (s->version >= TLS1_2_VERSION)
+                               if (TLS1_get_version(s) >= TLS1_2_VERSION)
                                        {
                                        if (!tls12_get_sigandhash(p, pkey, md))
                                                {
@@ -1975,7 +1975,7 @@ int ssl3_send_server_key_exchange(SSL *s)
                                        }
                                s2n(i,p);
                                n+=i+2;
-                               if (s->version >= TLS1_2_VERSION)
+                               if (TLS1_get_version(s) >= TLS1_2_VERSION)
                                        n+= 2;
                                }
                        else
@@ -2031,7 +2031,7 @@ int ssl3_send_certificate_request(SSL *s)
                p+=n;
                n++;
 
-               if (s->version >= TLS1_2_VERSION)
+               if (TLS1_get_version(s) >= TLS1_2_VERSION)
                        {
                        nl = tls12_get_req_sig_algs(s, p + 2);
                        s2n(nl, p);
@@ -2964,7 +2964,7 @@ int ssl3_get_cert_verify(SSL *s)
                } 
        else 
                {       
-               if (s->version >= TLS1_2_VERSION)
+               if (TLS1_get_version(s) >= TLS1_2_VERSION)
                        {
                        int sigalg = tls12_get_sigid(pkey);
                        /* Should never happen */
@@ -3011,7 +3011,7 @@ fprintf(stderr, "USING TLSv1.2 HASH %s\n", EVP_MD_name(md));
                goto f_err;
                }
 
-       if (s->version >= TLS1_2_VERSION)
+       if (TLS1_get_version(s) >= TLS1_2_VERSION)
                {
                long hdatalen = 0;
                void *hdata;