summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-09-23 22:59:09 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-09-23 23:06:44 +0200
commit1d55a576b587fadb7576853c6999b35d2599762b (patch)
tree4a73836269c9dd6e5ce713b94d9ab35bbaacb880
parentbe59ade6bcdf4d3ea5e30cf14a2d0e2196e4682d (diff)
downloadgnutls-1d55a576b587fadb7576853c6999b35d2599762b.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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index b7f1c54b5d..cf3b32fc4d 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -2664,9 +2664,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); \