Commit Graph

1567 Commits

Author SHA1 Message Date
Nikita Popov
e7ef2b52db Merge branch 'PHP-7.3' into PHP-7.4 2019-06-21 12:56:12 +02:00
Nikita Popov
414db07bdb Merge branch 'PHP-7.2' into PHP-7.3 2019-06-21 12:55:12 +02:00
Niklas Keller
fea9f93166 Fix memory leak in TLS matches_san_list 2019-06-21 12:54:30 +02:00
Nikita Popov
bd73332f50 Merge branch 'PHP-7.4' 2019-06-14 15:38:27 +02:00
Rosen Penev
32e6d08dcd Fix compilation without deprecated OpenSSL 1.1 APIs 2019-06-14 15:38:12 +02:00
Dmitry Stogov
e029cc4dd4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Cheaper checks for exceptions thrown from __toString()
2019-06-06 02:23:17 +03:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Nikita Popov
7013e8be85 Merge branch 'PHP-7.4' 2019-06-03 18:59:21 +02:00
Nikita Popov
117f7720be Prevent use of TLS 1.3 in stream_server_reneg_limit.phpt
TLS 1.3 does not support renegotiation, make sure this test does
not use it.
2019-06-03 18:58:52 +02:00
Nikita Popov
6b57898057 Merge branch 'PHP-7.4' 2019-06-03 15:15:35 +02:00
Nikita Popov
829f18b48d Merge branch 'PHP-7.3' into PHP-7.4 2019-06-03 15:15:22 +02:00
Nikita Popov
37bba7a678 Merge branch 'PHP-7.2' into PHP-7.3 2019-06-03 15:15:07 +02:00
Nikita Popov
ac60007bec Clear errors after SSL_CTX_load_verify_locations()
We report our own errors here. Make sure these don't clog up the
error queue.
2019-06-03 15:14:01 +02:00
Nikita Popov
1df8175b61 Convert fetch_resource warnings into TypeErrors
More type checks that are not part of zpp and should generate a
TypeError in PHP 8.
2019-06-03 09:17:12 +02:00
Jakub Zelenka
29d79dc2e5 Merge branch 'PHP-7.4' 2019-06-02 19:15:00 +01:00
Jakub Zelenka
4feddd59dc Merge branch 'PHP-7.3' into PHP-7.4 2019-06-02 19:14:37 +01:00
Jakub Zelenka
8f69ca8dcd Merge branch 'PHP-7.2' into PHP-7.3 2019-06-02 19:13:18 +01:00
Jakub Zelenka
2e02579474 Fix bug #78079 (openssl_encrypt_ccm.phpt fails with OpenSSL 1.1.1c)
It also fixes invalid setting of tag length
2019-06-02 19:10:56 +01:00
Nikita Popov
bb3421b554 Merge branch 'PHP-7.4' 2019-05-31 17:00:31 +02:00
Nikita Popov
7f26171445 Remove confusing spkstr checks
This is a required parameter, it can never be NULL.
2019-05-31 17:00:00 +02:00
Peter Kokot
2cf90bb2f0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Normalize comments in *nix build system m4 files
2019-05-12 18:51:50 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Peter Kokot
08e7e6ffe6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove unused variable
2019-05-10 01:05:24 +02:00
Peter Kokot
1ab3704143 Remove unused variable 2019-05-10 01:05:19 +02:00
Jakub Zelenka
187872503a Merge branch 'PHP-7.4' 2019-05-05 21:06:58 +01:00
Jakub Zelenka
b348c46e29 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-05 21:06:30 +01:00
Jakub Zelenka
36a7d9fca4 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-05 21:05:55 +01:00
Jakub Zelenka
9977de0028 Fix OpenSSL online test for ca context
The php.net is redirected to https so use nginx.org
2019-05-05 21:04:28 +01:00
Jakub Zelenka
5b7acc64eb Merge branch 'PHP-7.4' 2019-04-28 18:51:36 +01:00
Jakub Zelenka
3c056a9e75 Enable TLS 1.3 by default 2019-04-28 17:37:43 +01:00
Jakub Zelenka
c2e9c71e36 Fix tests and logic for TLS 1.3 2019-04-28 17:37:43 +01:00
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
Dmitry Stogov
2e4686b566 Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:16:47 +03:00
Dmitry Stogov
34db07567d Use ZEND_TRA_ASSIGN_REF_... macros for by reference arguments of internal functions. 2019-04-24 16:14:48 +03:00
Peter Kokot
3478dc5e28 Merge branch 'PHP-7.4'
* PHP-7.4:
  Update changelogs
  Remove PHP_SETUP_KERBEROS m4 macro
