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

Fixed callmap for function openssl_sign, it changed in PHP 8.0 (modif… #6846

Merged
merged 3 commits into from
Nov 8, 2021

Conversation

jirkace
Copy link

@jirkace jirkace commented Nov 7, 2021

…ied types for param private_key) #6842

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Nov 7, 2021
@weirdan
Copy link
Collaborator

weirdan commented Nov 7, 2021

The docs say array is also accepted as a private key. For the array format, see https://www.php.net/manual/en/openssl.certparams.php:

For private keys, you may also use the syntax array($key, $passphrase) where $key represents a key specified using the file:// or textual content notation above, and $passphrase represents a string containing the passphrase for that private key

@jirkace
Copy link
Author

jirkace commented Nov 7, 2021

@weirdan I'm sorry about that and thanks for notice. Is list<string> correct type notation for that array in CallMap? I've updated it PR.

@weirdan
Copy link
Collaborator

weirdan commented Nov 7, 2021

I'm not sure, it may accept array{OpenSSLAsymmetricKey|OpenSSLCertificate|string, string}, and I don't have openssl extension installed to test it.

Anyway, list would be better replaced with a tuple like shown above, as docs clearly suggest the function expects two-element array, and list allows any number of elements (including 0).

@jirkace
Copy link
Author

jirkace commented Nov 8, 2021

@weirdan I've tried locally run snippet of code and it looks like it works with array{OpenSSLAsymmetricKey, string} although I understand from the documentation that it can only be there array{string, string}

$key represents a key specified using the file:// or textual content notation

textual content notation is string only for me :-)

@weirdan weirdan merged commit d844eab into vimeo:master Nov 8, 2021
@weirdan
Copy link
Collaborator

weirdan commented Nov 8, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Argument 3 of openssl_sign expects resource|string, OpenSSLAsymmetricKey provided
3 participants