Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake
In directory sc8-pr-cvs1:/tmp/cvs-serv12410
Modified Files:
TlsServerCertificate.cs
Log Message:
Improved a little more the read of the server certificates
Index: TlsServerCertificate.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/Handshake/TlsServerCertificate.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** TlsServerCertificate.cs 8 Oct 2003 20:27:05 -0000 1.8
--- TlsServerCertificate.cs 9 Oct 2003 10:23:40 -0000 1.9
***************
*** 67,82 ****
this.certificates = new X509CertificateCollection();
! // Read Length
! int length = Reader.ReadInt24();
! int count = 3;
! // Skip next 3 bytes
! int skip = Reader.ReadInt24();
! while (count < length)
{
// Read certificate length
int certLength = Reader.ReadInt24();
if (certLength > 0)
{
--- 67,85 ----
this.certificates = new X509CertificateCollection();
! // Skip first 3 bytes
! int skip = Reader.ReadInt24();
! int readed = 0;
! // Read Length
! int length = Reader.ReadInt24();
! while (readed < length)
{
// Read certificate length
int certLength = Reader.ReadInt24();
+ // Increment readed
+ readed += 3;
+
if (certLength > 0)
{
***************
*** 85,89 ****
certificates.Add(certificate);
! count += certLength + 3;
validateCertificate(certificate);
--- 88,92 ----
certificates.Add(certificate);
! readed += certLength;
validateCertificate(certificate);
|