Home » Encryption » Crypt_HMAC » Bug #3531
Key isnt padded when the original length > 64
Details
| 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) |
Comments
[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));