php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46834 Range of mcrypt functions fail on PHP 6.0
Submitted: 2008-12-11 10:39 UTC Modified: 2010-06-13 18:34 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: ant@php.net Assigned: derick (profile)
Status: Wont fix Package: mcrypt related
PHP Version: 6CVS-2008-12-11 (snap) OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-12-11 10:39 UTC] ant@php.net
Description:
------------
A range of PHPTs fail on PHP 6 where they pass on PHP 5.2/5.3. In 
many cases it looks like the function returns different output from 
encryption/decryption calls. The following failing tests are all 
checked into PHP 6 and marked with an XFAIL section:

mcrypt_cbc_3des_encrypt.phpt
mcrypt_cbc_3des_decrypt.phpt
mcrypt_cbc_variation4.phpt
mcrypt_cbc_variation5.phpt
mcrypt_rijndael128_128BitKey.phpt
mcrypt_rijndael128_256BitKey.phpt
mcrypt_decrypt_3des_cbc.phpt
mcrypt_decrypt_variation5.phpt
mcrypt_encrypt_3des_cbc.phpt
mcrypt_encrypt_variation5.phpt
mcrypt_ecb_variation4.phpt

The problem may be common to all the failing tests and looks like 
something has changed with different length initialisation vectors.

Reproduce code:
---------------
(See the tests checked into CVS)

Expected result:
----------------
For example, the mcrypt_cbc_3des_decrypt.phpt test expects:

--- testing different iv lengths

iv length=4

Warning: mcrypt_cbc(): The IV parameter must be as long as the 
blocksize in %s on line %d
unicode(32) "736563726574206d6573736167650000"

iv length=8
unicode(32) "736563726574206d6573736167650000"

iv length=9

Warning: mcrypt_cbc(): The IV parameter must be as long as the 
blocksize in %s on line %d
unicode(32) "736563726574206d6573736167650000"




Actual result:
--------------
iv length=4

Warning: mcrypt_cbc(): The IV parameter must be as long as the 
blocksize in D:\Testing\php-6.0\mcrypt_cbc_3des_decrypt.php on line 
52
unicode(32) "425750466574206d6573736167650000"

iv length=8
unicode(32) "736563726574206d6573736167650000"

iv length=9

Warning: mcrypt_cbc(): The IV parameter must be as long as the 
blocksize in D:\Testing\php-6.0\mcrypt_cbc_3des_decrypt.php on line 
52
unicode(32) "42575046504217556573736167650000"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-13 18:34 UTC] felipe@php.net
-Status: Assigned +Status: Wont fix
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC