Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls
In directory sc8-pr-cvs1:/tmp/cvs-serv29725
Modified Files:
CipherSuite.cs TlsCipherSuiteFactory.cs
Log Message:
2003-11-22 Carlos Guzmán Álvarez <car...@te...>
* Mono.Security.Protocol.Tls/CipherSuite.cs:
- Better handling of padding bytes on message encryption.
* Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs:
- Uncommented AES ciphersuites.
Index: CipherSuite.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/CipherSuite.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** CipherSuite.cs 13 Nov 2003 09:21:51 -0000 1.9
--- CipherSuite.cs 22 Nov 2003 14:43:51 -0000 1.10
***************
*** 285,290 ****
{
// Calculate padding_length
! int fragmentLength = fragment.Length + mac.Length + 1;
! int paddingLength = this.blockSize - fragmentLength % this.blockSize;
if (paddingLength == this.blockSize)
{
--- 285,290 ----
{
// Calculate padding_length
! byte fragmentLength = (byte)(fragment.Length + mac.Length + 1);
! byte paddingLength = (byte)(this.blockSize - fragmentLength % this.blockSize);
if (paddingLength == this.blockSize)
{
***************
*** 293,303 ****
// Write padding length byte
for (int i = 0; i < (paddingLength + 1); i++)
{
! cs.WriteByte((byte)paddingLength);
}
}
! // cs.FlushFinalBlock();
! cs.Close();
return ms.ToArray();
--- 293,306 ----
// Write padding length byte
+ byte[] padding = new byte[(paddingLength + 1)];
for (int i = 0; i < (paddingLength + 1); i++)
{
! padding[i] = paddingLength;
}
+
+ cs.Write(padding, 0, padding.Length);
}
! cs.FlushFinalBlock();
! cs.Close();
return ms.ToArray();
***************
*** 317,334 ****
{
// Calculate padding_length
! paddingLength = buffer[buffer.Length - 1];
!
! /* Review this that is valid way for TLS1 but not for SSL3
! for (int i = (buffer.Length - 1); i > (buffer.Length - (paddingLength + 1)); i--)
! {
! if (buffer[i] != paddingLength)
! {
! paddingLength = 0;
! break;
! }
! }
! */
!
! fragmentSize = (buffer.Length - (paddingLength + 1)) - this.HashSize;
}
else
--- 320,325 ----
{
// Calculate padding_length
! paddingLength = buffer[buffer.Length - 1];
! fragmentSize = (buffer.Length - (paddingLength + 1)) - this.HashSize;
}
else
Index: TlsCipherSuiteFactory.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** TlsCipherSuiteFactory.cs 14 Nov 2003 13:40:40 -0000 1.11
--- TlsCipherSuiteFactory.cs 22 Nov 2003 14:43:51 -0000 1.12
***************
*** 51,56 ****
// Supported ciphers
! // scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16);
! // scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16);
scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8);
scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8);
--- 51,56 ----
// Supported ciphers
! scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16);
! scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16);
scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8);
scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8);
|