[pgsqlclient-checkins] pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls CipherS
Status: Inactive
Brought to you by:
carlosga_fb
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31286 Modified Files: CipherSuite.cs ClientRecordProtocol.cs Context.cs RecordProtocol.cs ServerRecordProtocol.cs SslClientStream.cs Log Message: 2004-03-09 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/Ciphersuite.cs: - Added generation of the Server encryption algorithms. * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs: - Finished processing of the message contents. * Mono.Security.Protocol.Tls/RecordProtocol.cs: * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: - Added new ProcessChangeCipherSpec method. * Mono.Security.Protocol.Tls/Context.cs: - Added new PrintBuffer method ( for debug ). Index: CipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CipherSuite.cs 5 Mar 2004 23:21:55 -0000 1.7 --- CipherSuite.cs 9 Mar 2004 16:29:20 -0000 1.8 *************** *** 489,494 **** // Set the key and IV for the algorithm ! this.encryptionAlgorithm.Key = this.context.ClientWriteKey; ! this.encryptionAlgorithm.IV = this.context.ClientWriteIV; // Create encryption cipher --- 489,502 ---- // Set the key and IV for the algorithm ! if (this.context is ClientContext) ! { ! this.encryptionAlgorithm.Key = this.context.ClientWriteKey; ! this.encryptionAlgorithm.IV = this.context.ClientWriteIV; ! } ! else ! { ! this.encryptionAlgorithm.Key = this.context.ServerWriteKey; ! this.encryptionAlgorithm.IV = this.context.ServerWriteIV; ! } // Create encryption cipher *************** *** 496,502 **** // Create the HMAC algorithm for the client ! this.clientHMAC = new M.HMAC( ! this.HashAlgorithmName, ! this.context.ClientWriteMAC); } --- 504,519 ---- // Create the HMAC algorithm for the client ! if (this.context is ClientContext) ! { ! this.clientHMAC = new M.HMAC( ! this.HashAlgorithmName, ! this.context.ClientWriteMAC); ! } ! else ! { ! this.clientHMAC = new M.HMAC( ! this.HashAlgorithmName, ! this.context.ServerWriteMAC); ! } } *************** *** 538,543 **** // Set the key and IV for the algorithm ! this.decryptionAlgorithm.Key = this.context.ServerWriteKey; ! this.decryptionAlgorithm.IV = this.context.ServerWriteIV; // Create decryption cipher --- 555,568 ---- // Set the key and IV for the algorithm ! if (this.context is ClientContext) ! { ! this.decryptionAlgorithm.Key = this.context.ServerWriteKey; ! this.decryptionAlgorithm.IV = this.context.ServerWriteIV; ! } ! else ! { ! this.decryptionAlgorithm.Key = this.context.ClientWriteKey; ! this.decryptionAlgorithm.IV = this.context.ClientWriteIV; ! } // Create decryption cipher *************** *** 545,551 **** // Create the HMAC algorithm for the server ! this.serverHMAC = new M.HMAC( ! this.HashAlgorithmName, ! this.context.ServerWriteMAC); } --- 570,585 ---- // Create the HMAC algorithm for the server ! if (this.context is ClientContext) ! { ! this.serverHMAC = new M.HMAC( ! this.HashAlgorithmName, ! this.context.ServerWriteMAC); ! } ! else ! { ! this.serverHMAC = new M.HMAC( ! this.HashAlgorithmName, ! this.context.ClientWriteMAC); ! } } Index: ClientRecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ClientRecordProtocol.cs 5 Mar 2004 23:21:55 -0000 1.5 --- ClientRecordProtocol.cs 9 Mar 2004 16:29:21 -0000 1.6 *************** *** 64,67 **** --- 64,73 ---- #region Handshake Processing Methods + protected override void ProcessChangeCipherSpec() + { + // Reset sequence numbers + this.context.ReadSequenceNumber = 0; + } + protected override void ProcessHandshakeMessage(TlsStream handMsg) { Index: Context.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/Context.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Context.cs 5 Mar 2004 23:21:55 -0000 1.4 --- Context.cs 9 Mar 2004 16:29:21 -0000 1.5 *************** *** 400,403 **** --- 400,413 ---- } + public void PrintBuffer(string title, byte[] buffer) + { + Console.WriteLine("{0}\n", title); + for (int i = 0; i < buffer.Length; i++) + { + Console.Write(buffer[i].ToString("x2")); + } + Console.WriteLine("\n\n"); + } + #endregion Index: RecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RecordProtocol.cs 5 Mar 2004 23:21:55 -0000 1.7 --- RecordProtocol.cs 9 Mar 2004 16:29:21 -0000 1.8 *************** *** 71,74 **** --- 71,75 ---- public abstract void SendRecord(HandshakeType type); protected abstract void ProcessHandshakeMessage(TlsStream handMsg); + protected abstract void ProcessChangeCipherSpec(); #endregion *************** *** 144,149 **** case ContentType.ChangeCipherSpec: ! // Reset sequence numbers ! this.context.ReadSequenceNumber = 0; break; --- 145,149 ---- case ContentType.ChangeCipherSpec: ! this.ProcessChangeCipherSpec(); break; Index: ServerRecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ServerRecordProtocol.cs 5 Mar 2004 23:21:55 -0000 1.3 --- ServerRecordProtocol.cs 9 Mar 2004 16:29:21 -0000 1.4 *************** *** 64,67 **** --- 64,76 ---- #region Handshake Processing Methods + protected override void ProcessChangeCipherSpec() + { + // Reset sequence numbers + this.context.ReadSequenceNumber = 0; + + // Make the pending state to be the current state + this.context.IsActual = true; + } + protected override void ProcessHandshakeMessage(TlsStream handMsg) { Index: SslClientStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** SslClientStream.cs 8 Mar 2004 15:08:41 -0000 1.18 --- SslClientStream.cs 9 Mar 2004 16:29:21 -0000 1.19 *************** *** 40,44 **** X509Certificate certificate, int[] certificateErrors); ! public delegate X509Certificate CertificateSelectionCallback( X509CertificateCollection clientCertificates, --- 40,44 ---- X509Certificate certificate, int[] certificateErrors); ! public delegate X509Certificate CertificateSelectionCallback( X509CertificateCollection clientCertificates, *************** *** 46,50 **** string targetHost, X509CertificateCollection serverRequestedCertificates); ! public delegate AsymmetricAlgorithm PrivateKeySelectionCallback( X509Certificate certificate, --- 46,50 ---- string targetHost, X509CertificateCollection serverRequestedCertificates); ! public delegate AsymmetricAlgorithm PrivateKeySelectionCallback( X509Certificate certificate, |