From: Nikos Mavrogiannopoulos Date: Sat, 8 Aug 2009 06:06:57 +0000 (+0300) Subject: Corrected case where handshake data were received during a session. It now stores... X-Git-Tag: gnutls_2_9_2~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c529f792e4c899080eb1f6e104c8552fa0770356;p=thirdparty%2Fgnutls.git Corrected case where handshake data were received during a session. It now stores them for future use by a gnutls_handshake(). Reported by Peter Hendrickson . --- diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index 1ad4f5209e..5ccd31746a 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -2259,7 +2259,9 @@ _gnutls_recv_supplemental (gnutls_session_t session) * then %GNUTLS_E_GOT_APPLICATION_DATA or * %GNUTLS_E_WARNING_ALERT_RECEIVED may be returned. Note that these * are non fatal errors, only in the specific case of a rehandshake. - * Their meaning is that the client rejected the rehandshake request. + * Their meaning is that the client rejected the rehandshake request or + * in the case of %GNUTLS_E_GOT_APPLICATION_DATA it might also mean that + * some data were pending. * * Returns: %GNUTLS_E_SUCCESS on success, otherwise an error. * diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c index 42869bec9e..62df871517 100644 --- a/lib/gnutls_record.c +++ b/lib/gnutls_record.c @@ -744,6 +744,12 @@ record_check_type (gnutls_session_t session, if (session->security_parameters.entity == GNUTLS_SERVER) { gnutls_assert (); + ret = _gnutls_record_buffer_put (recv_type, session, (void *) data, data_size); + if (ret < 0) + { + gnutls_assert(); + return ret; + } return GNUTLS_E_REHANDSHAKE; }