From: Nikita Popov Date: Tue, 10 Jan 2017 22:44:45 +0000 (+0100) Subject: Merge branch 'PHP-7.0' into PHP-7.1 X-Git-Tag: php-7.1.2RC1~93^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=599987488694c4e3d0299ceeb0e6a8341c853982;p=php Merge branch 'PHP-7.0' into PHP-7.1 --- 599987488694c4e3d0299ceeb0e6a8341c853982 diff --cc NEWS index 2f74991471,7e0d1ac432..48643b5c7c --- 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 658046cf98,c589b40fab..3a17d6dfa1 --- 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 0000000000,9ba13ab0ac..928c542aee 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-- + + --FILE-- + + --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