|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-12-01 13:04 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
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