2004-02-18 Carlos Guzm��n ��lvarez <carlosga@telefonica.net>
[mono.git] / mcs / class / Mono.Security / Mono.Security.Protocol.Tls / TlsCipherSuite.cs
index 82135585648023f4a39b6c897c664469cc1e5677..2c2c7339b796befbd59c05dedf4911ed8ebc30ca 100644 (file)
@@ -1,5 +1,5 @@
 /* Transport Security Layer (TLS)
- * Copyright (c) 2003 Carlos Guzmán Álvarez
+ * Copyright (c) 2003-2004 Carlos Guzman Alvarez
  * 
  * Permission is hereby granted, free of charge, to any person 
  * obtaining a copy of this software and associated documentation 
@@ -35,7 +35,7 @@ namespace Mono.Security.Protocol.Tls
 {
        internal class TlsCipherSuite : CipherSuite
        {
-               #region CONSTRUCTORS
+               #region Constructors
                
                public TlsCipherSuite(
                        short code, string name, CipherAlgorithmType cipherAlgorithmType, 
@@ -51,7 +51,7 @@ namespace Mono.Security.Protocol.Tls
 
                #endregion
 
-               #region MAC_GENERATION_METHOD
+               #region MAC Generation Methods
 
                public override byte[] ComputeServerRecordMAC(TlsContentType contentType, byte[] fragment)
                {
@@ -60,7 +60,7 @@ namespace Mono.Security.Protocol.Tls
 
                        data.Write(this.Context.ReadSequenceNumber);
                        data.Write((byte)contentType);
-                       data.Write((short)this.Context.Protocol);
+                       data.Write(this.Context.Protocol);
                        data.Write((short)fragment.Length);
                        data.Write(fragment);
 
@@ -78,7 +78,7 @@ namespace Mono.Security.Protocol.Tls
 
                        data.Write(this.Context.WriteSequenceNumber);
                        data.Write((byte)contentType);
-                       data.Write((short)this.Context.Protocol);
+                       data.Write(this.Context.Protocol);
                        data.Write((short)fragment.Length);
                        data.Write(fragment);
 
@@ -91,7 +91,7 @@ namespace Mono.Security.Protocol.Tls
 
                #endregion
 
-               #region KEY_GENERATION_METODS
+               #region Key Generation Methods
 
                public override void ComputeMasterSecret(byte[] preMasterSecret)
                {
@@ -125,8 +125,8 @@ namespace Mono.Security.Protocol.Tls
                                }
                                else
                                {
-                                       this.Context.ClientWriteIV = new byte[0];
-                                       this.Context.ServerWriteIV = new byte[0];
+                                       this.Context.ClientWriteIV = CipherSuite.EmptyArray;
+                                       this.Context.ServerWriteIV = CipherSuite.EmptyArray;
                                }
                        }
                        else