Commit Graph

1696 Commits

Author SHA1 Message Date
George Peter Banyard
b6958bb847
Implement "Deprecate implicit non-integer-compatible float to int conversions" RFC. (#6661)
RFC: https://wiki.php.net/rfc/implicit-float-int-deprecate

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-05-31 15:48:45 +01:00
Christoph M. Becker
509d34955c
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #76694: native Windows cert verification uses CN as sever name
2021-05-31 14:37:55 +02:00
Christoph M. Becker
108105b2c6
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #76694: native Windows cert verification uses CN as sever name
2021-05-31 14:36:57 +02:00
Christoph M. Becker
7fd48264de
Fix #76694: native Windows cert verification uses CN as sever name
This is not guaranteed to work, since the actual server name may only
be given as SAN.  Since we're doing the peer verification later anyway
(using the respective context options as appropriate), there is no need
to even supply a server name when verifying against the Windows cert
store.

Closes GH-7060.
2021-05-31 14:35:17 +02:00
Nikita Popov
8c73dfe062 Remove silly code from openssl_pkey_free() test
W A T
2021-05-29 15:48:58 +02:00
Nikita Popov
840c78b2d8 Check RAND_egd after setting up openssl
Noticed this by accident: We should check functions in the library
only after setting it up.
2021-05-14 12:02:28 +02:00
George Peter Banyard
c40231afbf
Mark various functions with void arguments.
This fixes a bunch of [-Wstrict-prototypes] warning,
because in C func() and func(void) have different semantics.
2021-05-12 14:55:53 +01:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov
c15dc63ad2 Merge branch 'PHP-8.0'
* PHP-8.0:
  openssl_pkcs7_read: input is data not filename
2021-05-05 09:50:11 +02:00
Vincent JARDIN
bb0107b63d openssl_pkcs7_read: input is data not filename
The argument should be an input string and not a filename.

Fix: https://github.com/php/doc-en/pull/559
Suggested-by: George Peter Banyard <girgias@php.net>

Closes GH-6942.
2021-05-05 09:49:53 +02:00
George Peter Banyard
09efad615b
Use zend_string_equals_(literal_)ci() API more often
Also drive-by usage of zend_ini_parse_bool()

Closes GH-6844
2021-04-09 02:34:50 +01:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Jakub Zelenka
a3e1082e0a Merge branch 'PHP-8.0' 2021-03-21 21:21:38 +00:00
Jakub Zelenka
4dca1140cf Merge branch 'PHP-7.4' into PHP-8.0 2021-03-21 21:21:05 +00:00
Jakub Zelenka
bc7ea73da5 Use ServerClientTestCase in a test for default_socket_timeout=-1 2021-03-21 21:19:40 +00:00
Nikita Popov
703bbf5210 Downgrade security level in tests using TLS < 1.2
A few additional tests have been added on master that require
lower security level.

(cherry picked from commit c2a6395dcb)
2021-03-15 14:11:12 +01:00
twosee
db33af7104 Remove duplicated SSL_CTX_set_verify()
Duplicated with line 920.
Our minimal OpenSSL version is v1.0.1 (See https://github.com/openssl/openssl/blob/OpenSSL_1_0_1-stable/ssl/ssl_lib.c#L2039).
Removing it does not affect program behavior.
Closes GH-6751.
2021-03-04 17:51:29 +08:00
Remi Collet
8c206ba5ac Merge branch 'PHP-8.0'
* PHP-8.0:
  skip test with openssl < 1.1.0
2021-02-25 13:54:34 +01:00
Remi Collet
18071aaa08 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  skip test with openssl < 1.1.0
2021-02-25 13:54:19 +01:00
Remi Collet
ae0585c98e skip test with openssl < 1.1.0
The test fails, but without any crash
(this test is designed to catch a crash)
2021-02-25 13:52:35 +01:00
Nikita Popov
ce0bc58c22 Merge branch 'PHP-8.0'
* PHP-8.0:
  Mark resource-like objects as non-comparable
2021-02-16 14:22:03 +01:00
Nikita Popov
b63ea1047a Mark resource-like objects as non-comparable
As these hold on to some internal resource, there can't be two
"equal" objects with different identity. Make sure the lack of
public properties doesn't result in these being treated as always
equal.
2021-02-16 14:20:45 +01:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Nikita Popov
45e6dc7beb Merge branch 'PHP-8.0'
* PHP-8.0:
  Suppress OpenSSL error on missing optional config
2021-02-16 10:12:59 +01:00
Nikita Popov
4fb8252186 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Suppress OpenSSL error on missing optional config
2021-02-16 10:12:42 +01:00
Nikita Popov
7566742754 Suppress OpenSSL error on missing optional config
openssl_pkey_new() fetches various options from the config file --
most of these are optional, and not specifying them is not an error
condition from the perspective of the user. Unfortunately, the
CONF_get_string() API pushes an error when accessing a key that
doesn't exist (_CONF_get_string does not, but that is presumably a
private API). This commit adds a helper php_openssl_conf_get_string()
that automatically clears the error in this case. I've found that
OpenSSL occasionally does the same thing internally:
22040fb790/apps/req.c (L515-L517)

Closes GH-6699.
2021-02-16 10:11:00 +01:00
Nikita Popov
5f0b995e6c Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80747
2021-02-15 15:34:54 +01:00
Nikita Popov
f43097a2d7 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80747
2021-02-15 15:34:21 +01:00
Nikita Popov
64b1085464 Fixed bug #80747
If RSA key generation fails, actually report that failure.
2021-02-15 15:34:01 +01:00
Máté Kocsis
af56982a5e
Generate class entries from stubs for oci8, odbc, openssl, pcntl, pdo, pgsql
Closes GH-6691
2021-02-14 23:19:21 +01:00
Nikita Popov
b10416a652 Deprecate passing null to non-nullable arg of internal function
This deprecates passing null to non-nullable scale arguments of
internal functions, with the eventual goal of making the behavior
consistent with userland functions, where null is never accepted
for non-nullable arguments.

This change is expected to cause quite a lot of fallout. In most
cases, calling code should be adjusted to avoid passing null. In
some cases, PHP should be adjusted to make some function arguments
nullable. I have already fixed a number of functions before landing
this, but feel free to file a bug if you encounter a function that
doesn't accept null, but probably should. (The rule of thumb for
this to be applicable is that the function must have special behavior
for 0 or "", which is distinct from the natural behavior of the
parameter.)

RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg

Closes GH-6475.
2021-02-11 21:46:13 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Nikita Popov
4b544f25ef Merge branch 'PHP-8.0'
* PHP-8.0:
  Try to fix intermittent failures of stream_server_reneg_limit.phpt on macos
2021-01-04 14:33:02 +01:00
Nikita Popov
af7445b9ac Try to fix intermittent failures of stream_server_reneg_limit.phpt on macos
Make sure the server has started up before we try to connect to it.
2021-01-04 14:31:42 +01:00
Nikita Popov
4ce33486d7 Merge branch 'PHP-8.0'
* PHP-8.0:
  Next attempt to fix bug #80368
2020-11-30 15:17:35 +01:00
Nikita Popov
32cd5a1bc8 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Next attempt to fix bug #80368
2020-11-30 15:17:27 +01:00
Nikita Popov
ecee3f1209 Next attempt to fix bug #80368
Apparently treating LibreSSL as OpenSSL 1.1 is not just something
we did in our code, it's something that upstream LibreSSL claims,
despite not actually being compatible. Duh.

Check for EVP_CIPH_OCB_MODE instead, which should reliably
determine support...
2020-11-30 15:15:59 +01:00
Jakub Zelenka
4662a8c893 Merge branch 'PHP-8.0' 2020-11-27 16:35:46 +00:00
Jakub Zelenka
a87d620543 Merge branch 'PHP-7.4' into PHP-8.0 2020-11-27 16:35:16 +00:00
Jakub Zelenka
b855907f54 Merge branch 'PHP-7.3' into PHP-7.4 2020-11-27 16:33:47 +00:00
Jakub Zelenka
685708160e Fix test for bug62890 to not depend on system cert store 2020-11-27 16:32:43 +00:00
Nikita Popov
d56e255445 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80368
2020-11-27 10:58:40 +01:00
Nikita Popov
f4e1768e21 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80368
2020-11-27 10:58:34 +01:00
Nikita Popov
0f579fd7c8 Fixed bug #80368
We assume that usually LibreSSL supports everything OpenSSL 1.1 does.
In this instance, this is not the case.
2020-11-27 10:57:19 +01:00
Jakub Zelenka
c3a6debc08 Bump minimal OpenSSL version to 1.0.2 2020-11-01 20:10:37 +00:00
Nikita Popov
87d2bb7424 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix CCM tag length setting for old OpenSSL versions
2020-10-20 10:52:50 +02:00
Nikita Popov
1359f793ee Fix CCM tag length setting for old OpenSSL versions
While OpenSSL 1.1 allows unconditionally setting the CCM tag length
even for decryption, some older versions apparently do not. As such,
we do need to treat CCM and OCB separately after all.
2020-10-20 10:50:50 +02:00
Nikita Popov
7727a02276 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #79983: Add support for OCB mode
2020-10-19 11:09:17 +02:00
Nikita Popov
750a74ed9c Fix bug #79983: Add support for OCB mode
OCB mode ciphers were already exposed to openssl_encrypt/decrypt,
but misbehaved, because they were not treated as AEAD ciphers.
From that perspective, OCB should be treated the same way as GCM.
In OpenSSL 1.1 the necessary controls were unified under
EVP_CTRL_AEAD_* (and OCB is only supported since OpenSSL 1.1).

Closes GH-6337.
2020-10-19 11:09:00 +02:00
Nikita Popov
251af7329f Fix nullability of openssl_cms_sign() parameter 2020-10-14 11:34:15 +02:00