Added OPENSSL_NO_EC2M guards around the default EC curves
[openssl.git] / ssl / s23_clnt.c
index 5177f060c22f4b237648348b389cd7e6f6073089..56705c3010f4891cb964ea98b135a51f9c764c47 100644 (file)
@@ -125,9 +125,11 @@ static const SSL_METHOD *ssl23_get_client_method(int ver)
        if (ver == SSL2_VERSION)
                return(SSLv2_client_method());
 #endif
+#ifndef OPENSSL_NO_SSL3
        if (ver == SSL3_VERSION)
                return(SSLv3_client_method());
-       else if (ver == TLS1_VERSION)
+#endif
+       if (ver == TLS1_VERSION)
                return(TLSv1_client_method());
        else if (ver == TLS1_1_VERSION)
                return(TLSv1_1_client_method());
@@ -710,6 +712,7 @@ static int ssl23_get_server_hello(SSL *s)
                {
                /* we have sslv3 or tls1 (server hello or alert) */
 
+#ifndef OPENSSL_NO_SSL3
                if ((p[2] == SSL3_VERSION_MINOR) &&
                        !(s->options & SSL_OP_NO_SSLv3))
                        {
@@ -724,7 +727,9 @@ static int ssl23_get_server_hello(SSL *s)
                        s->version=SSL3_VERSION;
                        s->method=SSLv3_client_method();
                        }
-               else if ((p[2] == TLS1_VERSION_MINOR) &&
+               else
+#endif
+               if ((p[2] == TLS1_VERSION_MINOR) &&
                        !(s->options & SSL_OP_NO_TLSv1))
                        {
                        s->version=TLS1_VERSION;
@@ -748,6 +753,9 @@ static int ssl23_get_server_hello(SSL *s)
                        goto err;
                        }
 
+               /* ensure that TLS_MAX_VERSION is up-to-date */
+               OPENSSL_assert(s->version <= TLS_MAX_VERSION);
+
                if (p[0] == SSL3_RT_ALERT && p[5] != SSL3_AL_WARNING)
                        {
                        /* fatal alert */