diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-03-26 13:53:15 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-03-26 13:53:15 +0000 |
commit | b9900cafbb170fabab61a21b0eeb3422a75cad63 (patch) | |
tree | 7a3e159d40485f6ab567affcb6834a2c85a74eeb | |
parent | ce66a574ff9bb7869b083ccea2adca1a1fd611b7 (diff) | |
download | gnutls-b9900cafbb170fabab61a21b0eeb3422a75cad63.tar.gz |
Some improvements in the version detection in the client hello.
-rw-r--r-- | lib/gnutls_algorithms.c | 1 | ||||
-rw-r--r-- | lib/gnutls_handshake.c | 7 | ||||
-rw-r--r-- | lib/gnutls_v2_compat.c | 8 |
3 files changed, 2 insertions, 14 deletions
diff --git a/lib/gnutls_algorithms.c b/lib/gnutls_algorithms.c index ba37edb195..0b31d7f620 100644 --- a/lib/gnutls_algorithms.c +++ b/lib/gnutls_algorithms.c @@ -105,7 +105,6 @@ typedef struct { static const gnutls_version_entry sup_versions[] = { {"SSL 3.0", GNUTLS_SSL3, 3, 0, 1}, {"TLS 1.0", GNUTLS_TLS1, 3, 1, 1}, - {"UNKNOWN", GNUTLS_VERSION_UNKNOWN, 0, 0, 1}, {0, 0, 0, 0, 0} }; diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index 863d961805..12cdf8648b 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -271,13 +271,6 @@ int _gnutls_read_client_hello(gnutls_session session, opaque * data, ver = version; } - /* he should have send us the highest version - * he supports. - */ - if (ver == GNUTLS_VERSION_UNKNOWN || ver > version) { - gnutls_assert(); - return GNUTLS_E_UNSUPPORTED_VERSION_PACKET; - } _gnutls_set_current_version(session, ver); /* Read client random value. diff --git a/lib/gnutls_v2_compat.c b/lib/gnutls_v2_compat.c index e8ac10e8b3..48ec1ae9e1 100644 --- a/lib/gnutls_v2_compat.c +++ b/lib/gnutls_v2_compat.c @@ -101,18 +101,14 @@ int _gnutls_read_client_hello_v2(gnutls_session session, opaque * data, version = _gnutls_version_get(data[pos], data[pos + 1]); - /* if we do not support that version */ + /* if we do not support that version + */ if (_gnutls_version_is_supported(session, version) == 0) { ver = _gnutls_version_lowest( session); } else { ver = version; } - if (ver==GNUTLS_VERSION_UNKNOWN || ver > version) { - gnutls_assert(); - return GNUTLS_E_UNSUPPORTED_VERSION_PACKET; - } - _gnutls_set_current_version(session, ver); pos += 2; |