summary refs log tree commit diff
path: root/crypto/src/tls/TlsProtocol.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-07-26 14:32:32 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-07-26 14:32:32 +0700
commit0bb833034be24db92d87d5264c5154698924ae25 (patch)
treed4546f2f7d060859c3040aa611ed5dfee25882ad /crypto/src/tls/TlsProtocol.cs
parentTLS 1.3 client API for external PSKs (diff)
downloadBouncyCastle.NET-ed25519-0bb833034be24db92d87d5264c5154698924ae25.tar.xz
Initial fix for reneg issue
- see https://github.com/bcgit/bc-java/issues/990
Diffstat (limited to '')
-rw-r--r--crypto/src/tls/TlsProtocol.cs17
1 files changed, 15 insertions, 2 deletions
diff --git a/crypto/src/tls/TlsProtocol.cs b/crypto/src/tls/TlsProtocol.cs
index 317b6b193..044fca42d 100644
--- a/crypto/src/tls/TlsProtocol.cs
+++ b/crypto/src/tls/TlsProtocol.cs
@@ -401,7 +401,7 @@ namespace Org.BouncyCastle.Tls
                 AbstractTlsContext context = ContextAdmin;
                 SecurityParameters securityParameters = context.SecurityParameters;
 
-                if (m_appDataReady ||
+                if (!context.IsHandshaking ||
                     null == securityParameters.LocalVerifyData ||
                     null == securityParameters.PeerVerifyData)
                 {
@@ -1557,6 +1557,19 @@ namespace Org.BouncyCastle.Tls
             get { return m_closed; }
         }
 
+        public virtual bool IsConnected
+        {
+            get
+            {
+                if (m_closed)
+                    return false;
+
+                AbstractTlsContext context = ContextAdmin;
+
+                return null != context && context.IsConnected;
+            }
+        }
+
         public virtual bool IsHandshaking
         {
             get
@@ -1566,7 +1579,7 @@ namespace Org.BouncyCastle.Tls
 
                 AbstractTlsContext context = ContextAdmin;
 
-                return null != context && !context.IsConnected;
+                return null != context && context.IsHandshaking;
             }
         }