Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.1

Bug #3531 Key isnt padded when the original length > 64
Submitted: 2005-02-20 12:56 UTC
From: Jared dot Williams1 at ntlworld dot com Assigned: mfonda
Status: Closed Package: Crypt_HMAC
PHP Version: Irrelevant OS: Windows 2000/IIS
Roadmaps: (Not assigned)    
Subscription  


 [2005-02-20 12:56 UTC] Jared dot Williams1 at ntlworld dot com
Description: ------------ Probably a minor issue, but when a key is reduced in length via the hash function, it then requires padding. $key = (strlen($key) > 64) ? pack($this->_pack, $func($key)) : str_pad($key, 64, chr(0)); Should be something like... if (strlen($key) > 64) $key = pack($this->_pack, $func($key)); if (strlen($key) < 64) $key = str_pad($key, 64, chr(0));

Comments

 [2005-02-20 19:19 UTC] mfonda
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better. Bug has been fixed in CVS, will be updated in next release