Hash: fix issues with _computeKey

This commit is contained in:
terrafrost 2019-03-08 08:34:33 -06:00
parent ca76d3913f
commit 492562e034

View File

@ -216,7 +216,7 @@ class Crypt_Hash
*
* @access private
*/
function _computeKey()
function _computeKey($mode)
{
if ($this->key === false) {
$this->computedKey = false;
@ -332,7 +332,7 @@ class Crypt_Hash
default:
$this->hash = MHASH_SHA1;
}
$this->_computeKey();
$this->_computeKey(CRYPT_HASH_MODE_MHASH);
return;
case CRYPT_HASH_MODE_HASH:
switch ($hash) {
@ -349,7 +349,7 @@ class Crypt_Hash
default:
$this->hash = 'sha1';
}
$this->_computeKey();
$this->_computeKey(CRYPT_HASH_MODE_HASH);
return;
}
@ -375,7 +375,7 @@ class Crypt_Hash
$this->ipad = str_repeat(chr(0x36), $this->b);
$this->opad = str_repeat(chr(0x5C), $this->b);
$this->_computeKey();
$this->_computeKey(CRYPT_HASH_MODE_INTERNAL);
}
/**