From: Nikos Mavrogiannopoulos Date: Sun, 26 Feb 2012 11:25:16 +0000 (+0100) Subject: If a client hello is received immediately after a completed handshake delete the... X-Git-Tag: gnutls_3_0_15~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a1d17bd9f742005d92a7ae0277b29576b57ff07;p=thirdparty%2Fgnutls.git If a client hello is received immediately after a completed handshake delete the async_timer to rehandshake. --- diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c index 8bf608bbaf..216737c264 100644 --- a/lib/gnutls_record.c +++ b/lib/gnutls_record.c @@ -690,13 +690,22 @@ record_add_to_buffers (gnutls_session_t session, if (_dtls_is_async(session) && _dtls_async_timer_active(session)) { - ret = _dtls_retransmit(session); - if (ret == 0) + if (session->security_parameters.entity == GNUTLS_SERVER && + bufel->htype == GNUTLS_HANDSHAKE_CLIENT_HELLO) { - ret = gnutls_assert_val(GNUTLS_E_AGAIN); - goto unexpected_packet; + /* client requested rehandshake. Delete the timer */ + _dtls_async_timer_delete(session); + } + else + { + ret = _dtls_retransmit(session); + if (ret == 0) + { + ret = gnutls_assert_val(GNUTLS_E_AGAIN); + goto unexpected_packet; + } + goto cleanup; } - goto cleanup; } }