pajoye          Sat May 19 22:04:28 2007 UTC

  Modified files:              
    /php-src/ext/openssl        openssl.c 
  Log:
  - #41423, PHP assumes wrongly that certain ciphers are enabled in OpenSSL
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.137&r2=1.138&diff_format=u
Index: php-src/ext/openssl/openssl.c
diff -u php-src/ext/openssl/openssl.c:1.137 php-src/ext/openssl/openssl.c:1.138
--- php-src/ext/openssl/openssl.c:1.137 Thu Apr  5 18:09:48 2007
+++ php-src/ext/openssl/openssl.c       Sat May 19 22:04:27 2007
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: openssl.c,v 1.137 2007/04/05 18:09:48 rrichards Exp $ */
+/* $Id: openssl.c,v 1.138 2007/05/19 22:04:27 pajoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -693,11 +693,15 @@
        REGISTER_LONG_CONSTANT("OPENSSL_PKCS1_OAEP_PADDING", 
RSA_PKCS1_OAEP_PADDING, CONST_CS|CONST_PERSISTENT);
 
        /* Ciphers */
+#ifndef OPENSSL_NO_RC2
        REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_RC2_40", 
PHP_OPENSSL_CIPHER_RC2_40, CONST_CS|CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_RC2_128", 
PHP_OPENSSL_CIPHER_RC2_128, CONST_CS|CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("OPENSSL_CIPHER_RC2_64", 
PHP_OPENSSL_CIPHER_RC2_64, CONST_CS|CONST_PERSISTENT);
+#endif
+#ifndef OPENSSL_NO_DES
        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
 
        /* Values for key types */
        REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_RSA", OPENSSL_KEYTYPE_RSA, 
CONST_CS|CONST_PERSISTENT);
@@ -2930,6 +2934,7 @@
 
        /* sanity check the cipher */
        switch (cipherid) {
+#ifndef OPENSSL_NO_RC2
                case PHP_OPENSSL_CIPHER_RC2_40:
                        cipher = EVP_rc2_40_cbc();
                        break;
@@ -2939,12 +2944,17 @@
                case PHP_OPENSSL_CIPHER_RC2_128:
                        cipher = EVP_rc2_cbc();
                        break;
+#endif
+
+#ifndef OPENSSL_NO_DES
                case PHP_OPENSSL_CIPHER_DES:
                        cipher = EVP_des_cbc();
                        break;
                case PHP_OPENSSL_CIPHER_3DES:
                        cipher = EVP_des_ede3_cbc();
                        break;
+#endif
+
                default:
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 
cipher type `%ld'", cipherid);
                        goto clean_exit;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to