aboutsummaryrefslogtreecommitdiff
path: root/openssl/ssl/s23_srvr.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-10-19 11:34:57 +0200
committermarha <marha@users.sourceforge.net>2014-10-19 11:34:57 +0200
commit8cd093f61168a373d919c68e0ce4e04949fa4eb6 (patch)
treed1bc1dd33da84a22d6ab30aa9f7efb79b592ffda /openssl/ssl/s23_srvr.c
parent9fc852414dd4e841c4e2229f55a3e41abca64ac5 (diff)
parenta14858a22f164b5accc4bd192a5d3de21d88e3d1 (diff)
downloadvcxsrv-8cd093f61168a373d919c68e0ce4e04949fa4eb6.tar.gz
vcxsrv-8cd093f61168a373d919c68e0ce4e04949fa4eb6.tar.bz2
vcxsrv-8cd093f61168a373d919c68e0ce4e04949fa4eb6.zip
Merge remote-tracking branch 'origin/released'
Conflicts: openssl/Makefile openssl/crypto/opensslconf.h
Diffstat (limited to 'openssl/ssl/s23_srvr.c')
-rw-r--r--openssl/ssl/s23_srvr.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/openssl/ssl/s23_srvr.c b/openssl/ssl/s23_srvr.c
index 2901a6bd0..93ca7d53c 100644
--- a/openssl/ssl/s23_srvr.c
+++ b/openssl/ssl/s23_srvr.c
@@ -127,9 +127,11 @@ static const 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 if (ver == TLS1_1_VERSION)
return(TLSv1_1_server_method());
@@ -421,6 +423,9 @@ int ssl23_get_client_hello(SSL *s)
}
}
+ /* ensure that TLS_MAX_VERSION is up-to-date */
+ OPENSSL_assert(s->version <= TLS_MAX_VERSION);
+
#ifdef OPENSSL_FIPS
if (FIPS_mode() && (s->version < TLS1_VERSION))
{
@@ -597,6 +602,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;
@@ -624,14 +635,6 @@ int ssl23_get_client_hello(SSL *s)
s->s3->rbuf.left=0;
s->s3->rbuf.offset=0;
}
- if (s->version == TLS1_2_VERSION)
- s->method = TLSv1_2_server_method();
- else if (s->version == TLS1_1_VERSION)
- s->method = TLSv1_1_server_method();
- else 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