php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: robert at bsd dot hu
New email:
PHP Version: OS:

 

 [2004-12-04 13:33 UTC] robert at bsd dot hu
Description:
------------
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/libmhash.so.2.0




Reproduce code:
---------------
<?php
 $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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-04 13:58 UTC] tony2001@php.net
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] iliaa@php.net
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 http://www.php.net/support.php 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-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 09:01:27 2025 UTC