diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-09-23 22:59:09 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-09-23 23:12:47 +0200 |
commit | 0d07d8432d57805a8354ebd6c1e7829f3ab159cb (patch) | |
tree | b042e7481e616a4a03f3e1b32fe847daa5e825f2 | |
parent | 44e31d86e840c3fd70544230ce39bb263d5824e1 (diff) | |
download | gnutls-0d07d8432d57805a8354ebd6c1e7829f3ab159cb.tar.gz |
No longer use is_fatal() during handshake. Explicitely treat
EAGAIN and INTERRUPTED as non-fatal during handshake. If the check_fatal
flag is set then GNUTLS_E_WARNING_ALERT_RECEIVED could interrupt
a handshake as well.
-rw-r--r-- | lib/gnutls_handshake.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index 84e6773d98..2bf2e1b69f 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -2731,9 +2731,14 @@ gnutls_handshake (gnutls_session_t session) return 0; } + #define IMED_RET( str, ret, check_fatal) do { \ if (ret < 0) { \ - if (check_fatal != 0 && gnutls_error_is_fatal(ret)==0) return ret; \ + /* EAGAIN and INTERRUPTED are always non-fatal */ \ + if (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED) \ + return ret; \ + /* a warning alert might interrupt handshake */ \ + if (check_fatal != 0 && ret==GNUTLS_E_WARNING_ALERT_RECEIVED) return ret; \ gnutls_assert(); \ ERR( str, ret); \ _gnutls_handshake_hash_buffers_clear(session); \ |