diff --git a/phpseclib/Crypt/Base.php b/phpseclib/Crypt/Base.php index 7c9032f0..acfb6d4d 100644 --- a/phpseclib/Crypt/Base.php +++ b/phpseclib/Crypt/Base.php @@ -620,7 +620,7 @@ abstract class Base $count = isset($func_args[4]) ? $func_args[4] : 1000; // Keylength - if (isset($func_args[5])) { + if (isset($func_args[5]) && $func_args[5] > 0) { $dkLen = $func_args[5]; } else { $dkLen = $method == 'pbkdf1' ? 2 * $this->key_length : $this->key_length;