php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60922 tests fail for mhash() and mhash_keygen_s2k() functions and MHASH_TIGER
Submitted: 2012-01-29 10:53 UTC Modified: 2012-03-19 20:54 UTC
From: silvan at etoy dot com Assigned: mike (profile)
Status: Closed Package: mhash related
PHP Version: 5.4SVN-2012-01-29 (SVN) OS: Mac OS X
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: silvan at etoy dot com
New email:
PHP Version: OS:

 

 [2012-01-29 10:53 UTC] silvan at etoy dot com
Description:
------------
make test failed test summary:
mhash() test [ext/hash/tests/mhash_001.phpt]
mhash_keygen_s2k() test [ext/hash/tests/mhash_003.phpt

mhash_003.out:
MHASH_TIGER: string(200) "67eac97b9dca0a47b1f6262f330264e4ce1c233760fe3255f642512fd3127929baccf1e758236b2768a4c2c0c06e118b19e40e2f04a5f745820fb8a99bdbc00698702a4d3120171856c4c94bda79ba1b4f60d509d7f8954da818a29797368dd47c1122aa"
MHASH_TIGER: string(200) "470aca9d7bc9ea67e46402332f26f6b15532fe6037231cce297912d32f5142f6276b2358e7f1ccba8b116ec0c0c2a46845f7a5042f0ee41906c0db9ba9b80f82181720314d2a70981bba79da4bc9c4564d95f8d709d5604fd48d369797a218a862196f48"

Test script:
---------------
mhash_003.php
foreach ($supported_hash_al as $hash=>$wanted) {
	$passwd = str_repeat($hash, 10);
	$salt = str_repeat($hash, 2);
	$result = mhash_keygen_s2k(constant($hash), $passwd, $salt, 100);
	if (!strcmp(bin2hex($result), $wanted)) {
		echo "$hash\nok\n";
	} else {
		echo "$hash: ";
		var_dump($wanted);
		echo "$hash: ";
		var_dump(bin2hex($result));
	}
	echo "\n";
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-30 12:35 UTC] mike@php.net
Oh my, mhash compat mode of ext/hash eh? 

I totally missed that while fixing bug #60221.
 [2012-01-30 12:35 UTC] mike@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: mike
 [2012-01-31 10:29 UTC] jamie-lists at boxlightmedia dot com
Also failing for me on 5.4RC6 (PHP 5.4.0-rc6-pl0-gentoo (cli) (built: Jan 30 2012 
11:59:37) 

Result
-------

MHASH_GOST
ok

MHASH_TIGER: string(48) "fdb9019a79c33a95677e2097abae91eb0de00b3054bb5c39"
MHASH_TIGER: string(48) "953ac3799a01b9fdeb91aeab97207e67395cbb54300be00d"

If I swap back to PHP 5.3.9-pl0-gentoo (cli) (built: Jan 30 2012 13:21:46), it 
returns the correct hash.
 [2012-03-19 20:54 UTC] mike@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-03-19 20:54 UTC] mike@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC