[pgsqlclient-checkins] pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls Alert.c
Status: Inactive
Brought to you by:
carlosga_fb
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-26 09:18:54
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26547 Modified Files: Alert.cs CipherSuite.cs CipherSuiteCollection.cs ClientRecordProtocol.cs Context.cs RecordProtocol.cs SecurityCompressionType.cs ServerRecordProtocol.cs SslServerStream.cs TlsClientSettings.cs Log Message: 2004-04-26 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/Alert.cs: * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/CipherSuiteCollection.cs: * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: * Mono.Security.Protocol.Tls/Context.cs: * Mono.Security.Protocol.Tls/RecordProtocol.cs: * Mono.Security.Protocol.Tls/SecurityCompressionType.cs: * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: * Mono.Security.Protocol.Tls/SslServerStream.cs: * Mono.Security.Protocol.Tls/TlsClientSettings.cs: - Changes for fix FxCop Rules. Index: Alert.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/Alert.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Alert.cs 10 Apr 2004 21:44:02 -0000 1.3 --- Alert.cs 26 Apr 2004 09:18:45 -0000 1.4 *************** *** 98,105 **** --- 98,107 ---- } + /* public bool IsFatal { get { return this.level == AlertLevel.Fatal ? true : false; } } + */ public bool IsCloseNotify Index: SslServerStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SslServerStream.cs 10 Apr 2004 11:16:24 -0000 1.11 --- SslServerStream.cs 26 Apr 2004 09:18:45 -0000 1.12 *************** *** 719,723 **** #region Event Methods ! internal virtual bool RaiseClientCertificateValidation( X509Certificate certificate, int[] certificateErrors) --- 719,723 ---- #region Event Methods ! internal bool RaiseClientCertificateValidation( X509Certificate certificate, int[] certificateErrors) Index: RecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** RecordProtocol.cs 21 Apr 2004 12:49:17 -0000 1.16 --- RecordProtocol.cs 26 Apr 2004 09:18:45 -0000 1.17 *************** *** 43,52 **** #region Properties - public Stream InnerStream - { - get { return this.innerStream; } - set { this.innerStream = value; } - } - public Context Context { --- 43,46 ---- Index: Context.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/Context.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Context.cs 21 Apr 2004 12:49:17 -0000 1.9 --- Context.cs 26 Apr 2004 09:18:45 -0000 1.10 *************** *** 178,182 **** { get { return this.serverSettings; } - set { this.serverSettings = value; } } --- 178,181 ---- *************** *** 184,188 **** { get { return this.clientSettings; } - set { this.clientSettings = value; } } --- 183,186 ---- Index: CipherSuiteCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CipherSuiteCollection.cs 10 Apr 2004 21:44:02 -0000 1.3 --- CipherSuiteCollection.cs 26 Apr 2004 09:18:45 -0000 1.4 *************** *** 30,59 **** namespace Mono.Security.Protocol.Tls { ! internal sealed class CipherSuiteCollection : ArrayList { #region Fields ! private SecurityProtocolType protocol; #endregion ! #region Properties public CipherSuite this[string name] { ! get { return (CipherSuite)this[IndexOf(name)]; } ! set { this[IndexOf(name)] = (CipherSuite)value; } } public CipherSuite this[short code] { ! get { return (CipherSuite)base[IndexOf(code)]; } ! set { base[IndexOf(code)] = (CipherSuite)value; } } ! public new CipherSuite this[int code] { ! get { return (CipherSuite)base[code]; } ! set { base[code] = (CipherSuite)value; } } --- 30,99 ---- namespace Mono.Security.Protocol.Tls { ! internal sealed class CipherSuiteCollection : ICollection, IList, IEnumerable { #region Fields ! private ArrayList cipherSuites; ! private SecurityProtocolType protocol; #endregion ! #region Indexers public CipherSuite this[string name] { ! get { return (CipherSuite)this.cipherSuites[this.IndexOf(name)]; } ! set { this.cipherSuites[this.IndexOf(name)] = (CipherSuite)value; } ! } ! ! public CipherSuite this[int index] ! { ! get { return (CipherSuite)this.cipherSuites[index]; } ! set { this.cipherSuites[index] = (CipherSuite)value; } } public CipherSuite this[short code] { ! get { return (CipherSuite)this.cipherSuites[this.IndexOf(code)]; } ! set { this.cipherSuites[this.IndexOf(code)] = (CipherSuite)value; } } ! object IList.this[int index] { ! get { return this[index]; } ! set { this[index] = (CipherSuite)value; } ! } ! ! #endregion ! ! #region ICollection Properties ! ! bool ICollection.IsSynchronized ! { ! get { return this.cipherSuites.IsSynchronized; } ! } ! ! object ICollection.SyncRoot ! { ! get { return this.cipherSuites.SyncRoot; } ! } ! ! public int Count ! { ! get { return this.cipherSuites.Count; } ! } ! ! #endregion ! ! #region IList Properties ! ! public bool IsFixedSize ! { ! get { return this.cipherSuites.IsFixedSize; } ! } ! ! public bool IsReadOnly ! { ! get { return this.cipherSuites.IsReadOnly; } } *************** *** 64,86 **** public CipherSuiteCollection(SecurityProtocolType protocol) : base() { ! this.protocol = protocol; } #endregion ! #region Methods ! ! public bool Contains(string name) { ! return (-1 != this.IndexOf(name)); } public int IndexOf(string name) { int index = 0; ! foreach (CipherSuite suite in this) { ! if (this.cultureAwareCompare(suite.Name, name)) { return index; --- 104,150 ---- public CipherSuiteCollection(SecurityProtocolType protocol) : base() { ! this.protocol = protocol; ! this.cipherSuites = new ArrayList(); } #endregion ! #region ICollection Methods ! ! public void CopyTo(Array array, int index) { ! this.cipherSuites.CopyTo(array, index); } + #endregion + + #region IEnumerable Methods + + IEnumerator IEnumerable.GetEnumerator() + { + return this.cipherSuites.GetEnumerator(); + } + + #endregion + + #region IList Methods + + public void Clear() + { + this.cipherSuites.Clear(); + } + + bool IList.Contains(object value) + { + return this.cipherSuites.Contains(value as CipherSuite); + } + public int IndexOf(string name) { int index = 0; ! foreach (CipherSuite cipherSuite in this.cipherSuites) { ! if (this.cultureAwareCompare(cipherSuite.Name, name)) { return index; *************** *** 96,102 **** int index = 0; ! foreach (CipherSuite suite in this) { ! if (suite.Code == code) { return index; --- 160,166 ---- int index = 0; ! foreach (CipherSuite cipherSuite in this.cipherSuites) { ! if (cipherSuite.Code == code) { return index; *************** *** 108,114 **** } ! public void RemoveAt(string errorMessage) { ! this.RemoveAt(this.IndexOf(errorMessage)); } --- 172,193 ---- } ! int IList.IndexOf(object value) { ! return this.cipherSuites.IndexOf(value as CipherSuite); ! } ! ! void IList.Insert(int index, object value) ! { ! this.cipherSuites.Insert(index, value as CipherSuite); ! } ! ! void IList.Remove(object value) ! { ! this.cipherSuites.Remove(value as CipherSuite); ! } ! ! void IList.RemoveAt(int index) ! { ! this.cipherSuites.RemoveAt(index); } *************** *** 145,149 **** private TlsCipherSuite add(TlsCipherSuite cipherSuite) { ! base.Add(cipherSuite); return cipherSuite; --- 224,228 ---- private TlsCipherSuite add(TlsCipherSuite cipherSuite) { ! this.cipherSuites.Add(cipherSuite); return cipherSuite; *************** *** 152,160 **** private SslCipherSuite add(SslCipherSuite cipherSuite) { ! base.Add(cipherSuite); return cipherSuite; } private bool cultureAwareCompare(string strA, string strB) { --- 231,244 ---- private SslCipherSuite add(SslCipherSuite cipherSuite) { ! this.cipherSuites.Add(cipherSuite); return cipherSuite; } + int IList.Add(object value) + { + return this.cipherSuites.Add(value as CipherSuite); + } + private bool cultureAwareCompare(string strA, string strB) { Index: CipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CipherSuite.cs 19 Mar 2004 22:44:47 -0000 1.12 --- CipherSuite.cs 26 Apr 2004 09:18:45 -0000 1.13 *************** *** 190,197 **** --- 190,199 ---- } + /* public byte BlockSize { get { return this.blockSize; } } + */ public Context Context *************** *** 255,258 **** --- 257,261 ---- } + /* public void UpdateServerCipherIV(byte[] iv) { *************** *** 266,269 **** --- 269,273 ---- } } + */ public byte[] EncryptRecord(byte[] fragment, byte[] mac) Index: ServerRecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ServerRecordProtocol.cs 10 Apr 2004 11:16:24 -0000 1.5 --- ServerRecordProtocol.cs 26 Apr 2004 09:18:45 -0000 1.6 *************** *** 24,27 **** --- 24,28 ---- using System; + using System.Globalization; using System.IO; *************** *** 87,90 **** --- 88,92 ---- // Create and process the server message message = this.createClientHandshakeMessage(handshakeType, data); + message.Process(); // Update the last handshake message *************** *** 125,129 **** throw new TlsException( AlertDescription.UnexpectedMessage, ! String.Format("Unknown server handshake message received ({0})", type.ToString())); } } --- 127,133 ---- throw new TlsException( AlertDescription.UnexpectedMessage, ! String.Format(CultureInfo.CurrentUICulture, ! "Unknown server handshake message received ({0})", ! type.ToString())); } } Index: SecurityCompressionType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SecurityCompressionType.cs 10 Feb 2004 09:43:42 -0000 1.1 --- SecurityCompressionType.cs 26 Apr 2004 09:18:45 -0000 1.2 *************** *** 30,34 **** // can be found in: // draft-ietf-tls-compression-05.txt (http://www.ietf.org/internet-drafts/draft-ietf-tls-compression-05.txt) ! public enum SecurityCompressionType : byte { None = 0, --- 30,34 ---- // can be found in: // draft-ietf-tls-compression-05.txt (http://www.ietf.org/internet-drafts/draft-ietf-tls-compression-05.txt) ! public enum SecurityCompressionType { None = 0, Index: ClientRecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ClientRecordProtocol.cs 21 Apr 2004 12:49:06 -0000 1.8 --- ClientRecordProtocol.cs 26 Apr 2004 09:18:45 -0000 1.9 *************** *** 24,27 **** --- 24,28 ---- using System; + using System.Globalization; using System.IO; *************** *** 88,91 **** --- 89,93 ---- // Create and process the server message message = this.createServerHandshakeMessage(handshakeType, data); + message.Process(); // Update the last handshake message *************** *** 168,172 **** throw new TlsException( AlertDescription.UnexpectedMessage, ! String.Format("Unknown server handshake message received ({0})", type.ToString())); } } --- 170,176 ---- throw new TlsException( AlertDescription.UnexpectedMessage, ! String.Format(CultureInfo.CurrentUICulture, ! "Unknown server handshake message received ({0})", ! type.ToString())); } } Index: TlsClientSettings.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsClientSettings.cs 9 Apr 2004 08:42:21 -0000 1.2 --- TlsClientSettings.cs 26 Apr 2004 09:18:45 -0000 1.3 *************** *** 56,72 **** set { this.certificates = value; } } - - public SecurityCompressionType CompressionMethod - { - get { return this.compressionMethod; } - set - { - if (value != SecurityCompressionType.None) - { - throw new NotSupportedException("Specified compression method is not supported"); - } - this.compressionMethod = value; - } - } public X509Certificate ClientCertificate --- 56,59 ---- *************** *** 85,88 **** --- 72,90 ---- } + /* + public SecurityCompressionType CompressionMethod + { + get { return this.compressionMethod; } + set + { + if (value != SecurityCompressionType.None) + { + throw new NotSupportedException("Specified compression method is not supported"); + } + this.compressionMethod = value; + } + } + */ + #endregion |