mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
X509: update intermediate cert changes to work on 2.0 branch
This commit is contained in:
parent
87decbe94b
commit
40730d2977
@ -311,7 +311,7 @@ class X509
|
|||||||
* @var int
|
* @var int
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
var $recur_limit = 5;
|
static $recur_limit = 5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Constructor.
|
* Default Constructor.
|
||||||
@ -2119,7 +2119,7 @@ class X509
|
|||||||
* @access private
|
* @access private
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
function _fetchURL($url)
|
static function _fetchURL($url)
|
||||||
{
|
{
|
||||||
$parts = parse_url($url);
|
$parts = parse_url($url);
|
||||||
$data = '';
|
$data = '';
|
||||||
@ -2189,7 +2189,7 @@ class X509
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cert = $this->_fetchURL($url);
|
$cert = static::_fetchURL($url);
|
||||||
if (!is_string($cert)) {
|
if (!is_string($cert)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -2255,7 +2255,7 @@ class X509
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($count == $this->recur_limit) {
|
if ($count == self::$recur_limit) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2424,9 +2424,9 @@ class X509
|
|||||||
* @param int $count
|
* @param int $count
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function setRecurLimit($count)
|
static function setRecurLimit($count)
|
||||||
{
|
{
|
||||||
$this->recur_limit = $count;
|
self::$recur_limit = $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -640,7 +640,7 @@ Fqfy+n5VpXOdrjic4yZ52yS5sUaq05s6ZZvnmdU=
|
|||||||
|
|
||||||
public function testAuthorityInfoAccess()
|
public function testAuthorityInfoAccess()
|
||||||
{
|
{
|
||||||
$x509 = new File_X509();
|
$x509 = new X509();
|
||||||
$x509->loadCA('-----BEGIN CERTIFICATE-----
|
$x509->loadCA('-----BEGIN CERTIFICATE-----
|
||||||
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
|
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
|
||||||
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||||
@ -703,10 +703,10 @@ lV66p3Ui7pFABGc/Lv7nOyANXfLugBO8MyzydGA4NRGiS2MbGpswPCg154pWausU
|
|||||||
M0qaEPsM2o3CSTfxSJQQIyEe+izV3UQqYSyWkNqCCFPN
|
M0qaEPsM2o3CSTfxSJQQIyEe+izV3UQqYSyWkNqCCFPN
|
||||||
-----END CERTIFICATE-----');
|
-----END CERTIFICATE-----');
|
||||||
|
|
||||||
$x509->setRecurLimit(0);
|
X509::setRecurLimit(0);
|
||||||
$this->assertFalse($x509->validateSignature());
|
$this->assertFalse($x509->validateSignature());
|
||||||
|
|
||||||
$x509->setRecurLimit(5);
|
X509::setRecurLimit(5);
|
||||||
$this->assertTrue($x509->validateSignature());
|
$this->assertTrue($x509->validateSignature());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user