Author: spouliot
Date: 2005-06-29 16:00:45 -0400 (Wed, 29 Jun 2005)
New Revision: 46732

Modified:
   trunk/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog
   trunk/mcs/class/Mono.Security/Mono.Security.X509/X509CRL.cs
Log:
2005-06-29  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * X509CRL.cs: Fix the case where no entry are present in the CRL (as
        the structure is optional).



Modified: trunk/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog
===================================================================
--- trunk/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog  2005-06-29 
19:51:51 UTC (rev 46731)
+++ trunk/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog  2005-06-29 
20:00:45 UTC (rev 46732)
@@ -1,3 +1,8 @@
+2005-06-29  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * X509CRL.cs: Fix the case where no entry are present in the CRL (as
+       the structure is optional).
+
 2005-04-26  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * X509Certificate.cs: DSA and RSA properties are now cached. In 2.0

Modified: trunk/mcs/class/Mono.Security/Mono.Security.X509/X509CRL.cs
===================================================================
--- trunk/mcs/class/Mono.Security/Mono.Security.X509/X509CRL.cs 2005-06-29 
19:51:51 UTC (rev 46731)
+++ trunk/mcs/class/Mono.Security/Mono.Security.X509/X509CRL.cs 2005-06-29 
20:00:45 UTC (rev 46732)
@@ -167,9 +167,14 @@
                                }
                                // CertificateList / TBSCertList / 
revokedCertificates  SEQUENCE OF SEQUENCE  {
                                entries = new ArrayList ();
-                               ASN1 revokedCertificates = next;
-                               for (int i=0; i < revokedCertificates.Count; 
i++) {
-                                       entries.Add (new X509CrlEntry 
(revokedCertificates [i]));
+                               // this is OPTIONAL so it may not be present if 
no entries exists
+                               if (next.Tag == 0x30) {
+                                       ASN1 revokedCertificates = next;
+                                       for (int i=0; i < 
revokedCertificates.Count; i++) {
+                                               entries.Add (new X509CrlEntry 
(revokedCertificates [i]));
+                                       }
+                               } else {
+                                       n--;
                                }
                                // CertificateList / TBSCertList / 
crlExtensions [0] Extensions OPTIONAL }
                                ASN1 extns = toBeSigned [n];

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to