Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source
In directory sc8-pr-cvs1:/tmp/cvs-serv12401
Modified Files:
TlsCipherSuiteCollection.cs TlsWriter.cs
Log Message:
Cleanup
Index: TlsCipherSuiteCollection.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsCipherSuiteCollection.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TlsCipherSuiteCollection.cs 20 Aug 2003 15:15:50 -0000 1.2
--- TlsCipherSuiteCollection.cs 20 Aug 2003 20:29:35 -0000 1.3
***************
*** 61,65 ****
// scs.Add((0x00 << 0x08) | 0x02, "TLS_RSA_WITH_NULL_SHA", "", "SHA", true, false, 0, 0, 0, 0, 0);
// scs.Add((0x00 << 0x08) | 0x03, "TLS_RSA_EXPORT_WITH_RC4_40_MD5", "RC4", "MD5", true, false, 5, 16, 40, 0, 0);
- scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA", false, true, 24, 24, 168, 8, 8);
scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", "RC4", "SHA", false, false, 16, 16, 128, 0, 0);
scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", "RC4", "MD5", false, false, 16, 16, 128, 0, 0);
--- 61,64 ----
***************
*** 68,73 ****
// scs.Add((0x00 << 0x08) | 0x08, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA", true, true, 5, 8, 40, 8, 8);
scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", "DES", "SHA", false, true, 8, 8, 56, 8, 8);
-
// Diffie-Hellman Cipher Suites
// scs.Add((0x00 << 0x08) | 0x0B, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA", true, true, 5, 8, 40, 8, 8);
--- 67,72 ----
// scs.Add((0x00 << 0x08) | 0x08, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA", true, true, 5, 8, 40, 8, 8);
scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", "DES", "SHA", false, true, 8, 8, 56, 8, 8);
+ scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", "3DES", "SHA", false, true, 24, 24, 168, 8, 8);
// Diffie-Hellman Cipher Suites
// scs.Add((0x00 << 0x08) | 0x0B, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", "DES", "SHA", true, true, 5, 8, 40, 8, 8);
Index: TlsWriter.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsWriter.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TlsWriter.cs 20 Aug 2003 15:15:50 -0000 1.2
--- TlsWriter.cs 20 Aug 2003 20:29:35 -0000 1.3
***************
*** 178,190 ****
private byte[] encodeCipherTextRecord(TlsContentType contentType, byte[] fragment)
{
- TlsStreamWriter record = new TlsStreamWriter();
TlsSessionState state = session.State;
byte[] mac = encodeRecordMAC(contentType, fragment);
!
! SymmetricAlgorithm cipher = session.State.Cipher.CreateCipherAlgorithm();
! ICryptoTransform encryptor = cipher.CreateEncryptor(
! state.ClientWriteKey,
! state.ClientWriteIV);
// Encryption ( fragment + mac [+ padding + padding_length] )
--- 178,189 ----
private byte[] encodeCipherTextRecord(TlsContentType contentType, byte[] fragment)
{
TlsSessionState state = session.State;
byte[] mac = encodeRecordMAC(contentType, fragment);
!
! SymmetricAlgorithm cipher = session.State.Cipher.CreateCipherAlgorithm();
! ICryptoTransform encryptor = cipher.CreateEncryptor(
! state.ClientWriteKey,
! state.ClientWriteIV);
// Encryption ( fragment + mac [+ padding + padding_length] )
***************
*** 207,212 ****
cs.Close();
- record.Write(ms.ToArray());
-
// Update sequence number
session.State.WriteSequenceNumber++;
--- 206,209 ----
***************
*** 215,219 ****
cipher.Clear();
! return record.GetBytes();
}
--- 212,216 ----
cipher.Clear();
! return ms.ToArray();
}
***************
*** 223,228 ****
byte[] result = null;
- byte[] b = BitConverter.GetBytes(session.State.WriteSequenceNumber);
- bool le = BitConverter.IsLittleEndian;
data.WriteLong(session.State.WriteSequenceNumber);
data.Write((byte)contentType);
--- 220,223 ----
|