From: Nikos Mavrogiannopoulos Date: Thu, 25 Sep 2014 10:04:32 +0000 (+0200) Subject: forbid heartbeat messages during a handshake X-Git-Tag: gnutls_3_4_0~800 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f08fe3d4d0f94cf79f00c3fff2f6cca863d3294d;p=thirdparty%2Fgnutls.git forbid heartbeat messages during a handshake --- diff --git a/lib/ext/heartbeat.c b/lib/ext/heartbeat.c index 82cba3f31b..c11aa8cdb5 100644 --- a/lib/ext/heartbeat.c +++ b/lib/ext/heartbeat.c @@ -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 */