From 271ce27ceee4749c667b3d0b51be8947c915472d Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 7 Apr 2010 10:26:56 -0600 Subject: [PATCH] Key can't be empty when passing to Crypt_Blowfish --- framework/Secret/lib/Horde/Secret.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/Secret/lib/Horde/Secret.php b/framework/Secret/lib/Horde/Secret.php index 72fcd164e..104dd5411 100644 --- a/framework/Secret/lib/Horde/Secret.php +++ b/framework/Secret/lib/Horde/Secret.php @@ -72,7 +72,7 @@ class Horde_Secret { $val = strlen($key) ? $this->_getCipherOb($key)->encrypt($message) - : false; + : ''; if ($val instanceof PEAR_Error) { throw new Horde_Secret_Exception($val); @@ -92,7 +92,9 @@ class Horde_Secret */ public function read($key, $ciphertext) { - $val = $this->_getCipherOb($key)->decrypt($ciphertext); + $val = strlen($key) + ? $this->_getCipherOb($key)->decrypt($ciphertext) + : ''; if ($val instanceof PEAR_Error) { throw new Horde_Secret_Exception($val); -- 2.11.0