[pgsqlclient-checkins] pgsqlclient_10/PgSqlClient.Security.Tls/source TlsCipherSuite.cs,1.3,1.4 TlsR
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2003-08-24 10:46:57
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source In directory sc8-pr-cvs1:/tmp/cvs-serv11302 Modified Files: TlsCipherSuite.cs TlsReader.cs TlsSession.cs TlsSessionState.cs Log Message: no message Index: TlsCipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsCipherSuite.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsCipherSuite.cs 23 Aug 2003 19:25:31 -0000 1.3 --- TlsCipherSuite.cs 24 Aug 2003 10:46:54 -0000 1.4 *************** *** 200,204 **** cs.WriteByte((byte)paddingLength); } ! // cs.FlushFinalBlock(); cs.Close(); --- 200,204 ---- cs.WriteByte((byte)paddingLength); } ! cs.Flush(); cs.Close(); *************** *** 208,212 **** public void DecryptRecord(byte[] fragment, ref byte[] dcrFragment, ref byte[] dcrMAC) { ! int fragmentSize = 0; // Decrypt message fragment ( fragment + mac [+ padding + padding_length] ) --- 208,212 ---- public void DecryptRecord(byte[] fragment, ref byte[] dcrFragment, ref byte[] dcrMAC) { ! int fragmentSize = 0; // Decrypt message fragment ( fragment + mac [+ padding + padding_length] ) *************** *** 217,221 **** if (cipherMode == CipherMode.CBC) { ! fragmentSize = (buffer.Length - 1) - HashSize; } else --- 217,221 ---- if (cipherMode == CipherMode.CBC) { ! fragmentSize = (buffer.Length - (buffer[buffer.Length - 1] + 1)) - HashSize; } else *************** *** 259,263 **** } - private void createEncryptionCipher() { --- 259,262 ---- *************** *** 287,290 **** --- 286,293 ---- sessionState.ClientWriteKey, sessionState.ClientWriteIV); + + // Clear server keys + sessionState.ClientWriteKey = null; + sessionState.ClientWriteIV = null; } *************** *** 308,312 **** // Configure encrypt algorithm decryptionAlgorithm.Mode = this.cipherMode; ! decryptionAlgorithm.Padding = PaddingMode.PKCS7; decryptionAlgorithm.KeySize = this.keyMaterialSize * 8; decryptionAlgorithm.BlockSize = this.blockSize * 8; --- 311,315 ---- // Configure encrypt algorithm decryptionAlgorithm.Mode = this.cipherMode; ! decryptionAlgorithm.Padding = PaddingMode.None; decryptionAlgorithm.KeySize = this.keyMaterialSize * 8; decryptionAlgorithm.BlockSize = this.blockSize * 8; *************** *** 316,319 **** --- 319,326 ---- sessionState.ServerWriteKey, sessionState.ServerWriteIV); + + // Clear server keys + sessionState.ServerWriteKey = null; + sessionState.ServerWriteIV = null; } Index: TlsReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsReader.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsReader.cs 23 Aug 2003 19:25:31 -0000 1.3 --- TlsReader.cs 24 Aug 2003 10:46:54 -0000 1.4 *************** *** 287,291 **** { case TlsAlertDescription.CloseNotify: ! session.State.ServerConnectionEnd = true; break; --- 287,291 ---- { case TlsAlertDescription.CloseNotify: ! session.State.ConnectionEnd = true; break; Index: TlsSession.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSession.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsSession.cs 23 Aug 2003 19:25:31 -0000 1.3 --- TlsSession.cs 24 Aug 2003 10:46:54 -0000 1.4 *************** *** 196,204 **** writer.WriteAlert(alert); - // Read Close Notify - reader.ReadRecord(); - // Check that the session is finished by the client and by server ! if (!state.ClientConnectionEnd || !state.ServerConnectionEnd) { throw new TlsException("Invalid session termination"); --- 196,201 ---- writer.WriteAlert(alert); // Check that the session is finished by the client and by server ! if (!state.ConnectionEnd) { throw new TlsException("Invalid session termination"); Index: TlsSessionState.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSessionState.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TlsSessionState.cs 20 Aug 2003 11:48:20 -0000 1.1 --- TlsSessionState.cs 24 Aug 2003 10:46:54 -0000 1.2 *************** *** 27,32 **** private TlsServerSettings serverSettings; ! private bool serverConnectionEnd; ! private bool clientConnectionEnd; private TlsCipherSuite cipher; private int compressionMethod; --- 27,31 ---- private TlsServerSettings serverSettings; ! private bool connectionEnd; private TlsCipherSuite cipher; private int compressionMethod; *************** *** 57,70 **** } ! public bool ServerConnectionEnd ! { ! get { return serverConnectionEnd; } ! set { serverConnectionEnd = value; } ! } ! ! public bool ClientConnectionEnd { ! get { return clientConnectionEnd; } ! set { clientConnectionEnd = value; } } --- 56,63 ---- } ! public bool ConnectionEnd { ! get { return connectionEnd; } ! set { connectionEnd = value; } } |