From de41f143e62346f2b1fce2ede32f06b860734f33 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 26 Jul 2016 18:44:49 -0500 Subject: [PATCH] Throw exception if using CAST5 without mcrypt --- lib/openpgp_crypt_symmetric.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/openpgp_crypt_symmetric.php b/lib/openpgp_crypt_symmetric.php index 120d4d9..844c53b 100644 --- a/lib/openpgp_crypt_symmetric.php +++ b/lib/openpgp_crypt_symmetric.php @@ -154,6 +154,8 @@ class OpenPGP_Crypt_Symmetric { case 3: if(defined('MCRYPT_CAST_128')) { $cipher = new MCryptWrapper(MCRYPT_CAST_128); + } else { + throw new Exception("Unsupported cipher: you must have mcrypt installed to use CAST5"); } break; case 7: