Throw more helpful exception when already decrypted

This commit is contained in:
Stephen Paul Weber
2018-07-25 09:56:57 -05:00
parent a9fc3f9322
commit 413741fa84
2 changed files with 10 additions and 0 deletions

View File

@@ -146,6 +146,9 @@ class OpenPGP_Crypt_Symmetric {
public static function getCipher($algo) {
$cipher = NULL;
switch($algo) {
case NULL:
case 0:
throw new Exception("Data is already unencrypted");
case 2:
$cipher = new Crypt_TripleDES(CRYPT_DES_MODE_CFB);
$key_bytes = 24;