From: michael at stroeder dot com
Operating system:
PHP version: 5.2.11
PHP Bug Type: Feature/Change Request
Bug description: Support for AES-CBC in openssl_pkcs7_encrypt()
Description:
------------
openssl_pkcs7_encrypt() cannot generate encrypted S/MIME messages using
symmetric cipher AES-CBC. This patch also sets the default cipher used
which might not be want one want.
--- ext/openssl/openssl.c.orig 2009-10-26 13:46:25.000000000 +0100
+++ ext/openssl/openssl.c 2009-10-26 16:32:56.000000000 +0100
@@ -88,8 +88,9 @@
PHP_OPENSSL_CIPHER_RC2_64,
PHP_OPENSSL_CIPHER_DES,
PHP_OPENSSL_CIPHER_3DES,
+ PHP_OPENSSL_CIPHER_AES_CBC,
- PHP_OPENSSL_CIPHER_DEFAULT = PHP_OPENSSL_CIPHER_RC2_40
+ PHP_OPENSSL_CIPHER_DEFAULT = PHP_OPENSSL_CIPHER_AES_CBC
};
/* {{{ openssl_functions[]
@@ -730,6 +731,9 @@
REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_DES",
PHP_OPENSSL_CIPHER_DES, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_3DES",
PHP_OPENSSL_CIPHER_3DES, CONST_CS|CONST_PERSISTENT);
#endif
+#ifndef OPENSSL_NO_AES
+ REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_AES_CBC",
PHP_OPENSSL_CIPHER_AES_CBC, CONST_CS|CONST_PERSISTENT);
+#endif
/* Values for key types */
REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_RSA", OPENSSL_KEYTYPE_RSA,
CONST_CS|CONST_PERSISTENT);
@@ -2998,6 +3002,12 @@
break;
#endif
+#ifndef OPENSSL_NO_AES
+ case PHP_OPENSSL_CIPHER_AES_CBC:
+ cipher = EVP_aes_256_cbc();
+ break;
+#endif
+
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Invalid cipher type `%ld'", cipherid);
goto clean_exit;
--
Edit bug report at http://bugs.php.net/?id=50013&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50013&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50013&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50013&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50013&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50013&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50013&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50013&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50013&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50013&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50013&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50013&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50013&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50013&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50013&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50013&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50013&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50013&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50013&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50013&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50013&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50013&r=mysqlcfg