]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Reset extensions_sent_size only at start of handshake
authorTim Kosse <tim.kosse@filezilla-project.org>
Fri, 15 Jan 2016 13:45:42 +0000 (14:45 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 30 May 2016 12:06:50 +0000 (14:06 +0200)
That is, do not reset it when completing it so that we can
use the negotiated extensions even after the handshake is
complete.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
lib/extensions.c
lib/handshake.c
lib/state.c

index 185fd14c73bf6ead682ecfe2fd43a856fc393eaf..905baf83281f40857089d5d91bfd8146650a0e63 100644 (file)
@@ -157,8 +157,9 @@ const char *gnutls_ext_get_name(unsigned int ext)
        return NULL;
 }
 
-/* Checks if the extension we just received is one of the 
- * requested ones. Otherwise it's a fatal error.
+/* Checks if the extension @type provided has been requested
+ * by us (in client side). In that case it returns zero, 
+ * otherwise a negative error value.
  */
 int
 _gnutls_extension_list_check(gnutls_session_t session, uint16_t type)
index 965698e3ca243e99f3a1a286b6b970d4a8f194f0..7dccae6030f83b1fc49d02e8d2eca1284f0d0185 100644 (file)
@@ -2563,6 +2563,7 @@ int gnutls_handshake(gnutls_session_t session)
                if (session->internals.priorities.protocol.algorithms == 0)
                        return gnutls_assert_val(GNUTLS_E_NO_PRIORITIES_WERE_SET);
 
+               session->internals.extensions_sent_size = 0;
                session->internals.handshake_in_progress = 1;
                session->internals.vc_status = -1;
                gettime(&session->internals.handshake_start_time);
index 652769506795b0f8928914d857f9ae4f3986d67a..f96f43319bd4756c5edecc3c3a6e6cfe630b58db 100644 (file)
@@ -274,8 +274,6 @@ inline static void deinit_internal_params(gnutls_session_t session)
  */
 static void _gnutls_handshake_internal_state_init(gnutls_session_t session)
 {
-       session->internals.extensions_sent_size = 0;
-
        /* by default no selected certificate */
        session->internals.adv_version_major = 0;
        session->internals.adv_version_minor = 0;
@@ -392,6 +390,8 @@ int gnutls_init(gnutls_session_t * session, unsigned int flags)
 
        _gnutls_handshake_internal_state_init(*session);
 
+       (*session)->internals.extensions_sent_size = 0;
+
        /* emulate old gnutls behavior for old applications that do not use the priority_*
         * functions.
         */