Skip to content

Commit

Permalink
Upstream fix: Add support for Blowfish and Twofish ciphers
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Apr 16, 2015
1 parent 73b6b48 commit 8e18490
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions framework/Pgp/bundle/CHANGED
Expand Up @@ -17,5 +17,7 @@ List of changes from upstream sources:

Added support for using the openssl extension to parse CAST128 data
(OpenPGP_Crypt_Symmetric::getCipher()).
Added support for the Blowfish and Twofish ciphers
(OpenPGP_Crypt_Symmetric::getCipher()).
Fix setting salt size in S2K object when symmetrically encrypting
(OpenPGP_Crypt_Symmetric::encrypt()).
Expand Up @@ -159,6 +159,12 @@ public static function getCipher($algo) {
}
/* End Horde Change */
break;
/* Horde change */
case 4:
$cipher = new Crypt_Blowfish(CRYPT_BLOWFISH_MODE_CFB);
$key_bytes = 16;
break;
/* End Horde Change */
case 7:
if(class_exists('Crypt_AES')) {
$cipher = new Crypt_AES(CRYPT_AES_MODE_CFB);
Expand All @@ -177,6 +183,12 @@ public static function getCipher($algo) {
$cipher->setKeyLength(256);
}
break;
/* Horde change */
case 10:
$cipher = new Crypt_Twofish(CRYPT_TWOFISH_MODE_CFB);
$key_bytes = 32;
break;
/* End Horde Change */
}
if(!$cipher) return array(NULL, NULL, NULL); // Unsupported cipher
if(!isset($key_bytes)) $key_bytes = $cipher->key_size;
Expand Down

0 comments on commit 8e18490

Please sign in to comment.