This is a problem with openca-0.9.2-RC6 - viewing expired certificates always showed nothing even if there were expired certificates. The expired certificates showed up on the valid page with a status of valid.

Attached is a patch which fixes this problem (small changes to viewCert and lists)

Mark Davidson
diff -urN openca-0.9.2-RC6/src/common/lib/cmds/lists 
openca-0.9.2-RC6patched/src/common/lib/cmds/lists
--- openca-0.9.2-RC6/src/common/lib/cmds/lists  2004-08-03 11:03:53.000000000 +0100
+++ openca-0.9.2-RC6patched/src/common/lib/cmds/lists   2004-10-21 12:31:00.728480887 
+0100
@@ -41,7 +41,7 @@
        $item_list->{HEAD}->[4] = gettext("Role");
 
 } elsif( $action =~ /^certsExpiredList/i) {
-       $dataType  = 'EXPIRED_CERTIFICATE';
+       $dataType  = 'VALID_CERTIFICATE';
        $listType  = gettext("Expired Certificates");
 
        $newCMD    = $getID_url;
@@ -134,10 +134,11 @@
 
        ## Common Variables
        my ( $format, $key, $ser_col, $op_col, $email, $email_col, $role_col );
-       my ( $lnk, $parsed, $head );
+       my ( $lnk, $parsed, $head , $expired);
 
         my $pos = scalar @{$item_list->{BODY}};
         my $index = 0;
+       my $date = $tools->getDate();
 
        $parsed = $dbItem->getParsed();
        $head   = $parsed->{HEADER};
@@ -149,6 +150,17 @@
         $notBefore = ( $parsed->{NOTBEFORE} or $head->{NOTBEFORE}
                        or $parsed->{SUBMIT_DATE} );
 
+       $expired = ($cryptoShell->getNumericDate ($date) >
+            $cryptoShell->getNumericDate ($parsed->{NOTAFTER}));
+
+       if(( $action =~ /^certsList/i ) && $expired) {
+           next;
+       }
+       if(( $action =~ /^certsExpiredList/i ) && !$expired) {
+           next;
+       }
+
+
        if( $dataType =~ /CRR/ ) {
                if ($parsed->{SIGNATURE}) {
                        ## signature-based revocation
diff -urN openca-0.9.2-RC6/src/common/lib/cmds/viewCert 
openca-0.9.2-RC6patched/src/common/lib/cmds/viewCert
--- openca-0.9.2-RC6/src/common/lib/cmds/viewCert       2004-08-03 11:03:53.000000000 
+0100
+++ openca-0.9.2-RC6patched/src/common/lib/cmds/viewCert        2004-10-21 
12:31:02.059461972 +0100
@@ -115,6 +115,7 @@
     my $tmpIssuer = $parsedCert->{ISSUER};
     my $tmpDN     = $parsedCert->{DN};
     my $tmpStatus = $status;
+    my $date = $tools->getDate();
 
     ## old version - if it can be removed then simply remove it
     $tmpIssuer =~ s/[\/,]\s*(?=[A-Za-z0-9\-]+=)/<BR>\n/g;

Reply via email to