From: askalski at gmail dot com Operating system: Ubuntu PHP version: 5.2.5 PHP Bug Type: mcrypt related Bug description: mcrypt_generic_init requires IV in ECB mode
Description: ------------ mcrypt_generic_init() issues a PHP warning when an empty IV is supplied (good), even in ECB mode (not so good). >From the PHP documentation: "IV is ignored in ECB." Since the IV is ignored in ECB mode, PHP should not issue any IV-related warnings. (Also tested php5.2-200711302330) Reproduce code: --------------- <?php $td = mcrypt_module_open("des", "", "ecb", ""); mcrypt_generic_init($td, "01234567", ""); ?> Expected result: ---------------- I expect the code to run without any warnings. Actual result: -------------- Warning: mcrypt_generic_init(): Iv size incorrect; supplied length: 0, needed: 8 in /tmp/php-5.2.5/ecb-test.php on line 3 -- Edit bug report at http://bugs.php.net/?id=43466&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43466&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43466&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43466&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43466&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43466&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43466&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43466&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43466&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43466&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43466&r=support Expected behavior: http://bugs.php.net/fix.php?id=43466&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43466&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43466&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43466&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43466&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43466&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43466&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43466&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43466&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43466&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43466&r=mysqlcfg