From: Nikos Mavrogiannopoulos Date: Tue, 27 Jan 2009 20:57:22 +0000 (+0200) Subject: gnutls_handshake when sending client hello during a X-Git-Tag: gnutls_2_7_5~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c69e7bd49ea2dfd61f214a00a3f4636465952ff;p=thirdparty%2Fgnutls.git gnutls_handshake when sending client hello during a rehandshake, will not offer a version number larger than the current. Reported by Tristan Hill . --- diff --git a/NEWS b/NEWS index f40dd013ad..a78281d119 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,13 @@ See the end for copying conditions. * Version 2.7.5 (unreleased) +** libgnutls: result_size in gnutls_hex_encode now holds +the size of the result. Report by John Brooks . + +** libgnutls: gnutls_handshake when sending client hello during a +rehandshake, will not offer a version number larger than the current. +Reported by Tristan Hill . + ** libgnutls: Permit V1 Certificate Authorities properly. Before they were mistakenly rejected even though GNUTLS_VERIFY_ALLOW_ANY_X509_V1_CA_CRT and/or diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index 58880ca610..8086af1e76 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -1705,12 +1705,16 @@ _gnutls_send_client_hello (gnutls_session_t session, int again) opaque rnd[GNUTLS_RANDOM_SIZE]; gnutls_protocol_t hver; opaque extdata[MAX_EXT_DATA_LENGTH]; + int rehandshake = 0; opaque *SessionID = session->internals.resumed_security_parameters.session_id; uint8_t session_id_len = session->internals.resumed_security_parameters.session_id_size; + if (session->security_parameters.session_id_size) + rehandshake = 1; + if (SessionID == NULL) session_id_len = 0; else if (session_id_len == 0) @@ -1734,7 +1738,12 @@ _gnutls_send_client_hello (gnutls_session_t session, int again) * version number to the previously established. */ if (SessionID == NULL) - hver = _gnutls_version_max (session); + { + if (rehandshake) /* already negotiated version thus version_max == negotiated version */ + hver = session->security_parameters.version; + else + hver = _gnutls_version_max (session); + } else { /* we are resuming a session */ hver = session->internals.resumed_security_parameters.version;