[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/openssl openssl.c

2008-09-18 Thread Scott MacVicar
scottmacThu Sep 18 16:09:19 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
/php-src/ext/opensslopenssl.c 
  Log:
  MFH: Show the library version currently loaded as well as the version the 
extension was compiled with. Useful for checking PHP is using the latest 
version.
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.325r2=1.2027.2.547.2.965.2.326diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.325 
php-src/NEWS:1.2027.2.547.2.965.2.326
--- php-src/NEWS:1.2027.2.547.2.965.2.325   Thu Sep 18 11:59:13 2008
+++ php-src/NEWSThu Sep 18 16:09:18 2008
@@ -6,6 +6,8 @@
 - Changed error level E_ERROR into E_WARNING in Soap extension methods 
   parameter validation. (Felipe)
 
+- Changed openssl info to show the shared library version number. (Scott)
+
 - Fixed bug causing the algorithm parameter of mhash() to be modified. (Scott)
 
 - Fixed bug #46106 (Memory leaks when using global statement). (Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.98.2.5.2.41.2.16r2=1.98.2.5.2.41.2.17diff_format=u
Index: php-src/ext/openssl/openssl.c
diff -u php-src/ext/openssl/openssl.c:1.98.2.5.2.41.2.16 
php-src/ext/openssl/openssl.c:1.98.2.5.2.41.2.17
--- php-src/ext/openssl/openssl.c:1.98.2.5.2.41.2.16Wed Jul 30 11:59:05 2008
+++ php-src/ext/openssl/openssl.c   Thu Sep 18 16:09:19 2008
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: openssl.c,v 1.98.2.5.2.41.2.16 2008/07/30 11:59:05 tony2001 Exp $ */
+/* $Id: openssl.c,v 1.98.2.5.2.41.2.17 2008/09/18 16:09:19 scottmac Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1092,7 +1092,8 @@
 {
php_info_print_table_start();
php_info_print_table_row(2, OpenSSL support, enabled);
-   php_info_print_table_row(2, OpenSSL Version, OPENSSL_VERSION_TEXT);
+   php_info_print_table_row(2, OpenSSL Library Version, 
SSLeay_version(SSLEAY_VERSION));
+   php_info_print_table_row(2, OpenSSL Header Version, 
OPENSSL_VERSION_TEXT);
php_info_print_table_end();
 }
 /* }}} */



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



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/openssl openssl.c

2007-09-27 Thread Dmitry Stogov
dmitry  Thu Sep 27 08:46:00 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
/php-src/ext/opensslopenssl.c 
  Log:
  MFH: Improved ext/openssl
  . Added support for OpenSSL digest functions
  . Added support for OpenSSL cipher functions
  . Added access to internal values of DSA, RSA and DH keys
  
  http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.2r2=1.2027.2.547.2.965.2.3diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.2 php-src/NEWS:1.2027.2.547.2.965.2.3
--- php-src/NEWS:1.2027.2.547.2.965.2.2 Thu Sep 27 08:23:58 2007
+++ php-src/NEWSThu Sep 27 08:45:59 2007
@@ -1,6 +1,10 @@
 PHPNEWS
 |||
 ?? ??? 20??, PHP 5.3.0
+- Improved ext/openssl (Dmitry)
+  . Added support for OpenSSL digest functions
+  . Added support for OpenSSL cipher functions
+  . Added access to internal values of DSA, RSA and DH keys
 - Improved and cleaned CGI code. FastCGI is now always enabled and can not be
   disabled. See sapi/cgi/CHANGES for more details. (Dmitry)
 - Added support for dynamic access of static members using $foo::myFunc().
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.98.2.5.2.41r2=1.98.2.5.2.41.2.1diff_format=u
Index: php-src/ext/openssl/openssl.c
diff -u php-src/ext/openssl/openssl.c:1.98.2.5.2.41 
php-src/ext/openssl/openssl.c:1.98.2.5.2.41.2.1
--- php-src/ext/openssl/openssl.c:1.98.2.5.2.41 Wed Aug  8 06:29:46 2007
+++ php-src/ext/openssl/openssl.c   Thu Sep 27 08:46:00 2007
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: openssl.c,v 1.98.2.5.2.41 2007/08/08 06:29:46 pajoye Exp $ */
+/* $Id: openssl.c,v 1.98.2.5.2.41.2.1 2007/09/27 08:46:00 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -33,6 +33,8 @@
 #include ext/standard/file.h
 #include ext/standard/info.h
 #include ext/standard/php_fopen_wrappers.h
+#include ext/standard/md5.h
+#include ext/standard/base64.h
 
 /* OpenSSL includes */
 #include openssl/evp.h
@@ -88,6 +90,15 @@
PHP_OPENSSL_CIPHER_DEFAULT = PHP_OPENSSL_CIPHER_RC2_40
 };
 
