mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
Make it so loadCA() doesn't have to be called before loadX509() or loadCRL()
This commit is contained in:
parent
d492d19748
commit
691f4d1e62
@ -1660,8 +1660,16 @@ class File_X509 {
|
||||
*/
|
||||
function loadCA($cert)
|
||||
{
|
||||
$olddn = $this->dn;
|
||||
$oldcert = $this->currentCert;
|
||||
$oldsigsubj = $this->signatureSubject;
|
||||
|
||||
$cert = $this->loadX509($cert);
|
||||
if (!$cert) {
|
||||
$this->dn = $olddn;
|
||||
$this->currentCert = $oldcert;
|
||||
$this->signatureSubject = $oldsigsubj;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1690,8 +1698,10 @@ class File_X509 {
|
||||
//}
|
||||
|
||||
$this->CAs[] = $cert;
|
||||
unset($this->currentCert);
|
||||
unset($this->signatureSubject);
|
||||
|
||||
$this->dn = $olddn;
|
||||
$this->currentCert = $oldcert;
|
||||
$this->signatureSubject = $oldsigsubj;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user