Skip to content

Add openssl_cipher_key_length function #9368

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

Closed
wants to merge 1 commit into from

Conversation

bukka
Copy link
Member

@bukka bukka commented Aug 18, 2022

This function works in exactly the same way as openssl_cipher_iv_length but for a key length. This is especially useful to make sure that the right key length is provided to openssl_encrypt and openssl_decrypt.

It fixes #9026 .

@jrfnl
Copy link
Contributor

jrfnl commented Aug 18, 2022

🎗️ If this does go into PHP 8.2, it will need a changelog entry in UPGRADING introducing the new function.

Verified

This commit was signed with the committer’s verified signature.
bukka Jakub Zelenka
This function works in exactly the same way as openssl_cipher_iv_length
but for a key length. This is especially useful to make sure that the
right key length is provided to openssl_encrypt and openssl_decrypt.
@bukka bukka force-pushed the openssl_cipher_key_length branch from 2bb2091 to 4951d71 Compare August 21, 2022 16:27
@saundefined saundefined added this to the PHP 8.2 milestone Aug 24, 2022
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This looks still good to me for PHP 8.2.

Or do any of the RMs object, @ramsey, @adoy, @saundefined?

Copy link
Member

@adoy adoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you :)

@bukka
Copy link
Member Author

bukka commented Aug 28, 2022

Merged via 35e2a25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

do not silently truncate the key in openssl_encrypt()
5 participants