From 0777e700b966b68287081cdb83e89834b846f84a Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 24 Feb 2024 13:26:33 -0600 Subject: [PATCH 1/2] Tests: updates for phpseclib 2.0 --- tests/Unit/File/ASN1Test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Unit/File/ASN1Test.php b/tests/Unit/File/ASN1Test.php index 486809a2..0d255a11 100644 --- a/tests/Unit/File/ASN1Test.php +++ b/tests/Unit/File/ASN1Test.php @@ -453,7 +453,7 @@ class Unit_File_ASN1Test extends PhpseclibTestCase { $cert = file_get_contents(dirname(__FILE__) . '/ASN1/mal-cert-02.der'); - $asn1 = new File_ASN1(); + $asn1 = new ASN1(); //$this->setExpectedException('PHPUnit_Framework_Error_Notice'); $decoded = $asn1->decodeBER($cert); $this->assertFalse($decoded[0]); From 2870c8fab3f132d2ed40a66c97a36fe5ab625698 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 24 Feb 2024 13:29:02 -0600 Subject: [PATCH 2/2] BigInteger: phpseclib 2.0 updates --- phpseclib/Math/BigInteger.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index be07d588..bb92c6ea 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -736,13 +736,13 @@ class BigInteger */ function getLength() { - if (MATH_BIGINTEGER_MODE != MATH_BIGINTEGER_MODE_INTERNAL) { + if (MATH_BIGINTEGER_MODE != self::MODE_INTERNAL) { return strlen($this->toBits()); } $max = count($this->value) - 1; return $max != -1 ? - $max * MATH_BIGINTEGER_BASE + ceil(log($a->value[$max] + 1, 2)) : + $max * self::$base + ceil(log($a->value[$max] + 1, 2)) : 0; }