php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43466 mcrypt_generic_init requires IV in ECB mode
Submitted: 2007-12-01 00:20 UTC Modified: 2007-12-01 13:04 UTC
From: askalski at gmail dot com Assigned:
Status: Not a bug Package: mcrypt related
PHP Version: 5.2.5 OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: askalski at gmail dot com
New email:
PHP Version: OS:

 

 [2007-12-01 00:20 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-01 13:04 UTC] derick@php.net
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.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Mar 03 03:01:24 2021 UTC