From f0f7350045fb45da973c5414b842e3ff2c92f5b7 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 13 Oct 2018 08:10:34 -0500 Subject: [PATCH] Crypt/Base: if derived key length is 0 or less use hash length --- phpseclib/Crypt/Base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/Crypt/Base.php b/phpseclib/Crypt/Base.php index a4ea784c..97a61871 100644 --- a/phpseclib/Crypt/Base.php +++ b/phpseclib/Crypt/Base.php @@ -661,7 +661,7 @@ class Crypt_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;