[PHP-CVS] com php-src: commit for php bug 61421 enabling SHA2 and RMD160 for openssl signature verification: ext/openssl/openssl.c

2012-09-16 Thread Stanislav Malyshev
Commit:84202c367e4a7c6db8228af223c3ed9a112335a3
Author:Mark Jones mjones@i5.(none) Fri, 14 Sep 2012 08:59:14 -0600
Committer: Stanislav Malyshev s...@php.net  Sat, 15 Sep 2012 22:59:34 
-0700
Parents:   ee620e96736024218f50a6ff5267127509fd68d8
Branches:  PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=84202c367e4a7c6db8228af223c3ed9a112335a3

Log:
commit for php bug 61421
enabling SHA2 and RMD160 for openssl signature verification

Bugs:
https://bugs.php.net/61421

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 7187a96..2b8cfd5 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -69,7 +69,13 @@
 #define OPENSSL_ALGO_MD2   4
 #endif
 #define OPENSSL_ALGO_DSS1  5
-
+#if OPENSSL_VERSION_NUMBER = 0x0090708fL
+#define OPENSSL_ALGO_SHA224 6
+#define OPENSSL_ALGO_SHA256 7
+#define OPENSSL_ALGO_SHA384 8
+#define OPENSSL_ALGO_SHA512 9
+#define OPENSSL_ALGO_RMD160 10
+#endif
 #define DEBUG_SMIME0
 
 /* FIXME: Use the openssl constants instead of
@@ -954,6 +960,23 @@ static EVP_MD * php_openssl_get_evp_md_from_algo(long 
algo) { /* {{{ */
case OPENSSL_ALGO_DSS1:
mdtype = (EVP_MD *) EVP_dss1();
break;
+#if OPENSSL_VERSION_NUMBER = 0x0090708fL
+   case OPENSSL_ALGO_SHA224:
+   mdtype = (EVP_MD *) EVP_sha224();
+   break;
+   case OPENSSL_ALGO_SHA256:
+   mdtype = (EVP_MD *) EVP_sha256();
+   break;
+   case OPENSSL_ALGO_SHA384:
+   mdtype = (EVP_MD *) EVP_sha384();
+   break;
+   case OPENSSL_ALGO_SHA512:
+   mdtype = (EVP_MD *) EVP_sha512();
+   break;
+   case OPENSSL_ALGO_RMD160:
+   mdtype = (EVP_MD *) EVP_ripemd160();
+   break;
+#endif
default:
return NULL;
break;
@@ -1048,6 +1071,13 @@ PHP_MINIT_FUNCTION(openssl)
REGISTER_LONG_CONSTANT(OPENSSL_ALGO_MD2, OPENSSL_ALGO_MD2, 
CONST_CS|CONST_PERSISTENT);
 #endif
