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

- Added changes to security properties for check that the handshake is finished.

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

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 d4307ac97a0e307f221527ffa30a7cbd624546a1..19d18f4992b6f0263c46ad1bcaa4528ec927f447 100644 (file)
@@ -1,5 +1,9 @@
 2004-02-17 Carlos Guzmán Álvarez  <carlosga@telefonica.net>
 
+       * Mono.Security.Protocol.Tls/SslClientStream.cs:
+
+               - Added changes to security properties for check that the handshake is finished.
+
        * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs:
 
                - Raise the Client Certificate event.
index d99ed4d645981b607625f8b64abdc0d710fb3298..def1b6b6d028dbf821828cf7fbdc3215f2a59791 100644 (file)
@@ -1,5 +1,9 @@
 2004-02-17 Carlos Guzmán Álvarez  <carlosga@telefonica.net>
 
+       * Mono.Security.Protocol.Tls/SslClientStream.cs:
+
+               - Added changes to security properties for check that the handshake is finished.
+
        * Mono.Security.Protocol.Tls/SslClientStream.cs:
 
         - Added changes for bring async methods to work ( Thanks to Sebastien Pouliot )
index bd77f118e31ced96b1639110b1bc67916d3d473f..b2f4acaeb6f179dd230154ca3251fd00eec2c66e 100644 (file)
@@ -126,12 +126,28 @@ namespace Mono.Security.Protocol.Tls
 
                public CipherAlgorithmType CipherAlgorithm 
                {
-                       get { return this.context.Cipher.CipherAlgorithmType;}
+                       get 
+                       { 
+                               if (this.context.HandshakeFinished)
+                               {
+                                       return this.context.Cipher.CipherAlgorithmType;
+                               }
+
+                               return CipherAlgorithmType.None;
+                       }
                }
                
                public int CipherStrength 
                {
-                       get { return this.context.Cipher.EffectiveKeyBits;}
+                       get 
+                       { 
+                               if (this.context.HandshakeFinished)
+                               {
+                                       return this.context.Cipher.EffectiveKeyBits;
+                               }
+
+                               return 0;
+                       }
                }
                
                public X509CertificateCollection ClientCertificates 
@@ -141,25 +157,54 @@ namespace Mono.Security.Protocol.Tls
                
                public HashAlgorithmType HashAlgorithm 
                {
-                       get { return this.context.Cipher.HashAlgorithmType; }
+                       get 
+                       { 
+                               if (this.context.HandshakeFinished)
+                               {
+                                       return this.context.Cipher.HashAlgorithmType; 
+                               }
+
+                               return HashAlgorithmType.None;
+                       }
                }
                
                public int HashStrength
                {
-                       get { return this.context.Cipher.HashSize * 8; }
+                       get 
+                       { 
+                               if (this.context.HandshakeFinished)
+                               {
+                                       return this.context.Cipher.HashSize * 8; 
+                               }
+
+                               return 0;
+                       }
                }
                
                public int KeyExchangeStrength 
                {
                        get 
                        { 
-                               return this.context.ServerSettings.Certificates[0].RSA.KeySize;
+                               if (this.context.HandshakeFinished)
+                               {
+                                       return this.context.ServerSettings.Certificates[0].RSA.KeySize;
+                               }
+
+                               return 0;
                        }
                }
                
                public ExchangeAlgorithmType KeyExchangeAlgorithm 
                {
-                       get { return this.context.Cipher.ExchangeAlgorithmType; }
+                       get 
+                       { 
+                               if (this.context.HandshakeFinished)
+                               {
+                                       return this.context.Cipher.ExchangeAlgorithmType; 
+                               }
+
+                               return ExchangeAlgorithmType.None;
+                       }
                }
                
                public SecurityProtocolType SecurityProtocol