diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-09-25 12:04:32 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-10-09 18:16:57 +0200 |
commit | b3f075e2636a11ac6bab8046a5d5f3ee622fe1f5 (patch) | |
tree | 3cb23ba558b999d4017e1b50a70d47fdc5e42ba5 | |
parent | d254d2f3595b1a5798283e96c9818fe61c22f2ce (diff) | |
download | gnutls-b3f075e2636a11ac6bab8046a5d5f3ee622fe1f5.tar.gz |
forbid heartbeat messages during a handshake
-rw-r--r-- | lib/ext/heartbeat.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 */ |