mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-26 19:40:28 +00:00
Crypt/Base: if derived key length is 0 or less use hash length
This commit is contained in:
parent
2d7aadc689
commit
f0f7350045
@ -661,7 +661,7 @@ class Crypt_Base
|
|||||||
$count = isset($func_args[4]) ? $func_args[4] : 1000;
|
$count = isset($func_args[4]) ? $func_args[4] : 1000;
|
||||||
|
|
||||||
// Keylength
|
// Keylength
|
||||||
if (isset($func_args[5])) {
|
if (isset($func_args[5]) && $func_args[5] > 0) {
|
||||||
$dkLen = $func_args[5];
|
$dkLen = $func_args[5];
|
||||||
} else {
|
} else {
|
||||||
$dkLen = $method == 'pbkdf1' ? 2 * $this->key_length : $this->key_length;
|
$dkLen = $method == 'pbkdf1' ? 2 * $this->key_length : $this->key_length;
|
||||||
|
Loading…
Reference in New Issue
Block a user