]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
forbid heartbeat messages during a handshake
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 25 Sep 2014 10:04:32 +0000 (12:04 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 9 Oct 2014 16:15:29 +0000 (18:15 +0200)
lib/ext/heartbeat.c

index 82cba3f31b2f817bdd595c48444d7af43ef6c83b..c11aa8cdb5ea50c0599c3c4f273a235a128dff21 100644 (file)
@@ -77,6 +77,9 @@ int gnutls_heartbeat_allowed(gnutls_session_t session, unsigned int type)
 {
        extension_priv_data_t epriv;
 
+       if (session->internals.handshake_in_progress != 0)
+               return 0; /* not allowed */
+
        if (_gnutls_ext_get_session_data
            (session, GNUTLS_EXTENSION_HEARTBEAT, &epriv) < 0)
                return 0;       /* Not enabled */