-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
openssl_sign() stub probably should not contain array type in private_key #16275
Comments
The key parameter is parsed with Lines 3603 to 3631 in 2501cad
So I guess the documentation should make it clear that the array is expected to be |
@DanielEScherzer Okay thank you very much for checking this. Will ping them to update docs. |
@DanielEScherzer Just one more question. Should |
I can see some checks for val here Lines 3633 to 3721 in 2501cad
So it means that
I it correct? Have I missed something? |
So I think that key can be, based on the implementation at Line 3586 in 2501cad
but to be clear, I don't think I have ever used this extension and even knew about it before seeing this issue, so no promises - maybe test it locally? Edit: you seem to have posted a similar analysis a few seconds before me, so I guess you came to the same conclusions |
Okay thanks will point docs people to this issue maybe they will be able to fully test it. I'll try myself with some simple php code when I have time. Thanks again for help |
If it helps, I too believe your breakdowns of the different supported types are correct. Here are all the places using that helper function, and so will support arrays, and thus whose docs need to be checked:
Related, there's a minor matter with openssl_spki_new: it does use the helper, but the argument handling currently only allows for OpenSSLAsymmetricKey objects - no strings or arrays. I don't see a reason that should have to be the case so I'd think it should be fixed to support the entire zval spectrum... CC @cmb69 |
@bukka usually does OpenSSL stuff. So pinging him to check the above. |
openssl_spki_new accepts only OpenSSLAsymmetricKey from a quick look. We could probably change it but why bother with SPKI which no one probably uses anyway... :) |
I mean there might be some legacy apps that use that but I highly doubt that anyone would need it for a new code. So it's very low priority as there are just more important things to do in openssl ext. |
Description
The following stub code:
php-src/ext/openssl/openssl.stub.php
Lines 602 to 606 in 2501cad
suggest that
$private_key
can bearray
somhow but it is not documented anywhere beside stub.Also, I'm not fluent in C but there seems to be no array handling in function
php-src/ext/openssl/openssl.c
Lines 7107 to 7174 in 2501cad
There is a (high) possibility that I'm wrong and stub is correct and just docs are to be updated and
array
type documented.Can you check what is correct?
I also added an issue in for the docs. I've got reply that docs is based on stub files from
php-src
, so better to check first here.Thank you.
PHP Version
PHP 8.3.11
Operating System
No response
The text was updated successfully, but these errors were encountered: