mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-14 02:11:20 +00:00
Hash: fix issues with _computeKey
This commit is contained in:
parent
ca76d3913f
commit
492562e034
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user