Commit Graph

773 Commits

Author SHA1 Message Date
codarrenvelvindron
5c05f5e6d3 Added tls 1.3 support for PHP 2019-04-28 17:37:43 +01:00
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Peter Kokot
a8c3e22d23 Replace PHP_TM_GMTOFF with AC_CHECK_MEMBERS
Changes:
- PHP_TM_GMTOFF removed
- HAVE_TM_GMTOFF replaced with HAVE_STRUCT_TM_TM_GMTOFF
- HAVE_TM_ZONE replaced with HAVE_STRUCT_TM_TM_ZONE
- HAVE_TZNAME removed

The PHP_TM_GMTOFF macro can be replaced with Autoconf's AC_CHECK_MEMBERS
that defines the HAVE_STRUCT_TM_TM_GMTOFF symbol instead of the
HAVE_TM_ZONE.

The HAVE_TZNAME symbol is not used in current code. The obsolete
HAVE_TM_ZONE symbol has been replaced with more proper
HAVE_STRUCT_TM_TM_ZONE. These are defined by the AC_STRUCT_TIMEZONE
macro.
2019-03-04 12:13:12 +01:00
Anatol Belski
a5e986181a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Sync with behavior change in OpenSSL 1.1.1b
2019-02-28 12:53:05 +01:00
Anatol Belski
58d3dd466f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Sync with behavior change in OpenSSL 1.1.1b
2019-02-28 12:52:28 +01:00
Anatol Belski
19a44ffb7b Sync with behavior change in OpenSSL 1.1.1b
A behavior change in revealed by some openssl_decrypt() based test,
where an encrypt API is used with a decrypt context. The EVP_Cipher*
functions will automatically choose the right operation depending on the
context passed.
2019-02-28 12:48:47 +01:00
Nikita Popov
c0ce258b53 Fix incorrect outbuf freeing 2019-02-08 12:59:48 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
David Carlier
62c7432fa3 Refactor subset of openssl module.
Proposal to abstract a subset of the openssl module,
to be able to use two ways encryption outside of this context.
2019-01-14 19:38:26 +00:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Sammy Kaye Powers
74c0e580ef Improve openssl_random_pseudo_bytes()
CSPRNG implementations should always fail closed. Now
openssl_random_pseudo_bytes() will fail closed by throwing an
`\Exception` in fail conditions.

RFC: https://wiki.php.net/rfc/improve-openssl-random-pseudo-bytes
2019-01-11 11:16:05 +01:00
Ben Scholzen (DASPRiD)
ee939b70d3 Add openssl_x509_verify() function
This patch introduces a wrapper around OpenSSL's X509_verify() function.
2018-11-14 21:40:34 +01:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
b6cc4d2009 Use zval_ptr_dtor() instead of zval_dtor() in internal functions that destroy new created object (This is safer and produces less code) 2018-07-05 11:54:26 +03:00
Dmitry Stogov
265c3ed6cf Fixed incorrrecr zval_dtor() usage to replace value of argument passed by reference, that may lead to memory leaks. 2018-07-05 10:57:49 +03:00
Dmitry Stogov
4a475a4976 Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
2018-07-04 19:22:24 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Jakub Zelenka
3986b6ab6e Merge branch 'PHP-7.2' 2018-05-22 13:41:22 +01:00
Jakub Zelenka
a231860b02 Merge branch 'PHP-7.1' into PHP-7.2 2018-05-22 13:40:23 +01:00
Jakub Zelenka
68c3d09c2c Fix bug #76174 (openssl extension fails to build with LibreSSL 2.7) 2018-05-22 13:30:58 +01:00
Jakub Zelenka
587cede59d Merge branch 'PHP-7.2' 2018-05-18 17:25:06 +01:00
Jakub Zelenka
b027071688 Merge branch 'PHP-7.1' into PHP-7.2 2018-05-18 17:23:17 +01:00
Erik Lax
d6bc266ba0 Fix bug #76296 (openssl_pkey_get_public does not respect open_basedir) 2018-05-18 17:15:22 +01:00
Jakub Zelenka
2a2bf97a9a Fix keylen type mismatch in openssl_pkey_derive 2018-05-11 17:05:03 +01:00
Jakub Zelenka
a76633444c Fix openssl_pkey_derive arginfo 2018-05-09 19:38:47 +01:00
Jim Zubov
897133fbda Add openssl_pkey_derive 2018-05-09 19:37:01 +01:00
Christoph M. Becker
d5f84fb9c5 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix some arginfos
2018-02-23 11:32:18 +01:00
Christoph M. Becker
c6cf3d4ada Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix some arginfos
2018-02-23 11:29:21 +01:00
Gabriel Caruso
0b8cfa6c78 Fix some arginfos
* all arguments for ftp_pasv are required
* $varname for getenv function isn't required anymore
* fsockopen and pfsockopen only require $hostname
* strtok can work with only one parameter
* strpbrk needs two parameters to work
* required parameters and add some parameters in openssl_* functions
2018-02-23 11:27:14 +01:00
Gabriel Caruso
1314f0fb3a Use int instead of long in protos 2018-02-23 11:06:20 +01:00
Christoph M. Becker
e8affd805f Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix openssl_* arginfos
2018-02-20 16:26:06 +01:00
Christoph M. Becker
e80e38ab7c Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix openssl_* arginfos
2018-02-20 16:25:22 +01:00
Gabriel Caruso
276b57316c Fix openssl_* arginfos
openssl_pkcs12_export and openssl_x509_parse had wrong arginfos
2018-02-20 16:23:42 +01:00
Gabriel Caruso
8034fdc9d9 Use int instead of integer in proto 2018-02-02 22:32:15 +01:00
Dmitry Stogov
14d3a627c9 Eliminate useless separation 2018-01-17 12:25:49 +03:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Jakub Zelenka
19c62e83fa Merge branch 'PHP-7.1' into PHP-7.2 2017-10-30 16:43:36 +00:00
Jakub Zelenka
7c2031bfca Merge branch 'PHP-7.0' into PHP-7.1 2017-10-30 16:42:23 +00:00
Jakub Zelenka
fc169d2133 Prevent leaking x509 and csr resources if it is not requested
All functions using php_openssl_x509_from_zval or php_openssl_csr_from_zval
with makeresource equal to 0 do not deref the resource which means there
is a leak till the end of the request. This can cause issues for long
running apps. It is a generic solution for bug #75363 which also covers
other functions.
2017-10-30 16:40:56 +00:00
Joe Watkins
f2367d4626
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #75307 Wrong reflection for openssl_open function
2017-10-27 16:06:57 +01:00
Joe Watkins
14be7dcf8e
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #75307 Wrong reflection for openssl_open function
2017-10-27 16:06:29 +01:00
Fabien Villepinte
51ea2cfbe1
Fix bug #75307 Wrong reflection for openssl_open function 2017-10-27 16:06:01 +01:00
Jakub Zelenka
a3da46b524 Merge branch 'PHP-7.1' into PHP-7.2 2017-10-15 20:33:22 +01:00
Jakub Zelenka
547fee9cd4 Merge branch 'PHP-7.0' into PHP-7.1 2017-10-15 20:31:25 +01:00
Jakub Zelenka
999fe36d40 Properly fix #75363 and address some other leaks with cert 2017-10-15 20:25:58 +01:00
Bob Weinand
ee36507423 Merge branch 'PHP-7.1' into PHP-7.2 2017-10-12 12:32:30 +02:00