]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Check whether the error is fatal in more cases
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Wed, 11 Aug 2010 12:48:26 +0000 (13:48 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 17 Aug 2010 15:39:07 +0000 (17:39 +0200)
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 <nmav@gnutls.org>
lib/gnutls_handshake.c

index 8d51ac42c295dc55c9d5d3db37e9f4e96cd99363..c0b2c64b3068122435fc75648f539b7f4df9c06b 100644 (file)
@@ -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)