#43466 [Opn->Bgs]: mcrypt_generic_init requires IV in ECB mode

From: Date: Sat, 01 Dec 2007 13:04:37 +0000
Subject: #43466 [Opn->Bgs]: mcrypt_generic_init requires IV in ECB mode
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120264@lists.php.net to get a copy of this message
ID: 43466 Updated by: derick@php.net Reported By: askalski at gmail dot com -Status: Open +Status: Bogus Bug Type: mcrypt related Operating System: Ubuntu PHP Version: 5.2.5 New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. Duplicate of #43143. Previous Comments: ------------------------------------------------------------------------ [2007-12-01 00:20:17] askalski at gmail dot com 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 this bug report at http://bugs.php.net/?id=43466&edit=1

« previous php.bugs (#120264) next »