Skip to content

Commit

Permalink
Fix bug #75307 Wrong reflection for openssl_open function
Browse files Browse the repository at this point in the history
  • Loading branch information
villfa authored and krakjoe committed Oct 27, 2017
1 parent 15a71fe commit 51ea2cf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ PHP NEWS

- OpenSSL:
. Fixed bug #75363 (openssl_x509_parse leaks memory). (Bob, Jakub Zelenka)
. Fixed bug #75307 (Wrong reflection for openssl_open function). (villfa)

- PGSQL:
. Fixed bug #75419 (Default link incorrectly cleared/linked by pg_close()). (Sara)
Expand Down
9 changes: 5 additions & 4 deletions ext/openssl/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,18 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_seal, 0, 0, 4)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(1, sealdata)
ZEND_ARG_INFO(1, ekeys) /* arary */
ZEND_ARG_INFO(1, ekeys) /* array */
ZEND_ARG_INFO(0, pubkeys) /* array */
ZEND_ARG_INFO(0, method)
ZEND_ARG_INFO(1, iv)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO(arginfo_openssl_open, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_open, 0, 0, 4)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(1, opendata)
ZEND_ARG_INFO(0, ekey)
ZEND_ARG_INFO(0, privkey)
ZEND_ARG_INFO(0, method)
ZEND_ARG_INFO(0, iv)
ZEND_END_ARG_INFO()

Expand Down Expand Up @@ -5336,7 +5337,7 @@ PHP_FUNCTION(openssl_verify)
}
/* }}} */

/* {{{ proto int openssl_seal(string data, &string sealdata, &array ekeys, array pubkeys)
/* {{{ proto int openssl_seal(string data, &string sealdata, &array ekeys, array pubkeys [, string method [, &string iv]]))
Seals data */
PHP_FUNCTION(openssl_seal)
{
Expand Down Expand Up @@ -5465,7 +5466,7 @@ PHP_FUNCTION(openssl_seal)
}
/* }}} */

/* {{{ proto bool openssl_open(string data, &string opendata, string ekey, mixed privkey)
/* {{{ proto bool openssl_open(string data, &string opendata, string ekey, mixed privkey [, string method [, string iv]])
Opens data */
PHP_FUNCTION(openssl_open)
{
Expand Down
18 changes: 18 additions & 0 deletions ext/openssl/tests/bug75307.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Bug #75307 Wrong reflection for openssl_open function
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not available");
if (!extension_loaded("reflection")) die("skip reflection not available");
?>
--FILE--
<?php
$rf = new ReflectionFunction('openssl_open');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(6)
int(4)
===DONE===

0 comments on commit 51ea2cf

Please sign in to comment.