summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-07-21 17:07:32 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-07-21 17:07:32 +0700
commitc1f2778cf47353e046741d11bd2b383f775b142d (patch)
tree8182991c62194664d6b1962f880ea5f5b7b34096
parentFurther bzip2 perf. opts. (diff)
downloadBouncyCastle.NET-ed25519-c1f2778cf47353e046741d11bd2b383f775b142d.tar.xz
Simplify HandleClose
-rw-r--r--crypto/src/tls/TlsProtocol.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crypto/src/tls/TlsProtocol.cs b/crypto/src/tls/TlsProtocol.cs
index db30f6b40..317b6b193 100644
--- a/crypto/src/tls/TlsProtocol.cs
+++ b/crypto/src/tls/TlsProtocol.cs
@@ -259,18 +259,18 @@ namespace Org.BouncyCastle.Tls
             {
                 this.m_closed = true;
 
-                if (user_canceled && !m_appDataReady)
-                {
-                    RaiseAlertWarning(AlertDescription.user_canceled, "User canceled handshake");
-                }
-
-                RaiseAlertWarning(AlertDescription.close_notify, "Connection closed");
-
                 if (!m_appDataReady)
                 {
                     CleanupHandshake();
+
+                    if (user_canceled)
+                    {
+                        RaiseAlertWarning(AlertDescription.user_canceled, "User canceled handshake");
+                    }
                 }
 
+                RaiseAlertWarning(AlertDescription.close_notify, "Connection closed");
+
                 CloseConnection();
             }
         }