From 2cc785fc540b534080c728c84c59182bb6e1b0d1 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Wed, 6 Sep 2023 09:09:11 -0500 Subject: [PATCH] Rijndael: fix E_DEPRECATED bfba3db1a70dc234b87fbca7d382607ae378fed1 removed setKey() from the 1.0 branch, however, 5321b9b6106300f52b0a53ee3b269aae5cd32e5d reintroduced it. that merge commit had conflicts and the conflicts were (apparently) inappropriately resolved --- phpseclib/Crypt/Rijndael.php | 41 ------------------------------------ 1 file changed, 41 deletions(-) diff --git a/phpseclib/Crypt/Rijndael.php b/phpseclib/Crypt/Rijndael.php index a8068b7b..7e146015 100644 --- a/phpseclib/Crypt/Rijndael.php +++ b/phpseclib/Crypt/Rijndael.php @@ -241,47 +241,6 @@ class Crypt_Rijndael extends Crypt_Base */ var $kl; - /** - * Sets the key. - * - * Keys can be of any length. Rijndael, itself, requires the use of a key that's between 128-bits and 256-bits long and - * whose length is a multiple of 32. If the key is less than 256-bits and the key length isn't set, we round the length - * up to the closest valid key length, padding $key with null bytes. If the key is more than 256-bits, we trim the - * excess bits. - * - * If the key is not explicitly set, it'll be assumed to be all null bytes. - * - * Note: 160/224-bit keys must explicitly set by setKeyLength(), otherwise they will be round/pad up to 192/256 bits. - * - * @see Crypt_Base:setKey() - * @see self::setKeyLength() - * @access public - * @param string $key - */ - function setKey($key) - { - if (!$this->explicit_key_length) { - $length = strlen($key); - switch (true) { - case $length <= 16: - $this->key_size = 16; - break; - case $length <= 20: - $this->key_size = 20; - break; - case $length <= 24: - $this->key_size = 24; - break; - case $length <= 28: - $this->key_size = 28; - break; - default: - $this->key_size = 32; - } - } - parent::setKey($key); - } - /** * Sets the key length *