Make it so loadCA() doesn't have to be called before loadX509() or loadCRL()

This commit is contained in:
terrafrost 2012-11-13 00:43:45 -06:00
parent d492d19748
commit 691f4d1e62

View File

@ -1660,8 +1660,16 @@ class File_X509 {
*/ */
function loadCA($cert) function loadCA($cert)
{ {
$olddn = $this->dn;
$oldcert = $this->currentCert;
$oldsigsubj = $this->signatureSubject;
$cert = $this->loadX509($cert); $cert = $this->loadX509($cert);
if (!$cert) { if (!$cert) {
$this->dn = $olddn;
$this->currentCert = $oldcert;
$this->signatureSubject = $oldsigsubj;
return false; return false;
} }
@ -1690,8 +1698,10 @@ class File_X509 {
//} //}
$this->CAs[] = $cert; $this->CAs[] = $cert;
unset($this->currentCert);
unset($this->signatureSubject); $this->dn = $olddn;
$this->currentCert = $oldcert;
$this->signatureSubject = $oldsigsubj;
return true; return true;
} }