Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests failed on the PHP8.2.0-dev@Windows with Undefined constant "OPENSSL_SSLV23_PADDING" message #658

Closed
2 of 5 tasks
TheNorthMemory opened this issue Oct 31, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@TheNorthMemory
Copy link

TheNorthMemory commented Oct 31, 2022

Describe the bug

please take a look this actions

1) Error
The data provider specified for WeChatPay\Tests\Crypto\RsaTest::testCrossEncryptDecryptWithDifferentPadding is invalid.
Error: Undefined constant "OPENSSL_SSLV23_PADDING"
D:\a\wechatpay-php\wechatpay-php\tests\Crypto\RsaTest.php:290

Version

  • I have checked releases, and the bug exists in the latest patch version of v1 or v2.
  • v2
  • v1

Runners

  • GitHub Hosted
  • Self Hosted

Operating systems

Windows-latest

PHP versions

8.2.0-dev (22f25532ed11b6508872926d7b7be0ae7552c3dd)

To Reproduce

<?php
use const OPENSSL_SSLV23_PADDING;

var_dump(OPENSSL_SSLV23_PADDING);

see https://www.php.net/manual/en/openssl.padding.php

Expected behavior

may works as other OS, such as ubuntu-latest and macOS-latest

Screenshots/Logs

PHPUnit 9.5.26 by Sebastian Bergmann and contributors.

...............................................................  63 / 528 ( 11%)
............................................................... 126 / 528 ( 23%)
............................................................... 189 / 528 ( 35%)
............................................................... 252 / 528 ( 47%)
..........E.................................................... 315 / 528 ( 59%)
............................................................... 378 / 528 ( 71%)
............................................................... 441 / 528 ( 83%)
............................................................... 504 / 528 ( 95%)
........................                                        528 / 528 (100%)

Time: 00:00.554, Memory: 12.00 MB

There was 1 error:

1) Error
The data provider specified for WeChatPay\Tests\Crypto\RsaTest::testCrossEncryptDecryptWithDifferentPadding is invalid.
Error: Undefined constant "OPENSSL_SSLV23_PADDING"
D:\a\wechatpay-php\wechatpay-php\tests\Crypto\RsaTest.php:290

ERRORS!
Tests: 528, Assertions: 2747, Errors: 1.
Error: Process completed with exit code 1.

Additional context

Are you willing to submit a PR?

@TheNorthMemory TheNorthMemory added the bug Something isn't working label Oct 31, 2022
@shivammathur
Copy link
Owner

shivammathur commented Oct 31, 2022

PHP 8.2 on Windows is built using OpenSSL 3.

OPENSSL_SSLV23_PADDING is only available if RSA_SSLV23_PADDING is present and that was removed in OpenSSL 3
https://github.com/php/php-src/blob/PHP-8.2/ext/openssl/openssl_arginfo.h#L590
openssl/openssl#14283

Other OS will also upgrade to use OpenSSL 3 in the future while building PHP 8.2, so I would not rely on it.

@TheNorthMemory
Copy link
Author

Thanks for the feedback. A little concern is about that, the current windows-latest runner pre-installed the openssl 1.1.1(real 1.1.1q).

Does the PhpManager need a choice to install the ext-openssl with 1.1.1?

TheNorthMemory added a commit to wechatpay-apiv3/wechatpay-php that referenced this issue Dec 5, 2022
* Officially support PHP8.2

* Drop `OPENSSL_SSLV23_PADDING` test cases, because it was removed via openssl3

see openssl/openssl#14216, openssl/openssl#14283, shivammathur/setup-php#658

* Add `SECURITY.md` guideline and mentioning that TSRC is the right place for the security issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants