-
-
Notifications
You must be signed in to change notification settings - Fork 177
#170 - issue - openssl 3.0 patch #176
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
Conversation
Please, can you merge the pull request? Thank you in advance! |
+1 I need this fix and for now applied it locally on my ubuntu package. |
Hi Reno, I'm happy to hear, that someone else find it useful, thank you! Greetings |
This MR has a typo,
Besides, AES is not Blowfish, thus this is most likely not compatible with the other implementations in use. We should add a marker at the beginning of the string to explicitely state we're using a new encryption scheme here. Also, it'd be awesome if we could handle cases when BTW, it seems Blowfish encryption with OpenSSL is broken currently: |
@@ -21,6 +21,7 @@ | |||
define('DOCDIR',sprintf('%s/',realpath(LIBDIR.'../doc/'))); | |||
define('HOOKSDIR',sprintf('%s/',realpath(LIBDIR.'../hooks/'))); | |||
define('JSDIR','js/'); | |||
define('SESSION_CIPHER','aes256-gcm'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is aes-256-gcm
on my side. I think you're just skipping the OpenSSL part since in_array(SESSION_CIPHER, openssl_get_cipher_methods())
is falsy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true for me too, on Debian PHP 8.2 !
cc @tachtler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, fixed by ef8d0ce
I concur that the fix for this is actually just masking the problem. When SESSION_CIPHER is incorrectly set to aes256-gcm, it actually bypasses the openssl_* functions altogether, which makes it fall through to mcrypt_* functions (which are deprecated), and then the PHP-based blowfish library (which probably uses the ECB mode that openssl 3.0 deprecated because it's insecure). As previously stated, the AES cipher method is called aes-256-gcm, but that requires an IV for the encryption and decryption, which is not being provided. This generates a PHP warning:
There are other blowfish cipher modes that OpenSSL 3.0 still supports, but they require an IV or nonce. As far as which is best, I really don't know that much about encryption, although I know CBC should be avoided. This page provides some good details on the different Blowfish cipher modes. https://pycryptodome.readthedocs.io/en/latest/src/cipher/classic.html Summary:
If you concatenate the IV with the encrypted string, you can extract it when doing the decryption without requiring you to store it (kind of like storing the salt for a hashed password). |
On archlinux, php7 has been updated with openssl 3.0 and now it's impossible to open a connection in phpldapadmin: connection is anonymous and is rejected by ldap server. #170 - solution was made by https://github.com/bendem and solves the issue #175 too, Thank you!