From: dylan at wedefy dot com
Operating system: Windows XP
PHP version: 5.2.4
PHP Bug Type: mcrypt related
Bug description: Warning about empty IV with MCRYPT_MODE_ECB.
Description:
------------
This warning makes sense for the other block cipher modes, but when using
MCRYPT_MODE_ECB the initialization vector is not used at all, so it is
misleading to recommend using one. In fact there should be a
notice/warning when an IV is supplied with mode MCRYPT_MODE_ECB to alert
that the IV is ignored.
Reproduce code:
---------------
<?php
$input = 'to be encrypted';
$mkey = hash('sha256', 'secret key', TRUE);
$data = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $mkey, $input,
MCRYPT_MODE_ECB);
?>
Expected result:
----------------
no warning
Actual result:
--------------
PHP Warning: mcrypt_encrypt(): Attempt to use an empty IV, which is NOT
recommend
--
Edit bug report at http://bugs.php.net/?id=43143&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43143&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43143&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43143&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43143&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43143&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43143&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43143&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43143&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43143&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43143&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43143&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43143&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43143&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43143&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43143&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43143&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43143&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43143&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43143&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43143&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43143&r=mysqlcfg