From: Sjoerd Simons Date: Wed, 11 Aug 2010 12:48:26 +0000 (+0100) Subject: Check whether the error is fatal in more cases X-Git-Tag: gnutls_2_11_3~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a539ad961affeffee32cb6148f421c8e66ab693;p=thirdparty%2Fgnutls.git Check whether the error is fatal in more cases When stressing the async API of gnutls a lot of internal errors are hit as IMED_RET clears the handshake hash buffers as a result of -EAGAIN even though it would never be re-initialized at that point, but is still needed in later stages. Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index 8d51ac42c2..c0b2c64b30 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -2670,7 +2670,7 @@ _gnutls_handshake_client (gnutls_session_t session) case STATE1: ret = _gnutls_send_hello (session, AGAIN (STATE1)); STATE = STATE1; - IMED_RET ("send hello", ret, 0); + IMED_RET ("send hello", ret, 1); case STATE2: /* receive the server hello */ @@ -2750,7 +2750,7 @@ _gnutls_handshake_client (gnutls_session_t session) ret = _gnutls_send_client_certificate_verify (session, AGAIN (STATE9)); STATE = STATE9; - IMED_RET ("send client certificate verify", ret, 0); + IMED_RET ("send client certificate verify", ret, 1); STATE = STATE0; default: @@ -2915,7 +2915,7 @@ _gnutls_handshake_server (gnutls_session_t session) case STATE2: ret = _gnutls_send_hello (session, AGAIN (STATE2)); STATE = STATE2; - IMED_RET ("send hello", ret, 0); + IMED_RET ("send hello", ret, 1); case STATE70: if (session->security_parameters.do_send_supplemental) @@ -2957,7 +2957,7 @@ _gnutls_handshake_server (gnutls_session_t session) GNUTLS_HANDSHAKE_SERVER_HELLO_DONE, AGAIN (STATE6)); STATE = STATE6; - IMED_RET ("send server hello done", ret, 0); + IMED_RET ("send server hello done", ret, 1); case STATE71: if (session->security_parameters.do_recv_supplemental) @@ -3028,7 +3028,7 @@ _gnutls_handshake_common (gnutls_session_t session) #endif ret = _gnutls_send_handshake_final (session, FALSE); - IMED_RET ("send handshake final", ret, 0); + IMED_RET ("send handshake final", ret, 1); /* only store if we are not resuming */ if (session->security_parameters.entity == GNUTLS_SERVER) @@ -3041,7 +3041,7 @@ _gnutls_handshake_common (gnutls_session_t session) { /* if we are a client not resuming - or we are a server resuming */ ret = _gnutls_send_handshake_final (session, TRUE); - IMED_RET ("send handshake final 2", ret, 0); + IMED_RET ("send handshake final 2", ret, 1); #ifdef ENABLE_SESSION_TICKET switch (STATE)