From 17610d105c49c3edb8a269b3e55e71b230332d67 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 16 Sep 2019 09:33:19 +0200 Subject: [PATCH 1/3] fix tests for 5.3 --- tests/Unit/File/ASN1Test.php | 16 ++++++++-------- tests/Unit/File/X509/X509Test.php | 2 +- tests/Unit/Math/BigInteger/TestCase.php | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/Unit/File/ASN1Test.php b/tests/Unit/File/ASN1Test.php index 2f1131d5..1864eff5 100644 --- a/tests/Unit/File/ASN1Test.php +++ b/tests/Unit/File/ASN1Test.php @@ -369,21 +369,21 @@ class Unit_File_ASN1Test extends PhpseclibTestCase */ public function testExplicitImplicitDate() { - $map = [ + $map = array( 'type' => FILE_ASN1_TYPE_SEQUENCE, - 'children' => [ - 'notBefore' => [ + 'children' => array( + 'notBefore' => array( 'constant' => 0, 'optional' => true, 'implicit' => true, - 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME], - 'notAfter' => [ + 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME), + 'notAfter' => array( 'constant' => 1, 'optional' => true, 'implicit' => true, - 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME] - ] - ]; + 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME) + ) + ); $asn1 = new File_ASN1(); $a = pack('H*', '3026a011180f32303137303432313039303535305aa111180f32303138303432313230353935395a'); diff --git a/tests/Unit/File/X509/X509Test.php b/tests/Unit/File/X509/X509Test.php index d8641834..2f95df2c 100644 --- a/tests/Unit/File/X509/X509Test.php +++ b/tests/Unit/File/X509/X509Test.php @@ -731,6 +731,6 @@ ut3+b2Xvzq8yzmHMFtLIJ6Afu1jJpqD82BUAFcvi5vhnP8M7b974R18WCOpgNQvXDI+2/8ZINeU= -----END CERTIFICATE-----'); $r = $x509->saveX509($r); $r = $x509->loadX509($r); - $this->assertSame($r['tbsCertificate']['extensions'][5]['extnValue']['excludedSubtrees'][1]['base']['iPAddress'], ['0.0.0.0', '0.0.0.0']); + $this->assertSame($r['tbsCertificate']['extensions'][5]['extnValue']['excludedSubtrees'][1]['base']['iPAddress'], array('0.0.0.0', '0.0.0.0')); } } diff --git a/tests/Unit/Math/BigInteger/TestCase.php b/tests/Unit/Math/BigInteger/TestCase.php index ab306eba..6120bb86 100644 --- a/tests/Unit/Math/BigInteger/TestCase.php +++ b/tests/Unit/Math/BigInteger/TestCase.php @@ -437,10 +437,10 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase public function testNegativePrecision() { - $vals = [ + $vals = array( '-9223372036854775808', // eg. 8000 0000 0000 0000 '-1' - ]; + ); foreach ($vals as $val) { $x = $this->getInstance($val); $x->setPrecision(64); // ie. 8 bytes From 06217429a2ae57e7cf8b5f07e708c045f09b8521 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Wed, 18 Sep 2019 08:04:16 -0500 Subject: [PATCH 2/3] Travis: add PHP 5.3 support --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7fe96e74..a3ca4eda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,8 @@ language: php matrix: include: + - php: 5.3 + dist: precise - php: 5.4 dist: precise - php: 5.5.9 From 11532ba414d04bebb0441eae10398babc185d8e0 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Wed, 18 Sep 2019 08:20:33 -0500 Subject: [PATCH 3/3] X509: fix pre-5.4 compatability issues --- phpseclib/File/X509.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index ccf964f5..a8c88e07 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -2580,7 +2580,7 @@ class File_X509 { $ip = base64_decode($ip); list(, $ip, $mask) = unpack('N2', $ip); - return [long2ip($ip), long2ip($mask)]; + return array(long2ip($ip), long2ip($mask)); } /**