警告在./libraries/phpseclib/Crypt/Base.php#967中

时间:2015-09-02 09:48:50

标签: php phpmyadmin phpseclib

今天我使用PHP 5.3.3版在我的Red Hat Enterprise Linux Server 6.7版(圣地亚哥)上升级了我的phpMyAdmin 4.4.09到4.4.14。我的数据库服务器是MariaDB 5.5.44。我已将之前安装的config.inc.php文件复制到新解压缩的文件中。当我登录时,我收到以下警告信息:

Warning in ./libraries/phpseclib/Crypt/Base.php#967
 openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and not recommended

Backtrace

./libraries/phpseclib/Crypt/Base.php#967: openssl_encrypt(
string ' g8��)@�� �8��',
string 'aes-256-ecb',
string '52627967f3d249d378f33d2b9b1681e7',
boolean true,
)
./libraries/plugins/auth/AuthenticationCookie.class.php#810: phpseclib\Crypt\Base->decrypt(string 'w(�  �9P���(��')
./libraries/plugins/auth/AuthenticationCookie.class.php#458: AuthenticationCookie->cookieDecrypt(
string 'GncowgnLOVDc0h3HKLkC4g==',
string '52627967f3d249d378f33d2b9b1681e7',
)
./libraries/common.inc.php#869: AuthenticationCookie->authCheck()
./index.php#12: require_once(./libraries/common.inc.php

-

Warning in ./libraries/phpseclib/Crypt/Base.php#967
 openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and not recommended

Backtrace

./libraries/phpseclib/Crypt/Base.php#967: openssl_encrypt(
string '�만�"Na#���` �~',
string 'aes-256-ecb',
string '2}�)6�k4�yK�вQq1jՁ1��o<6H<�>���N��Lj9�i�$�B\'���c�;kc�C���\'�S�΁��� %yخ�3�s ��c?5�� ��{ϓ~�2��j,��Ϗr�BxF�]���\\�[��#���H�IR\\/cA:W�,E��6U    -���Y�oz�   ��@���;5F�8��9]�ݧ��2]�B����Dy��4Nv]5>���3��Su5}���4 ���<3�]}_՗���,� `hG',
boolean true,
)
./libraries/plugins/auth/AuthenticationCookie.class.php#810: phpseclib\Crypt\Base->decrypt(string '�����2^q3���p�n')
./libraries/plugins/auth/AuthenticationCookie.class.php#492: AuthenticationCookie->cookieDecrypt(
string 'n/u3nKcyXnEzof2TcBmqbg==',
string '2}�)6�k4�yK�вQq1jՁ1��o<6H<�>���N��Lj9�i�$�B\'���c�;kc�C���\'�S�΁��� %yخ�3�s ��c?5�� ��{ϓ~�2��j,��Ϗr�BxF�]���\\�[��#���H�IR\\/cA:W�,E��6U    -���Y�oz�   ��@���;5F�8��9]�ݧ��2]�B����Dy��4Nv]5>���3��Su5}���4 ���<3�]}_՗���,� `hG',
)
./libraries/common.inc.php#869: AuthenticationCookie->authCheck()
./index.php#12: require_once(./libraries/common.inc.php)

-

Warning in ./libraries/Response.class.php#370
 json_encode(): Invalid UTF-8 sequence in argument

Backtrace

./libraries/Response.class.php#370: json_encode(array)
./libraries/Response.class.php#388: PMA_Response->_ajaxResponse()
PMA_Response::response()
你能帮帮我吗?感谢

3 个答案:

答案 0 :(得分:3)

这是一个PHP 5.3.3错误。

我能够在PHP 5.3.3上重现这个问题:

openssl_encrypt(str_repeat('.', 16), 'aes-256-ecb', str_repeat('a', 32), true);

这给了我一个&#34; Warning: openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and not recommended&#34;

有趣的是,ECB模式并没有使用IV。无论如何,我试图添加一个,因此:

openssl_encrypt(str_repeat('.', 16), 'aes-256-ecb', str_repeat('a', 32), true, str_repeat('.', 16));

这给了我一个&#34; Warning: openssl_encrypt(): IV passed is 16 bytes long which is longer than the 0 expected by selected cipher, truncating&#34;。

所以无论你做什么,在PHP 5.3.3中使用ECB模式时都会出错。我甚至尝试将最后一个参数设置为''并得到关于使用空IV的第一个错误。

这不是PHP 5.3.27中的问题。

我不打算强行使用每个版本的PHP 5.3。*来查看这个修复的时间但是......我的猜测是它在5.3.7中修复了这个更改日志条目:

&#34; openssl_encrypt()/ openssl_decrypt()将可变长度的截断密钥加密到算法的OpenSSL默认值。上(Scott)&#34;

谈论密钥而不是IV,但它不是我在5.3。*系列的更改日志中找到的最接近的条目。

我的建议:在phpseclib中进行查找替换。查找所有openssl_encrypt行,并将其替换为@openssl_encrypt

真的,您只需要为ECB模式执行此操作,但我给您的说明更容易。可能还需要对openssl_decrypt执行相同的操作。也许phpseclib也应该这样做,但我认为idk ...错误抑制运算符通常不赞成,实际上是PHP 5.3.3。

答案 1 :(得分:2)

如前所述:这是PHP 5.3.3中的错误(在RHEL 6中提供)。

错误本身已在上游修复,但修复程序需要在RHEL 6中向后移植到PHP 5.3.3。错误报告已在https://bugzilla.redhat.com/show_bug.cgi?id=1260315提交 - 但为了正确确定优先顺序,受影响的红帽客户应在https://access.redhat.com创建支持票据,参考之前提到的Red Hat错误报告 - 并声明需要此修复(以及受影响的系统数量)。

答案 2 :(得分:1)

对于访问此页面的任何人寻找错误的解决方案,并使用 aes128 将其切换为 aes-256-ecb ,例如上面的neubert解决了我的错误问题。