REGISTER_LONG_CONSTANT(OPENSSL_ALGO_DSS1, OPENSSL_ALGO_DSS1, 
CONST_CS|CONST_PERSISTENT);
+#if OPENSSL_VERSION_NUMBER = 0x0090708fL
+   REGISTER_LONG_CONSTANT(OPENSSL_ALGO_SHA224, OPENSSL_ALGO_SHA224, 
CONST_CS|CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(OPENSSL_ALGO_SHA256, OPENSSL_ALGO_SHA256, 
CONST_CS|CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(OPENSSL_ALGO_SHA384, OPENSSL_ALGO_SHA384, 
CONST_CS|CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(OPENSSL_ALGO_SHA512, OPENSSL_ALGO_SHA512, 
CONST_CS|CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(OPENSSL_ALGO_RMD160, OPENSSL_ALGO_RMD160, 
CONST_CS|CONST_PERSISTENT);
+#endif
 
/* flags for S/MIME */
REGISTER_LONG_CONSTANT(PKCS7_DETACHED, PKCS7_DETACHED, 
CONST_CS|CONST_PERSISTENT);


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



[PHP-CVS] com php-src: Merge branch 'PHp-5.4': ext/openssl/openssl.c

2012-09-16 Thread Stanislav Malyshev
Commit:088640adb206361ea8e6d5705d7434c6e3d3e25c
Author:Stanislav Malyshev s...@php.net Sat, 15 Sep 2012 23:02:44 
-0700
Parents:   80b29dcfadd4d894d3268d1256cb357184e38e39 
56425ee61080c5e13e88777ee665e858b367
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=088640adb206361ea8e6d5705d7434c6e3d3e25c

Log:
Merge branch 'PHp-5.4'

* PHp-5.4:
  news for bug #61421
  commit for php bug 61421 enabling SHA2 and RMD160 for openssl signature 
verification

Bugs:
https://bugs.php.net/61421

Changed paths:
  MM  ext/openssl/openssl.c


Diff:



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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4': sapi/cli/php_cli_server.c

2012-09-16 Thread Stanislav Malyshev
Commit:6cc9d99dc2ef764281ec291c55719d8bf34e7695
Author:Stanislav Malyshev s...@php.net Sat, 15 Sep 2012 23:11:55 
-0700
Parents:   088640adb206361ea8e6d5705d7434c6e3d3e25c 
27542db4e70c388346fc9983b9c7d58248aaa52d
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=6cc9d99dc2ef764281ec291c55719d8bf34e7695

Log:
Merge branch 'PHP-5.4'

* PHP-5.4:
  Respond with 501 to unknown request methods

Changed paths:
  MM  sapi/cli/php_cli_server.c


Diff:



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



[PHP-CVS] com php-src: Replace code with zend_clean_and_cache_symbol_table() call: Zend/zend_execute_API.c

2012-09-16 Thread Nikita Popov
Commit:526db7db14f73c652a6b1a80149ede114ddd024c
Author:Nikita Popov ni...@php.net Sun, 16 Sep 2012 21:54:48 +0200
Parents:   fb03ce93d3829b4e7378b2d3522da6fb2db12205
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=526db7db14f73c652a6b1a80149ede114ddd024c

Log:
Replace code with zend_clean_and_cache_symbol_table() call

I replaced other instances of this code with the function call, but missed
this one.

Changed paths:
  M  Zend/zend_execute_API.c


Diff:
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index fb0c18b..ddf86e8 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -964,15 +964,7 @@ int zend_call_function(zend_fcall_info *fci, 
zend_fcall_info_cache *fci_cache TS
}
 
if (!fci-symbol_table  EG(active_symbol_table)) {
-   if (EG(symtable_cache_ptr)=EG(symtable_cache_limit)) {
-   zend_hash_destroy(EG(active_symbol_table));
-   FREE_HASHTABLE(EG(active_symbol_table));
-   } else {
-   /* clean before putting into the cache, since 
clean
-  could call dtors, which could use cached 
hash */
-   zend_hash_clean(EG(active_symbol_table));
-   *(++EG(symtable_cache_ptr)) = 
EG(active_symbol_table);
-   }
+   
zend_clean_and_cache_symbol_table(EG(active_symbol_table) TSRMLS_CC);
}
EG(active_symbol_table) = calling_symbol_table;
EG(active_op_array) = original_op_array;


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



[PHP-CVS] com php-src: Fix two op_array - function cast warnings: Zend/zend_generators.c Zend/zend_vm_def.h Zend/zend_vm_execute.h

2012-09-16 Thread Nikita Popov
Commit:a47c11a13d005afb1b9b8382eb8f34f8dd632039
Author:Nikita Popov ni...@php.net Sun, 16 Sep 2012 22:01:07 +0200
Parents:   526db7db14f73c652a6b1a80149ede114ddd024c
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a47c11a13d005afb1b9b8382eb8f34f8dd632039

Log:
Fix two op_array - function cast warnings

Changed paths:
  M  Zend/zend_generators.c
  M  Zend/zend_vm_def.h
  M  Zend/zend_vm_execute.h


Diff:
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index 83025ea..01b33a3 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -371,7 +371,7 @@ zval *zend_generator_create_zval(zend_op_array *op_array 
TSRMLS_DC) /* {{{ */
if (op_array-fn_flags  ZEND_ACC_CLOSURE) {
zend_op_array *op_array_copy = 
(zend_op_array*)emalloc(sizeof(zend_op_array));
*op_array_copy = *op_array;
-   function_add_ref(op_array_copy);
+   function_add_ref((zend_function *) op_array_copy);
op_array = op_array_copy;
}

diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index be2021a..e0fc1bf 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -5340,7 +5340,7 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, 
UNUSED)
zend_error_noreturn(E_ERROR, Base lambda function for closure 
not found);
}
 
-   zend_create_closure(EX_T(opline-result.var).tmp_var, op_array, 
EG(scope), EG(This) TSRMLS_CC);
+   zend_create_closure(EX_T(opline-result.var).tmp_var, (zend_function 
*) op_array, EG(scope), EG(This) TSRMLS_CC);
 
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index bde11ea..b8dac02 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -6614,7 +6614,7 @@ static int ZEND_FASTCALL  
ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER
zend_error_noreturn(E_ERROR, Base lambda function for closure 
not found);
}
 
-   zend_create_closure(EX_T(opline-result.var).tmp_var, op_array, 
EG(scope), EG(This) TSRMLS_CC);
+   zend_create_closure(EX_T(opline-result.var).tmp_var, (zend_function 
*) op_array, EG(scope), EG(This) TSRMLS_CC);
 
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();


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



[PHP-CVS] com php-src: Fix invalid read / remove useless code: Zend/zend_vm_def.h Zend/zend_vm_execute.h

2012-09-16 Thread Nikita Popov
Commit:fb03ce93d3829b4e7378b2d3522da6fb2db12205
Author:Nikita Popov ni...@php.net Sun, 16 Sep 2012 21:48:57 +0200
Parents:   6cc9d99dc2ef764281ec291c55719d8bf34e7695
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=fb03ce93d3829b4e7378b2d3522da6fb2db12205

Log:
Fix invalid read / remove useless code

Generators follow a different cleanup path, so the extra check for freeing
the execute_data is unnecessary there. It actually caused problems because
op_array-fn_flags could be in freed memory at that time (in case op_array
came from a closure in an ArrayAccess container).

This fixes the valgrind warning in Zend/tests/bug54367.phpt.

Bugs:
https://bugs.php.net/54367

Changed paths:
  M  Zend/zend_vm_def.h
  M  Zend/zend_vm_execute.h


Diff:
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index f683ff2..be2021a 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -1869,13 +1869,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
 
nested = EX(nested);
 
-   /* For generators the execute_data is stored on the heap, for everything
-* else it is stored on the VM stack. */
-   if (op_array-fn_flags  ZEND_ACC_GENERATOR) {
-   efree(execute_data);
-   } else {
-   zend_vm_stack_free(execute_data TSRMLS_CC);
-   }
+   zend_vm_stack_free(execute_data TSRMLS_CC);
 
if (nested) {
execute_data = EG(current_execute_data);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index f8a8905..bde11ea 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -493,13 +493,7 @@ static int ZEND_FASTCALL 
zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
 
nested = EX(nested);
 
-   /* For generators the execute_data is stored on the heap, for everything
-* else it is stored on the VM stack. */
-   if (op_array-fn_flags  ZEND_ACC_GENERATOR) {
-   efree(execute_data);
-   } else {
-   zend_vm_stack_free(execute_data TSRMLS_CC);
-   }
+   zend_vm_stack_free(execute_data TSRMLS_CC);
 
if (nested) {
execute_data = EG(current_execute_data);


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



[PHP-CVS] com php-src: Add NEWS for generators: NEWS

2012-09-16 Thread Nikita Popov
Commit:f163c70feae301ff259aca8eb0929f3a4b70a1c1
Author:Nikita Popov ni...@php.net Sun, 16 Sep 2012 22:02:47 +0200
Parents:   a47c11a13d005afb1b9b8382eb8f34f8dd632039
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f163c70feae301ff259aca8eb0929f3a4b70a1c1

Log:
Add NEWS for generators

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index 1ee9779..d54cc1c 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP 
   NEWS
 ?? ??? 201?, PHP 5.5.0
 
 - General improvements:
+  . Add generators and coroutines (https://wiki.php.net/rfc/generators).
+(Nikita Popov)
   . Support list in foreach (https://wiki.php.net/rfc/foreachlist). (Laruence)
   . Implemented 'finally' keyword (https://wiki.php.net/rfc/finally). 
(Laruence)
   . Drop Windows XP and 2003 support. (Pierre)


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



[PHP-CVS] com php-src: test should fail: ext/date/tests/bug62852.phpt

2012-09-16 Thread Xinchen Hui
Commit:eb881a1dd1d0b50e304556f854ec5d66e79ef50b
Author:Xinchen Hui larue...@php.net Mon, 17 Sep 2012 11:20:24 
+0800
Parents:   4c6678d6058fd740a9e186b49f9daa72d09ed300
Branches:  PHP-5.3

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=eb881a1dd1d0b50e304556f854ec5d66e79ef50b

Log:
test should fail

Changed paths:
  M  ext/date/tests/bug62852.phpt


Diff:
diff --git a/ext/date/tests/bug62852.phpt b/ext/date/tests/bug62852.phpt
index 2c23138..26de510 100644
--- a/ext/date/tests/bug62852.phpt
+++ b/ext/date/tests/bug62852.phpt
@@ -29,5 +29,8 @@ try {
 unserialize( $s2 );
 } catch ( Exception $e ) {}
 var_dump( $foo );
+
+echo okey;
 ?
 --EXPECTF--
+okey


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