2019-04-20 16:16:25 +02:00
Peter Kokot
caea088ac7 Remove PHP_SETUP_KERBEROS m4 macro
With recent transition to pkg-config/pkgconf this macro has been now a
simple wrapper for PKG_CHECK_MODULES and PHP_EVAL_INCLINE so it's better
to omit it altogether and use these two in the *.m4 code directly.
2019-04-20 16:12:54 +02:00
Peter Kokot
cf84bbf606 Merge branch 'PHP-7.4'
* PHP-7.4:
  Use PKG_CHECK_MODULES to detect the kerberos libraries
2019-04-20 15:18:14 +02:00
Hugh McMaster
aba72ebf15 Use PKG_CHECK_MODULES to detect the kerberos libraries 2019-04-20 15:13:24 +02:00
Nikita Popov
a3dc083c81 Merge branch 'PHP-7.4' 2019-04-15 10:54:46 +02:00
Nikita Popov
c9ff095758 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-15 10:54:39 +02:00
Nikita Popov
5611058766 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-15 10:54:31 +02:00
Nikita Popov
917952453c Fix uninitialized cert_captured
This is a legimitimate bug and also shows up under valgrind.
2019-04-15 10:53:33 +02:00
Peter Kokot
61d9e53ed9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove extension readmes
2019-03-19 20:26:07 +01:00
Peter Kokot
38b22448f8 Remove extension readmes
This patch removes several extension readmes in favor of the PHP manual
and where possible.
2019-03-19 20:25:32 +01:00
Peter Kokot
6426420f61 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
2019-03-15 23:36:47 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
c9s
9f6f6fe219 Remove function_table var from the caller
function_table var is not used in call_user_function macro anymore
hence replace the usage with NULL
2019-03-11 10:00:39 +01:00
Gabriel Caruso
6c4e2079c0 Use EXPECT when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2019-03-11 00:05:44 -03:00
Jakub Zelenka
bc57efb78f Merge branch 'PHP-7.3' into PHP-7.4 2019-03-10 16:36:55 +00:00
Jakub Zelenka
f8850ccd85 Speed up TLS wrapper test for min and max versions 2019-03-10 16:36:13 +00:00
Jakub Zelenka
ee4fa7d482 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-10 16:34:58 +00:00
Jakub Zelenka
769d2d9b62 Speed up TLS wrapper tests when SSLv3 disabled
If SSLv3 is disabled in OpenSSL, then sslv3 is not available so the accept
times out. This commit removes the extra accept if SSLv3 is disabled.
2019-03-10 16:23:44 +00:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01: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
Jakub Zelenka
20af026acd Merge branch 'PHP-7.3' into PHP-7.4 2019-02-24 13:15:17 +00:00
Jakub Zelenka
900d4cdb9e Merge branch 'PHP-7.2' into PHP-7.3 2019-02-24 13:14:36 +00:00
Jakub Zelenka
043ce4c8a1 Revert "Disable bug77390.phpt"
This reverts commit 139492b1ae.
2019-02-24 13:12:38 +00:00
Jakub Zelenka
01c00953ff Print empty string in test for but 77390 just once 2019-02-24 13:11:27 +00:00
Jakub Zelenka
c814b34b1d Use spaces instead of tabs in bug 77390 test 2019-02-24 13:05:43 +00:00
Nikita Popov
139492b1ae Disable bug77390.phpt
This is causing a lot of spurious failures on AppVeyor.
2019-02-22 17:39:43 +01:00
Nikita Popov
4f2b46dbaf Merge branch 'PHP-7.3' into PHP-7.4 2019-02-20 12:12:11 +01:00
Nikita Popov
b3e0e555c8 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-20 12:11:56 +01:00
Abyr Valg
74888bede8 OpenSSL: Improve non-blocking eof test 2019-02-20 12:11:30 +01:00
Nikita Popov
c0e15a3b7f Implement fine-grained conflict handling
Tests can specify conflict keys, either in --CONFLICTS-- or
a per-directory CONFLICTS file. Non-conflicting tests may be run
in parallel.
2019-02-20 11:20:40 +01:00
Enrico Zimuel
f57acf08aa Added test for openssl_pkcs12_export_to_file_error 2019-02-10 20:18:17 +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
Jakub Zelenka
9be6b16983 Merge branch 'PHP-7.3' 2019-01-25 14:16:57 +00:00
Jakub Zelenka
0da13086bd Merge branch 'PHP-7.2' into PHP-7.3 2019-01-25 14:16:08 +00:00
Jakub Zelenka
dc2ffdeed7 Fix bug #77390 (feof might hang on TLS streams in case of fragmented TLS records)
Simplified version of the fix from Abyl Valg so credit to him.
2019-01-25 14:13:11 +00:00
Jakub Zelenka
d9b29029f9 Update and integrate openssl client proxy test 2019-01-25 14:09:55 +00:00
Abyr Valg
0c84c2ef50 Add a test for fragmented SSL packets 2019-01-25 14:09:55 +00: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
Eli Schwartz
fe8fdfa3bd ext/openssl: port to pkg-config macro and consistently require its use
openssl 0.9.8 in July 2005 first added pkg-config support, which is
earlier than the minimum supported version for php. This should
therefore be uiversally supported.
2019-01-11 11:49:37 +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
Jakub Zelenka
4eeacba6cb Merge branch 'PHP-7.3' 2019-01-10 20:17:58 +00:00
Jakub Zelenka
9c010cefa3 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-10 20:16:06 +00:00
Alexander Kurilo
1a1e12c2a9 Fix cleaning up after openssl_pkcs7_verify_basic test 2019-01-10 20:09:42 +00:00
Alexander Kurilo
1fab01be5b Generate certs for openssl tests on the fly
The idea is to create an easy way to provide a certificate that never
expires. In order to make it cross-platform, PHP is used rather than
openssl CLI app. Using openssl to generate certificates for tests that
test openssl might be not the best idea but pros seem to outweight cons
that this "recursice dependency" adds
2019-01-10 20:09:42 +00:00
Christoph M. Becker
0f9d369921 Merge branch 'PHP-7.3'
* PHP-7.3:
  Regenerate certs for openssl tests
2018-12-31 18:28:11 +01:00
Christoph M. Becker
b051ab56dc Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Regenerate certs for openssl tests
2018-12-31 18:27:26 +01:00
Alexander Kurilo
687dad3674 Regenerate certs for openssl tests 2018-12-31 18:20:34 +01:00
Jakub Zelenka
8acc70316d Merge branch 'PHP-7.3' 2018-12-02 19:39:25 +00:00
Jakub Zelenka
1deee2ba7c Merge branch 'PHP-7.2' into PHP-7.3 2018-12-02 19:38:38 +00:00
Alexander Kurilo
655fb96354 Regenerate certificates for openssl tests 2018-12-02 19:37:10 +00: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
d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
Peter Kokot
b746e69887 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:32:30 +02:00
Peter Kokot
f1d7e3ca0b Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:31:31 +02:00
Peter Kokot
d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00