From d7b456a2d54e38beabdf788bad2a53af05577eb9 Mon Sep 17 00:00:00 2001 From: Foaieee Date: Fri, 20 Feb 2026 11:34:25 +0200 Subject: [PATCH 1/3] Update symfony/process version and add PHP 8.2, 8.3, 8.4 support in configuration files --- .github/workflows/phpstan.yml | 3 +++ .github/workflows/phpunit-unit.yml | 3 +++ composer.json | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 485c1cb..3d87204 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -18,6 +18,9 @@ jobs: - 7.4 - 8.0 - 8.1 + - 8.2 + - 8.2 + - 8.4 steps: - name: Checkout diff --git a/.github/workflows/phpunit-unit.yml b/.github/workflows/phpunit-unit.yml index 65518ef..ad9d147 100644 --- a/.github/workflows/phpunit-unit.yml +++ b/.github/workflows/phpunit-unit.yml @@ -18,6 +18,9 @@ jobs: - 7.4 - 8.0 - 8.1 + - 8.2 + - 8.3 + - 8.4 steps: - name: Checkout diff --git a/composer.json b/composer.json index feec01a..ac0cb42 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "ext-openssl": "*", "phpseclib/phpseclib": "^3.0", "spomky-labs/php-aes-gcm": "^1.2", - "symfony/process": "^4.1|^5.0|^6.0|^7.0" + "symfony/process": "^5.0|^6.0|^7.0" }, "require-dev": { "phpunit/phpunit": "^7.5|^9.0", From 005ea222522668abdde97f2e0abca1edccf58488 Mon Sep 17 00:00:00 2001 From: Foaieee Date: Fri, 20 Feb 2026 11:41:57 +0200 Subject: [PATCH 2/3] Refactor OpenSslServiceTest to improve certificate assertions and handle OpenSSL version differences --- tests/Decoding/OpenSSL/OpenSslServiceTest.php | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/Decoding/OpenSSL/OpenSslServiceTest.php b/tests/Decoding/OpenSSL/OpenSslServiceTest.php index 109c958..3799ddc 100644 --- a/tests/Decoding/OpenSSL/OpenSslServiceTest.php +++ b/tests/Decoding/OpenSSL/OpenSslServiceTest.php @@ -79,20 +79,27 @@ public function testVerifySignatureFail(): void public function testGetCertificatesFromPkcs7Success() { - $leafHeader = 'subject=C = RO, ST = BUH, L = Bucuresti, O = Internet Widgits Pty Ltd, CN = leaflet' . - PHP_EOL . 'issuer=C = RO, ST = BUH, O = PayU, CN = intermediate-cert' . PHP_EOL; - $leafCert = file_get_contents(__DIR__ . '/leaf.crt'); - $intermediateHeader = 'subject=C = RO, ST = BUH, O = PayU, CN = intermediate-cert' . PHP_EOL . - 'issuer=C = RO, ST = BUH, O = PayU ROOT, CN = root-cert' . PHP_EOL; - $intermediateCert = file_get_contents(__DIR__ . '/intermediate.crt'); - - $expectedResponse = $leafHeader . $leafCert . PHP_EOL . PHP_EOL . $intermediateHeader . $intermediateCert; + $leafCert = trim(file_get_contents(__DIR__ . '/leaf.crt')); + $intermediateCert = trim(file_get_contents(__DIR__ . '/intermediate.crt')); $pkcs7DerCert = realpath(__DIR__ . '/leaf.p7b'); $response = $this->openSslService->getCertificatesFromPkcs7($pkcs7DerCert); - $this->assertEquals($expectedResponse, $response); + // Assert subject/issuer headers are present for both certificates. + // OpenSSL < 3.x formats as "C = RO", OpenSSL >= 3.x formats as "C=RO" — accept both. + $this->assertMatchesRegularExpression( + '/^subject=.*CN\s*=\s*leaflet\nissuer=.*CN\s*=\s*intermediate-cert\n/m', + $response + ); + $this->assertMatchesRegularExpression( + '/^subject=.*CN\s*=\s*intermediate-cert\nissuer=.*CN\s*=\s*root-cert\n/m', + $response + ); + + // Assert both PEM certificate bodies are present verbatim. + $this->assertStringContainsString($leafCert, $response); + $this->assertStringContainsString($intermediateCert, $response); } public function testGetCertificatesFromPkcs7Fail() From 9d5e7123049c4389cd1b2ac613fa23e029e42b52 Mon Sep 17 00:00:00 2001 From: Foaieee Date: Fri, 20 Feb 2026 13:07:19 +0200 Subject: [PATCH 3/3] Add PHP 8.5 support in phpstan and phpunit configuration files --- .github/workflows/phpstan.yml | 3 ++- .github/workflows/phpunit-unit.yml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 3d87204..4f29122 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -19,8 +19,9 @@ jobs: - 8.0 - 8.1 - 8.2 - - 8.2 + - 8.3 - 8.4 + - 8.5 steps: - name: Checkout diff --git a/.github/workflows/phpunit-unit.yml b/.github/workflows/phpunit-unit.yml index ad9d147..5dba465 100644 --- a/.github/workflows/phpunit-unit.yml +++ b/.github/workflows/phpunit-unit.yml @@ -21,6 +21,7 @@ jobs: - 8.2 - 8.3 - 8.4 + - 8.5 steps: - name: Checkout