|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30983 Returns zeros instead of the hash
Submitted: 2004-12-04 13:33 UTC Modified: 2004-12-05 18:36 UTC
From: robert at bsd dot hu Assigned:
Status: Not a bug Package: mhash related
PHP Version: Irrelevant OS: OpenBSD
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.
Block user comment
Status: Assign to:
Bug Type:
From: robert at bsd dot hu
New email:
PHP Version: OS:


 [2004-12-04 13:33 UTC] robert at bsd dot hu
Configure arguments:
--with-apxs=/usr/sbin/apxs  --without-mysql  --enable-xml  --enable-wddx  --enable-cli  --with-iconv=/usr/local  --with-gettext=/usr/local  --enable-dio  --with-pear=/var/www/pear  --enable-bcmath  --enable-session  --enable-trans-sid  --enable-calendar  --enable-ctype  --enable-ftp  --with-pcre-regex  --with-posix  --enable-sockets  --enable-sysvsem  --enable-sysvshm  --enable-yp  --enable-exif --enable-shared  --disable-static  --disable-rpath  --with-config-file-path=/var/www/conf  --enable-inline-optimization  --with-pic --with-openssl  --with-zlib --prefix='/usr/local' --sysconfdir='/etc' --without-bz2 --without-curl --disable-dba --disable-dbase --disable-dbx --disable-dom --disable-filepro --without-gd --without-xpm-dir --without-ttf  --without-freetype-dir --without-gmp --without-imap --without-kerberos --without-ldap --without-mcrypt --with-mhash=shared,/usr/local --without-mysql --without-ncurses --without-odbc --without-pdflib --without-pgsql --disable-shmop --without-snmp --without-sybase-ct --without-xmlrpc --disable-xslt --enable-shared  --disable-static  --disable-rpath

Mhash library:
version: 0.9.1
209:-lmhash.2.0 => /usr/local/lib/

Reproduce code:
 $input = "what do ya want for nothing?";
 $hash = mhash(MHASH_MD5, $input);
 echo "The hash is " . bin2hex($hash) . "<br />\n";
 $hash = mhash(MHASH_MD5, $input, "Jefe");
 echo "The hmac is " . bin2hex($hash) . "<br />\n";

Expected result:
The correct hash.

Actual result:
The hash is 00000000000000000000000000000000
The hmac is 00000000000000000000000000000000


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-04 13:58 UTC]
Please, indicate what version are you using.
I can't reproduce it under Linux, PHP 5.1.0-dev & mhash 0.9.1.
 [2004-12-04 14:05 UTC] robert at bsd dot hu
I've tested it with 4.3.9 and 5.0.2. And it seems that it only affects OpenBSD.
 [2004-12-05 18:36 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

I'd say that this is a problem with the libmhash that you are using.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Aug 11 15:05:43 2022 UTC