1
0
mirror of https://github.com/danog/phpseclib.git synced 2025-01-22 04:51:19 +01:00

Fix bug in listRevoked() and make it so getSubjectDN() doesn't return issuer DN for CRLs

This commit is contained in:
terrafrost 2012-11-13 00:33:15 -06:00
parent 1abc7e742b
commit 1fd87dcd35

View File

@ -2232,7 +2232,7 @@ class File_X509 {
function getDN($format = FILE_X509_DN_ARRAY, $dn = NULL)
{
if (!isset($dn)) {
$dn = $this->dn;
$dn = isset($this->currentCert['tbsCertList']) ? this->currentCert['tbsCertList']['issuer'] : $this->dn;
}
switch ((int) $format) {
@ -2667,8 +2667,6 @@ class File_X509 {
$this->signatureSubject = substr($orig, $decoded[0]['content'][0]['start'], $decoded[0]['content'][0]['length']);
$this->dn = $crl['tbsCertList']['issuer'];
$this->_mapInExtensions($crl, 'tbsCertList/crlExtensions', $asn1);
$rclist = &$this->_subArray($crl,'tbsCertList/revokedCertificates');
if (is_array($rclist)) {
@ -3658,7 +3656,7 @@ class File_X509 {
$result = array();
if (!is_array($rclist = $this->_subArray($crl, 'tbsCertList/revokedCertificates'))) {
if (is_array($rclist = $this->_subArray($crl, 'tbsCertList/revokedCertificates'))) {
foreach ($rclist as $rc) {
$result[] = $rc['userCertificate']->toString();
}