From 3c4fbe131f0ee72eed9b238ab002ee891150233e Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 24 Nov 2018 08:14:41 -0600 Subject: [PATCH] Tests/ECDSA: make tests work on PHP 5.6 (by skipping some tests) --- tests/Unit/Crypt/ECDSA/CurveTest.php | 4 ++++ tests/Unit/Crypt/RSA/LoadKeyTest.php | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/tests/Unit/Crypt/ECDSA/CurveTest.php b/tests/Unit/Crypt/ECDSA/CurveTest.php index cb49b43e..b5db2848 100644 --- a/tests/Unit/Crypt/ECDSA/CurveTest.php +++ b/tests/Unit/Crypt/ECDSA/CurveTest.php @@ -9,6 +9,7 @@ use phpseclib\Crypt\ECDSA; use phpseclib\File\ASN1; use phpseclib\Crypt\ECDSA\Curves\Ed448; +use phpseclib\Math\BigInteger; class Ed448PublicKey { @@ -106,6 +107,7 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase * Verify the correctness of the point addition / doubling / multiplication algorithms * * @dataProvider curves + * @requires PHP 7.0 */ public function testKeyGeneration($name) { @@ -145,6 +147,7 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase * Sign with internal engine, verify with best engine * * @dataProvider curves + * @requires PHP 7.0 */ public function testInternalSign($name) { @@ -175,6 +178,7 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase * Sign with best engine, verify with internal engine * * @dataProvider curves + * @requires PHP 7.0 */ public function testInternalVerify($name) { diff --git a/tests/Unit/Crypt/RSA/LoadKeyTest.php b/tests/Unit/Crypt/RSA/LoadKeyTest.php index 1f29dee0..200145c7 100644 --- a/tests/Unit/Crypt/RSA/LoadKeyTest.php +++ b/tests/Unit/Crypt/RSA/LoadKeyTest.php @@ -9,10 +9,17 @@ use phpseclib\Crypt\RSA; use phpseclib\Crypt\RSA\Keys\PKCS1; use phpseclib\Crypt\RSA\Keys\PKCS8; use phpseclib\Crypt\RSA\Keys\PuTTY; +use phpseclib\Crypt\RSA\Keys\OpenSSH; use phpseclib\Math\BigInteger; class Unit_Crypt_RSA_LoadKeyTest extends PhpseclibTestCase { + public static function setUpBeforeClass() + { + PuTTY::setComment('phpseclib-generated-key'); + OpenSSH::setComment('phpseclib-generated-key'); + } + public function testBadKey() { $rsa = new RSA(); @@ -393,6 +400,7 @@ Private-MAC: 03e2cb74e1d67652fbad063d2ed0478f31bdf256 $rsa->setPrivateKeyFormat('PuTTY'); $key2 = (string) $rsa; + OpenSSH::setComment('ecdsa-key-20181105'); $this->assertSame($key, $key2); }