Thread: [pgsqlclient-checkins] pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Alerts
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2004-02-20 10:19:40
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Alerts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10305 Modified Files: TlsAlert.cs Removed Files: TlsWarningAlertEventArgs.cs Log Message: 2004-02-20 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls.Alerts/TlsWarningEventAgrs.cs: - Removed no more needed file. * Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs: - Added 4 new properties: * Message * IsWarning * IsFatal * IsCloseNotify - Return always the same message when working in release mode (The authentication or decryption has failed.) * Mono.Security.Protocol.Tls/SslClientStream.cs: - Added control over the CloseNotify Alert to BeginRead method. - Return true in the server certificate validation method if there are no errors. Index: TlsAlert.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TlsAlert.cs 10 Feb 2004 09:44:20 -0000 1.1 --- TlsAlert.cs 20 Feb 2004 10:08:33 -0000 1.2 *************** *** 30,34 **** #region Enumerations ! public enum TlsAlertLevel : byte { Warning = 1, --- 30,35 ---- #region Enumerations ! [Serializable] ! internal enum TlsAlertLevel : byte { Warning = 1, *************** *** 36,40 **** } ! public enum TlsAlertDescription : byte { CloseNotify = 0, --- 37,42 ---- } ! [Serializable] ! internal enum TlsAlertDescription : byte { CloseNotify = 0, *************** *** 69,75 **** #region Fields ! private TlsContext context; ! private TlsAlertLevel level; ! private TlsAlertDescription description; #endregion --- 71,77 ---- #region Fields ! private TlsContext context; ! private TlsAlertLevel level; ! private TlsAlertDescription description; #endregion *************** *** 86,92 **** #region Constructors ! public TlsAlert(TlsContext context, ! TlsAlertLevel level, ! TlsAlertDescription description) : base() { this.context = context; --- 88,95 ---- #region Constructors ! public TlsAlert( ! TlsContext context, ! TlsAlertLevel level, ! TlsAlertDescription description) : base() { this.context = context; *************** *** 105,114 **** #endregion ! #region Constructors private void fill() { ! Write((byte)level); ! Write((byte)description); } --- 108,156 ---- #endregion ! #region Properties ! ! public string Message ! { ! get { return TlsAlert.GetAlertMessage(this.description); } ! } ! ! public bool IsWarning ! { ! get ! { ! return this.level == TlsAlertLevel.Warning ? true : false; ! } ! } ! ! public bool IsFatal ! { ! get ! { ! return this.level == TlsAlertLevel.Fatal ? true : false; ! } ! } ! ! public bool IsCloseNotify ! { ! get ! { ! if (this.IsWarning && ! this.description == TlsAlertDescription.CloseNotify) ! { ! return true; ! } ! ! return false; ! } ! } ! ! #endregion ! ! #region Private Methods private void fill() { ! this.Write((byte)level); ! this.Write((byte)description); } *************** *** 117,121 **** #region Static Methods ! internal static string GetAlertMessage(TlsAlertDescription description) { #if (DEBUG) --- 159,163 ---- #region Static Methods ! public static string GetAlertMessage(TlsAlertDescription description) { #if (DEBUG) *************** *** 195,272 **** } #else ! switch (description) ! { ! case TlsAlertDescription.AccessDenied: ! return "Invalid message."; ! ! case TlsAlertDescription.BadCertificate: ! return "Handshake failiure."; ! ! case TlsAlertDescription.BadRecordMAC: ! return "Cryptographic failiure."; ! ! case TlsAlertDescription.CertificateExpired: ! return "Handshake failiure."; ! ! case TlsAlertDescription.CertificateRevoked: ! return "Handshake failiure."; ! ! case TlsAlertDescription.CertificateUnknown: ! return "Handshake failiure."; ! ! case TlsAlertDescription.CloseNotify: ! return "Connection closed."; ! ! case TlsAlertDescription.DecodeError: ! return "Invalid message."; ! ! case TlsAlertDescription.DecompressionFailiure: ! return "Compression error."; ! ! case TlsAlertDescription.DecryptError: ! return "Cryptographic failiure."; ! ! case TlsAlertDescription.DecryptionFailed: ! return "Cryptographic failiure."; ! ! case TlsAlertDescription.ExportRestriction: ! return "Handshake failiure."; ! ! case TlsAlertDescription.HandshakeFailiure: ! return "Handshake failiure."; ! ! case TlsAlertDescription.IlegalParameter: ! return "Handshake failiure."; ! ! case TlsAlertDescription.InsuficientSecurity: ! return "Handshake failiure."; ! ! case TlsAlertDescription.InternalError: ! return "Fatal failiure."; ! ! case TlsAlertDescription.NoRenegotiation: ! return "Handshake failiure."; ! ! case TlsAlertDescription.ProtocolVersion: ! return "Handshake failiure."; ! ! case TlsAlertDescription.RecordOverflow: ! return "Incorrect message."; ! ! case TlsAlertDescription.UnexpectedMessage: ! return "Incorrect message."; ! ! case TlsAlertDescription.UnknownCA: ! return "Handshake failiure."; ! ! case TlsAlertDescription.UnsupportedCertificate: ! return "Handshake failiure."; ! ! case TlsAlertDescription.UserCancelled: ! return "Handshake cancelled by user."; ! ! default: ! return ""; ! } #endif } --- 237,241 ---- } #else ! return "The authentication or decryption has failed."; #endif } --- TlsWarningAlertEventArgs.cs DELETED --- |