diff options
-rw-r--r-- | etc/inc/certs.inc | 11 | ||||
-rw-r--r-- | usr/local/www/system_camanager.php | 16 | ||||
-rw-r--r-- | usr/local/www/system_certmanager.php | 16 |
3 files changed, 41 insertions, 2 deletions
diff --git a/etc/inc/certs.inc b/etc/inc/certs.inc index 84c028a..61be3d1 100644 --- a/etc/inc/certs.inc +++ b/etc/inc/certs.inc @@ -471,6 +471,17 @@ function cert_get_purpose($str_crt, $decode = true) { return $purpose; } +function cert_get_dates($str_crt, $decode = true) { + if ($decode) + $str_crt = base64_decode($str_crt); + $crt_details = openssl_x509_parse($str_crt); + if ($crt_details['validFrom_time_t'] > 0) + $start = date('r', $crt_details['validFrom_time_t']); + if ($crt_details['validTo_time_t'] > 0) + $end = date('r', $crt_details['validTo_time_t']); + return array($start, $end); +} + function prv_get_modulus($str_crt, $decode = true){ return cert_get_modulus($str_crt, $decode, "prv"); } diff --git a/usr/local/www/system_camanager.php b/usr/local/www/system_camanager.php index 0033339..49fd32d 100644 --- a/usr/local/www/system_camanager.php +++ b/usr/local/www/system_camanager.php @@ -600,6 +600,7 @@ function method_change() { $name = htmlspecialchars($ca['descr']); $subj = cert_get_subject($ca['crt']); $issuer = cert_get_issuer($ca['crt']); + list($startdate, $enddate) = cert_get_dates($ca['crt']); if($subj == $issuer) $issuer_name = "<em>" . gettext("self-signed") . "</em>"; else @@ -645,7 +646,20 @@ function method_change() { <td class="listr"><?=$internal;?> </td> <td class="listr"><?=$issuer_name;?> </td> <td class="listr"><?=$certcount;?> </td> - <td class="listr"><?=$subj;?> </td> + <td class="listr"><?=$subj;?><br /> + <table width="100%" style="font-size: 9px"> + <tr> + <td width="10%"> </td> + <td width="20%"><?=gettext("Valid From")?>:</td> + <td width="70%"><?= $startdate ?></td> + </tr> + <tr> + <td> </td> + <td><?=gettext("Valid Until")?>:</td> + <td><?= $enddate ?></td> + </tr> + </table> + </td> <td valign="middle" nowrap class="list"> <a href="system_camanager.php?act=edit&id=<?=$i;?>"> <img src="/themes/<?= $g['theme'];?>/images/icons/icon_e.gif" title="<?=gettext("edit CA");?>" alt="<?=gettext("edit CA");?>" width="17" height="17" border="0" /> diff --git a/usr/local/www/system_certmanager.php b/usr/local/www/system_certmanager.php index 74d6884..12682de 100644 --- a/usr/local/www/system_certmanager.php +++ b/usr/local/www/system_certmanager.php @@ -1074,6 +1074,7 @@ function internalca_change() { $subj = cert_get_subject($cert['crt']); $issuer = cert_get_issuer($cert['crt']); $purpose = cert_get_purpose($cert['crt']); + list($startdate, $enddate) = cert_get_dates($cert['crt']); if($subj==$issuer) $caname = "<em>" . gettext("self-signed") . "</em>"; else @@ -1119,7 +1120,20 @@ function internalca_change() { </table> </td> <td class="listr"><?=$caname;?> </td> - <td class="listr"><?=$subj;?> </td> + <td class="listr"><?=$subj;?> <br /> + <table width="100%" style="font-size: 9px"> + <tr> + <td width="10%"> </td> + <td width="20%"><?=gettext("Valid From")?>:</td> + <td width="70%"><?= $startdate ?></td> + </tr> + <tr> + <td> </td> + <td><?=gettext("Valid Until")?>:</td> + <td><?= $enddate ?></td> + </tr> + </table> + </td> <td class="listr"> <?php if (is_cert_revoked($cert)): ?> <b>Revoked</b><br/> |