diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2010-01-13 19:08:45 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2010-01-13 19:08:45 +0000 |
commit | c3c3b288187162b8b3609876398e720e292169fd (patch) | |
tree | f92fb0162f80667a3cbaa8fc1995858a52316ec7 /ssl | |
parent | 06e2670a57f1d6588dfdd22a7f90ad9bf1d472f7 (diff) |
Fix version handling so it can cope with a major version >3.
Although it will be many years before TLS v2.0 or later appears old versions
of servers have a habit of hanging around for a considerable time so best
if we handle this properly now.
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/s23_srvr.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ssl/s23_srvr.c b/ssl/s23_srvr.c index 73b7e610e0..a3fc34d64a 100644 --- a/ssl/s23_srvr.c +++ b/ssl/s23_srvr.c @@ -315,7 +315,7 @@ int ssl23_get_client_hello(SSL *s) (p[1] == SSL3_VERSION_MAJOR) && (p[5] == SSL3_MT_CLIENT_HELLO) && ((p[3] == 0 && p[4] < 5 /* silly record length? */) - || (p[9] == p[1]))) + || (p[9] >= p[1]))) { /* * SSLv3 or tls1 header @@ -339,6 +339,13 @@ int ssl23_get_client_hello(SSL *s) v[1] = TLS1_VERSION_MINOR; #endif } + /* if major version number > 3 set minor to a value + * which will use the highest version 3 we support. + * If TLS 2.0 ever appears we will need to revise + * this.... + */ + else if (p[9] > SSL3_VERSION_MAJOR) + v[1]=0xff; else v[1]=p[10]; /* minor version according to client_version */ if (v[1] >= TLS1_VERSION_MINOR) |