[pgsqlclient-checkins] pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls SslClie
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2004-02-20 10:20:02
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10370 Modified Files: SslClientStream.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: SslClientStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SslClientStream.cs 19 Feb 2004 16:44:38 -0000 1.10 --- SslClientStream.cs 20 Feb 2004 10:08:51 -0000 1.11 *************** *** 205,209 **** public SecurityProtocolType SecurityProtocol { ! get { return this.context.SecurityProtocol; } } --- 205,217 ---- public SecurityProtocolType SecurityProtocol { ! get ! { ! if (this.context.HandshakeFinished) ! { ! return this.context.SecurityProtocol; ! } ! ! return 0; ! } } *************** *** 475,511 **** } ! // Check if we have space in the middle buffer ! // if not Read next TLS record and update the inputBuffer ! while ((this.inputBuffer.Length - this.inputBuffer.Position) < count) { ! // Read next record and write it into the inputBuffer ! long position = this.inputBuffer.Position; ! byte[] record = this.protocol.ReceiveRecord(); ! ! if (record != null && record.Length > 0) { ! // Write new data to the inputBuffer ! this.inputBuffer.Seek(0, SeekOrigin.End); ! this.inputBuffer.Write(record, 0, record.Length); ! // Restore buffer position ! this.inputBuffer.Seek(position, SeekOrigin.Begin); ! } ! else ! { ! if (record == null) { ! break; } - } ! // TODO: Review if we need to check the Length ! // property of the innerStream for other types ! // of streams, to check that there are data available ! // for read ! if (this.innerStream is NetworkStream && ! !((NetworkStream)this.innerStream).DataAvailable) ! { ! break; } } --- 483,522 ---- } ! if (!this.context.ConnectionEnd) { ! // Check if we have space in the middle buffer ! // if not Read next TLS record and update the inputBuffer ! while ((this.inputBuffer.Length - this.inputBuffer.Position) < count) { ! // Read next record and write it into the inputBuffer ! long position = this.inputBuffer.Position; ! byte[] record = this.protocol.ReceiveRecord(); ! ! if (record != null && record.Length > 0) ! { ! // Write new data to the inputBuffer ! this.inputBuffer.Seek(0, SeekOrigin.End); ! this.inputBuffer.Write(record, 0, record.Length); ! // Restore buffer position ! this.inputBuffer.Seek(position, SeekOrigin.Begin); ! } ! else { ! if (record == null) ! { ! break; ! } } ! // TODO: Review if we need to check the Length ! // property of the innerStream for other types ! // of streams, to check that there are data available ! // for read ! if (this.innerStream is NetworkStream && ! !((NetworkStream)this.innerStream).DataAvailable) ! { ! break; ! } } } *************** *** 586,590 **** try { - // Send the buffer as a TLS record byte[] record = this.protocol.EncodeRecord( --- 597,600 ---- *************** *** 789,793 **** } ! return false; } --- 799,803 ---- } ! return certificateErrors != null && certificateErrors.Length == 0 ? true : false; } |