diff --git a/lib/Crypto/Crypt.php b/lib/Crypto/Crypt.php index cd4e176..25c898d 100644 --- a/lib/Crypto/Crypt.php +++ b/lib/Crypto/Crypt.php @@ -262,7 +262,7 @@ private function encrypt($plainContent, $iv, $passPhrase = '', $cipher = self::D $iv ); - if (!$encryptedContent) { + if ($encryptedContent === false) { $error = 'Encryption (symmetric) of content failed'; $this->logger->error( $error . \openssl_error_string(), @@ -628,11 +628,11 @@ private function decrypt($encryptedContent, $iv, $passPhrase = '', $cipher = sel $iv ); - if ($plainContent) { - return $plainContent; - } else { + if ($plainContent === false) { throw new DecryptionFailedException('Encryption library: Decryption (symmetric) of content failed: ' . \openssl_error_string()); } + + return $plainContent; } /**