mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-11 08:10:58 +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
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _computeKey()
|
function _computeKey($mode)
|
||||||
{
|
{
|
||||||
if ($this->key === false) {
|
if ($this->key === false) {
|
||||||
$this->computedKey = false;
|
$this->computedKey = false;
|
||||||
@ -332,7 +332,7 @@ class Crypt_Hash
|
|||||||
default:
|
default:
|
||||||
$this->hash = MHASH_SHA1;
|
$this->hash = MHASH_SHA1;
|
||||||
}
|
}
|
||||||
$this->_computeKey();
|
$this->_computeKey(CRYPT_HASH_MODE_MHASH);
|
||||||
return;
|
return;
|
||||||
case CRYPT_HASH_MODE_HASH:
|
case CRYPT_HASH_MODE_HASH:
|
||||||
switch ($hash) {
|
switch ($hash) {
|
||||||
@ -349,7 +349,7 @@ class Crypt_Hash
|
|||||||
default:
|
default:
|
||||||
$this->hash = 'sha1';
|
$this->hash = 'sha1';
|
||||||
}
|
}
|
||||||
$this->_computeKey();
|
$this->_computeKey(CRYPT_HASH_MODE_HASH);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,7 +375,7 @@ class Crypt_Hash
|
|||||||
$this->ipad = str_repeat(chr(0x36), $this->b);
|
$this->ipad = str_repeat(chr(0x36), $this->b);
|
||||||
$this->opad = str_repeat(chr(0x5C), $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