mirror of
https://github.com/danog/tgseclib.git
synced 2024-11-27 04:34:45 +01: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
|
||||
* @access private
|
||||
*/
|
||||
var $recur_limit = 5;
|
||||
static $recur_limit = 5;
|
||||
|
||||
/**
|
||||
* Default Constructor.
|
||||
@ -2119,7 +2119,7 @@ class X509
|
||||
* @access private
|
||||
* @return bool|string
|
||||
*/
|
||||
function _fetchURL($url)
|
||||
static function _fetchURL($url)
|
||||
{
|
||||
$parts = parse_url($url);
|
||||
$data = '';
|
||||
@ -2189,7 +2189,7 @@ class X509
|
||||
return false;
|
||||
}
|
||||
|
||||
$cert = $this->_fetchURL($url);
|
||||
$cert = static::_fetchURL($url);
|
||||
if (!is_string($cert)) {
|
||||
return false;
|
||||
}
|
||||
@ -2255,7 +2255,7 @@ class X509
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($count == $this->recur_limit) {
|
||||
if ($count == self::$recur_limit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2424,9 +2424,9 @@ class X509
|
||||
* @param int $count
|
||||
* @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()
|
||||
{
|
||||
$x509 = new File_X509();
|
||||
$x509 = new X509();
|
||||
$x509->loadCA('-----BEGIN CERTIFICATE-----
|
||||
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
|
||||
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||
@ -703,10 +703,10 @@ lV66p3Ui7pFABGc/Lv7nOyANXfLugBO8MyzydGA4NRGiS2MbGpswPCg154pWausU
|
||||
M0qaEPsM2o3CSTfxSJQQIyEe+izV3UQqYSyWkNqCCFPN
|
||||
-----END CERTIFICATE-----');
|
||||
|
||||
$x509->setRecurLimit(0);
|
||||
X509::setRecurLimit(0);
|
||||
$this->assertFalse($x509->validateSignature());
|
||||
|
||||
$x509->setRecurLimit(5);
|
||||
X509::setRecurLimit(5);
|
||||
$this->assertTrue($x509->validateSignature());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user