-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[NFR]: crypt->decode throws Warning #15879
Comments
@destyk Thank you for reporting this. I will sort it out shortly. |
Why using the complex error handler stuff? Because openssl_cipher_iv_length() raises a warning? Why not simply check with openssl_get_cipher_methods() if the cipher is supported? |
Yes that was the intent. Your solution is better and faster :) |
Actually looking at the code - and I forgot about this - the cipher is checked against the available ciphers so it will always be valid. I have simplified the code. Thank you @noone-silent |
Resolved in #15895 Thank you @destyk and @noone-silent |
The current issue is related to the
Phalcon\Encryption\Crypt
module. It lies in the fact that if any random string that is less than 16 bytes long is passed to the decryption function, then PHP throws aWarning: openssl_decrypt(): the passed IV is only 2 bytes long, cipher expects an IV exactly 16 bytes long
.Example:
This problem is, of course, solved by disabling the display of warnings in the production environment. However, I would like to see in the future a function to check the encoded string for the number of bytes required by the cipher in use.
Example:
Many thanks in advance and have a nice day! :)
The text was updated successfully, but these errors were encountered: