com php-src: Merge branch 'PHP-7.0' into PHP-7.1: NEWS ext/mcrypt/mcrypt.c ext/mcrypt/tests/bug67707.phpt
| From: | Nikita Popov | Date: | Tue, 10 Jan 2017 22:44:45 +0000 |
| Subject: | com php-src: Merge branch 'PHP-7.0' into PHP-7.1: NEWS ext/mcrypt/mcrypt.c ext/mcrypt/tests/bug67707.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96682@lists.php.net to get a copy of this message | ||
Commit: 599987488694c4e3d0299ceeb0e6a8341c853982
Author: Nikita Popov <nikic@php.net> Tue, 10 Jan 2017 23:44:45 +0100
Parents: 5cee9dfe9a479c15d08f66a4baca83ed4e7ed288 d9cd2876d97d79029a980e7c89aa441fd46a4bf2
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=599987488694c4e3d0299ceeb0e6a8341c853982
Log:
Merge branch 'PHP-7.0' into PHP-7.1
Changed paths:
MM NEWS
MM ext/mcrypt/mcrypt.c
AM ext/mcrypt/tests/bug67707.phpt
Diff:
diff --cc NEWS
index 2f74991,7e0d1ac..48643b5
--- a/NEWS
+++ b/NEWS
@@@ -16,9 -14,16 +16,13 @@@ PH
- GD:
. Fixed bug #73893 (A hidden danger of death cycle in a function of gd). (cmb)
-- FPM:
- . Fixed bug #67583 (double fastcgi_end_request on max_children limit).
- (Dmitry Saprykin)
-
+ - MCrypt:
+ . Fixed bug #67707 (IV not needed for ECB encryption mode, but it returns a
+ warning). (Robrecht Plaisier)
+
- OpenSSL:
. Fixed bug #71519 (add serial hex to return value array). (xrobau)
+ . Fixed bug #73692 (Compile ext/openssl with openssl 1.1.0 on Win). (Anatol)
- PDO_Firebird:
. Implemented FR #72583 (All data are fetched as strings). (Dorin Marcoci)
diff --cc ext/mcrypt/mcrypt.c
index 658046c,c589b40..3a17d6d
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@@ -571,9 -571,11 +571,11 @@@ PHP_FUNCTION(mcrypt_generic_init
}
memcpy(key_s, key, key_len);
- if (iv_len != iv_size) {
+ if (iv_len != (size_t)iv_size) {
- php_error_docref(NULL, E_WARNING, "Iv size incorrect; supplied length: %zd, needed:
%d", iv_len, iv_size);
+ if (mcrypt_enc_mode_has_iv(pm->td)) {
+ php_error_docref(NULL, E_WARNING, "Iv size incorrect; supplied length: %zd, needed:
%d", iv_len, iv_size);
+ }
- if (iv_len > iv_size) {
+ if (iv_len > (size_t)iv_size) {
iv_len = iv_size;
}
}
diff --cc ext/mcrypt/tests/bug67707.phpt
index 0000000,9ba13ab..928c542
mode 000000,100644..100644
--- a/ext/mcrypt/tests/bug67707.phpt
+++ b/ext/mcrypt/tests/bug67707.phpt
@@@ -1,0 -1,10 +1,13 @@@
+ --TEST--
+ Bug #67707 IV not needed for ECB encryption mode, but it returns a warning
+ --SKIPIF--
+ <?php if (!extension_loaded("mcrypt")) print "skip"; ?>
+ --FILE--
+ <?php
+ $td = mcrypt_module_open('rijndael-256', '', 'ecb', '');
+ mcrypt_generic_init($td, 'secret key', NULL);
+ ?>
+ --EXPECTF--
++Deprecated: Function mcrypt_module_open() is deprecated in %s on line %d
++
++Deprecated: Function mcrypt_generic_init() is deprecated in %s on line %d