+PHP_FUNCTION(openssl_get_md_methods);
+PHP_FUNCTION(openssl_get_cipher_methods);
+
+PHP_FUNCTION(openssl_digest);
+PHP_FUNCTION(openssl_encrypt);
+PHP_FUNCTION(openssl_decrypt);
+
+PHP_FUNCTION(openssl_dh_compute_key);
+
 /* {{{ openssl_functions[]
  */
 zend_function_entry openssl_functions[] = {
@@ -126,10 +137,13 @@
PHP_FE(openssl_csr_get_subject, NULL)
PHP_FE(openssl_csr_get_public_key,  NULL)
 
-   PHP_FE(openssl_sign,second_arg_force_ref)
-   PHP_FE(openssl_verify,  NULL)
-   PHP_FE(openssl_seal,arg2and3_force_ref)
-   PHP_FE(openssl_open,second_arg_force_ref)
+   PHP_FE(openssl_digest,  NULL)
+   PHP_FE(openssl_encrypt, NULL)
+   PHP_FE(openssl_decrypt, NULL)
+   PHP_FE(openssl_sign,second_arg_force_ref)
+   PHP_FE(openssl_verify,  NULL)
+   PHP_FE(openssl_seal,arg2and3_force_ref)
+   PHP_FE(openssl_open,second_arg_force_ref)
 
 /* for S/MIME handling */
PHP_FE(openssl_pkcs7_verify,NULL)
@@ -142,6 +156,11 @@
PHP_FE(openssl_public_encrypt,  second_arg_force_ref)
PHP_FE(openssl_public_decrypt,  second_arg_force_ref)
 
+   PHP_FE(openssl_get_md_methods,  NULL)
+   PHP_FE(openssl_get_cipher_methods,  NULL)
+
+   PHP_FE(openssl_dh_compute_key,  NULL)
+
PHP_FE(openssl_error_string, NULL)
{NULL, NULL, NULL}
 };
@@ -645,6 +664,34 @@
return mdtype;
 }
 /* }}} */
+
+static const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(long algo) { /* 
{{{ */
+   switch (algo) {
+#ifndef OPENSSL_NO_RC2
+   case PHP_OPENSSL_CIPHER_RC2_40:
+   return EVP_rc2_40_cbc();
+   break;
+   case PHP_OPENSSL_CIPHER_RC2_64:
+   return EVP_rc2_64_cbc();
+   break;
+   case PHP_OPENSSL_CIPHER_RC2_128:
+   return EVP_rc2_cbc();
+   break;
+#endif
+
+#ifndef OPENSSL_NO_DES
+   case PHP_OPENSSL_CIPHER_DES:
+   return EVP_des_cbc();
+   break;
+   case PHP_OPENSSL_CIPHER_3DES:
+   return EVP_des_ede3_cbc();
+   break;
+#endif
+   default:
+   return NULL;
+   break;
+   }
+}
 /* }}} */
 
 /* {{{ PHP_MINIT_FUNCTION
@@ -2433,6 +2480,25 @@
}