summaryrefslogtreecommitdiffstats
path: root/ssl/s23_srvr.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2014-10-15 03:25:50 -0400
committerGeoff Thorpe <geoff@openssl.org>2014-10-15 08:46:57 -0400
commitcd332a07503bd9771595de87e768179f81715704 (patch)
treeeb97ec8ac78cb3f51009c3585e3297e3b89d0285 /ssl/s23_srvr.c
parent2ed80d14d7159de7b52c7720128459e8c24a94d5 (diff)
Fix no-ssl3 configuration option
CVE-2014-3568 Reviewed-by: Emilia Kasper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'ssl/s23_srvr.c')
-rw-r--r--ssl/s23_srvr.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/ssl/s23_srvr.c b/ssl/s23_srvr.c
index df08873159..3d0069baf3 100644
--- a/ssl/s23_srvr.c
+++ b/ssl/s23_srvr.c
@@ -124,9 +124,11 @@ static SSL_METHOD *ssl23_get_server_method(int ver)
if (ver == SSL2_VERSION)
return(SSLv2_server_method());
#endif
+#ifndef OPENSSL_NO_SSL3
if (ver == SSL3_VERSION)
return(SSLv3_server_method());
- else if (ver == TLS1_VERSION)
+#endif
+ if (ver == TLS1_VERSION)
return(TLSv1_server_method());
else
return(NULL);
@@ -557,6 +559,12 @@ int ssl23_get_client_hello(SSL *s)
if ((type == 2) || (type == 3))
{
/* we have SSLv3/TLSv1 (type 2: SSL2 style, type 3: SSL3/TLS style) */
+ s->method = ssl23_get_server_method(s->version);
+ if (s->method == NULL)
+ {
+ SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_UNSUPPORTED_PROTOCOL);
+ goto err;
+ }
if (!ssl_init_wbio_buffer(s,1)) goto err;
@@ -580,11 +588,6 @@ int ssl23_get_client_hello(SSL *s)
s->s3->rbuf.left=0;
s->s3->rbuf.offset=0;
}
-
- if (s->version == TLS1_VERSION)
- s->method = TLSv1_server_method();
- else
- s->method = SSLv3_server_method();
#if 0 /* ssl3_get_client_hello does this */
s->client_version=(v[0]<<8)|v[1];
#endif