1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 07:28:09 +02:00
Commit Graph

1519 Commits

Author SHA1 Message Date
Christoph M. Becker 16a8a608d5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79145: openssl memory leak
2020-01-21 16:20:04 +01:00
Christoph M. Becker 9eff906a02 Fix #79145: openssl memory leak
We must increase the refcount of `return_value` only if `cert` is a
resource; this is already done in `php_openssl_evp_from_zval()`,
though.
2020-01-21 16:17:25 +01:00
Nikita Popov 3e41ade638 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78775
2019-11-05 12:16:09 +01:00
Nikita Popov 747cb46244 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78775
2019-11-05 12:15:44 +01:00
Nikita Popov 4f984a2fdb Fixed bug #78775
Clear the OpenSSL error queue before performing SSL stream operations.
As we don't control all code that could possibly be using OpenSSL,
we can't rely on the error queue being empty.
2019-11-05 12:13:46 +01:00
Christoph M. Becker 59ac81f81e Update regarding changed OpenSSL default config path 2019-10-01 09:14:58 +02:00
Fabien Villepinte 7aece45f4d Add missing SKIPIF (openssl)
Co-Authored-By: Gabriel Caruso <carusogabriel34@gmail.com>
2019-09-04 08:43:32 +02:00
Nikita Popov 699b465da2 Fixed bug #78391 2019-08-09 15:03:40 +02:00
Nikita Popov 626bc0e7cc Remove php_openssl_cipher_get_version()
This was added in 7.1 when add_assoc_string mistakenly accepted
a char* rather than const char* parameter and is no longer needed.
We can use SSL_CIPHER_get_version() directly.
2019-07-24 16:41:20 +02:00
Nikita Popov d59aac58b3 Report errors from stream read and write operations
The php_stream_read() and php_stream_write() functions now return
an ssize_t value, with negative results indicating failure. Functions
like fread() and fwrite() will return false in that case.

As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams
should not be regarded as error conditions, and be reported as
successful zero-length reads/writes instead. The handling of EINTR
remains unclear and is internally inconsistent (e.g. some code-paths
will automatically retry on EINTR, while some won't).

I'm landing this now to make sure the stream wrapper ops API changes
make it into 7.4 -- however, if the user-facing changes turn out to
be problematic we have the option of clamping negative returns to
zero in php_stream_read() and php_stream_write() to restore the
old behavior in a relatively non-intrusive manner.
2019-07-22 17:17:28 +02:00
Peter Kokot 4b03e102c5 Remove HAVE_DSA_DEFAULT_METHOD
Last usage removed via 6a81363405.

Closes GH-4455
2019-07-22 16:02:55 +02:00
Nikita Popov a023eb3967 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-03 12:37:12 +02:00
Nikita Popov af3c854074 Merge branch 'PHP-7.2' into PHP-7.3 2019-07-03 12:36:50 +02:00
Nikita Popov 0e48e35e04 Fixed bug #78231 2019-07-03 12:36:06 +02:00
Nikita Popov 021bb35aec Merge branch 'PHP-7.3' into PHP-7.4 2019-06-21 15:08:12 +02:00
Nikita Popov 66e4b78519 Merge branch 'PHP-7.2' into PHP-7.3 2019-06-21 15:07:59 +02:00
Nikita Popov 99f3e0f0ed Fix PKCS12 leak in openssl 2019-06-21 15:07:37 +02:00
Nikita Popov c939a67866 Fix d leak in ecc openssl_pkey_new 2019-06-21 15:07:32 +02:00
Nikita Popov dfe6f0c1c6 Fix netscape spki leak in openssl 2019-06-21 15:07:26 +02:00
Nikita Popov a0da2fb2b7 Fix X509 leak in openssl_pkcs7_verify() 2019-06-21 15:07:18 +02:00
Nikita Popov e0bafc6da4 Fix CSR leaks in openssl 2019-06-21 15:07:10 +02:00
Nikita Popov 90cb3743be Free cert in php_openssl_load_stream_cafile()
X509_STORE_add_cert() increments the refcount of the cert, so we
should free it here.
2019-06-21 15:07:00 +02:00
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
Rosen Penev 32e6d08dcd Fix compilation without deprecated OpenSSL 1.1 APIs 2019-06-14 15:38:12 +02:00
Dmitry Stogov 457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03: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 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 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
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 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 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 1ab3704143 Remove unused variable 2019-05-10 01:05:19 +02: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 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
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
Hugh McMaster aba72ebf15 Use PKG_CHECK_MODULES to detect the kerberos libraries 2019-04-20 15:13:24 +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