From 1fd87dcd35d4d4e323859de4c2f115c97d93dde3 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 13 Nov 2012 00:33:15 -0600 Subject: [PATCH] Fix bug in listRevoked() and make it so getSubjectDN() doesn't return issuer DN for CRLs --- phpseclib/File/X509.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 81a22b38..8dbb8faa 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -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(); }