diff --git a/phpseclib/Crypt/Hash.php b/phpseclib/Crypt/Hash.php index 6fa4652e..fe692115 100644 --- a/phpseclib/Crypt/Hash.php +++ b/phpseclib/Crypt/Hash.php @@ -109,6 +109,15 @@ class Hash */ private $parameters = []; + /** + * Computed Key + * + * @see self::_computeKey() + * @var string + * @access private + */ + private $computedKey = false; + /** * Outer XOR (Internal HMAC) * @@ -170,6 +179,11 @@ class Hash */ private function computeKey() { + if ($this->key === false) { + $this->computedKey = false; + return; + } + if (strlen($this->key) <= $this->getBlockLengthInBytes()) { $this->computedKey = $this->key; return;