diff --git a/phpseclib/Crypt/Hash.php b/phpseclib/Crypt/Hash.php index 9db55264..ae6f2c8c 100644 --- a/phpseclib/Crypt/Hash.php +++ b/phpseclib/Crypt/Hash.php @@ -112,6 +112,15 @@ class Hash */ var $key = false; + /** + * Computed Key + * + * @see self::_computeKey() + * @var string + * @access private + */ + var $computedKey = false; + /** * Outer XOR (Internal HMAC) * @@ -183,6 +192,11 @@ class Hash */ function _computeKey() { + if ($this->key === false) { + $this->computedKey = false; + return; + } + if (strlen($this->key) <= $this->b) { $this->computedKey = $this->key; return;