2004-02-17 Carlos Guzm��n ��lvarez <carlosga@telefonica.net>
authorCarlos Guzmán Álvarez <carlos@mono-cvs.ximian.com>
Tue, 17 Feb 2004 11:34:05 +0000 (11:34 -0000)
committerCarlos Guzmán Álvarez <carlos@mono-cvs.ximian.com>
Tue, 17 Feb 2004 11:34:05 +0000 (11:34 -0000)
  * Mono.Security.Protocol.Tls/SslClientStream.cs:

        - Fix for send the close notify alert in the Close method
        only if the Handshake is fully negotiated.

svn path=/trunk/mcs/; revision=23165

mcs/class/Mono.Security/ChangeLog
mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog
mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs

index 0ffb7def3d876cf6cf345b29c9ccfaf419bb40a0..e0d766a7700809b290fe0b8949934e9a9a55f9e6 100644 (file)
@@ -1,3 +1,10 @@
+2004-02-17 Carlos Guzmán Álvarez  <carlosga@telefonica.net>
+
+       * Mono.Security.Protocol.Tls/SslClientStream.cs:
+
+        - Fix for send the close notify alert in the Close method
+        only if the Handshake is fully negotiated.
+
 2004-02-16 Carlos Guzmán Álvarez  <carlosga@telefonica.net>
 
        * Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs:
index 036c23ee45b6287c8f6f7cbc2dfe6f05dbf5ea5e..83d74d20f9acfa094cba32a9cb67387d9dbf8496 100644 (file)
@@ -1,3 +1,11 @@
+2004-02-17 Carlos Guzmán Álvarez  <carlosga@telefonica.net>
+
+       * Mono.Security.Protocol.Tls/SslClientStream.cs:
+
+        - Fix for send the close notify alert in the Close method
+        only if the Handshake is fully negotiated.
+
+
 2004-02-16 Carlos Guzmán Álvarez  <carlosga@telefonica.net>
 
        * Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs:
index ed83826c4e62ee048876679b21198fd2a19313b9..9eb0ee74daff0472c9477e7b3ab8c7e286791531 100644 (file)
@@ -322,9 +322,12 @@ namespace Mono.Security.Protocol.Tls
                                {
                                        if (this.innerStream != null)
                                        {
-                                               // Write close notify
-                                               TlsCloseNotifyAlert alert = new TlsCloseNotifyAlert(this.context);
-                                               this.SendAlert(alert);
+                               if (this.context.HandshakeFinished)
+                        {
+                            // Write close notify
+                            TlsCloseNotifyAlert alert = new TlsCloseNotifyAlert(this.context);
+                            this.SendAlert(alert);
+                        }
 
                                                if (this.ownsStream)
                                                {
@@ -332,8 +335,8 @@ namespace Mono.Security.Protocol.Tls
                                                        this.innerStream.Close();
                                                }
                                        }
-                                       this.ownsStream                                         = false;
-                                       this.innerStream                                        = null;
+                                       this.ownsStream    = false;
+                                       this.innerStream   = null;
                                        if (this.ClientCertSelection != null)
                                        {
                                                this.ClientCertSelection -= this.clientCertSelectionDelegate;