aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_channel.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-12-30 17:53:05 +0000
committerlloyd <[email protected]>2011-12-30 17:53:05 +0000
commit8a4d079cd6219a27f3a9fe1fdac74bc27a6338d8 (patch)
tree9fef3a868e19a61ba62a726b1443f1dd4f391297 /src/tls/tls_channel.h
parent480adf560aedce4165cb5606701e3a5ff99dda41 (diff)
Prevent ping-ponging of close alerts by tracking both if a handshake
has been completed and if the connection has been definitely closed by a fatal alert or a close notify.
Diffstat (limited to 'src/tls/tls_channel.h')
-rw-r--r--src/tls/tls_channel.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tls/tls_channel.h b/src/tls/tls_channel.h
index 5f06181de..52036c78d 100644
--- a/src/tls/tls_channel.h
+++ b/src/tls/tls_channel.h
@@ -46,9 +46,14 @@ class BOTAN_DLL TLS_Channel
void alert(Alert_Level level, Alert_Type type);
/**
- * Is the connection active?
+ * Is the connection active for sending application data?
*/
- bool is_active() const { return active; }
+ bool is_active() const { return handshake_completed && !is_closed(); }
+
+ /**
+ * Has the connection been definitely closed
+ */
+ bool is_closed() const { return connection_closed; }
/**
* Attempt to renegotiate the session
@@ -115,7 +120,8 @@ class BOTAN_DLL TLS_Channel
Secure_Renegotiation_State secure_renegotiation;
- bool active;
+ bool handshake_completed;
+ bool connection_closed;
};
}