1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 20:22:36 +02:00
Commit Graph

738 Commits

Author SHA1 Message Date
Christoph M. Becker
2bdf2f9100 Fix GH-16433: Large values for openssl_csr_sign() $days overflow
The `offset_sec` parameter of `X509_gmtime_adj()` expects a `long`, but
the `$days` parameter of `openssl_csr_sign()` a `zend_long`.  We must
avoid signed integer overflow (UB), but also must not silently truncate.
Thus we check the given `$days` for the permissible range, and bail out
otherwise.

Closes GH-16437.
2024-10-16 11:08:02 +02:00
Christoph M. Becker
549bcdb7fb Fix GH-16357: openssl may modify member types of certificate arrays
We must not use `try_convert_to_string()` on members of unseparated
array arguments; instead of separating, we use `zval_try_get_string()`.

Closes GH-16370.
2024-10-12 16:05:31 +02:00
Arnaud Le Blanc
070779c874 Fix test race condition
Closes GH-14790
2024-07-03 19:17:13 +02:00
Jakub Zelenka
46013f1c55 Skip test for OpenSSL bug #74341 which is not a bug 2024-06-09 12:40:24 +01:00
Ilija Tovilo
fa7933ef17 [skip ci] Fix typo 2024-05-13 13:08:28 +02:00
Ilija Tovilo
91c53e43c4 [skip ci] Adjust port for gh13860.phpt
Port 64325 is already used in ext/standard/tests/streams/gh11418.phpt. The test
randomly times out, and it's unclear whether it might be related to the
conflicting port.
2024-05-13 12:16:57 +02:00
Jakub Zelenka
04b864e566 Fix GH-13806: openssl_x509_parse_basic test fails with OpenSSL 3.2+ (#13961)
Closes GH-13961
2024-04-19 14:09:22 +01:00
Niels Dossche
a86256c950 Improve stability of test gh13860.phpt 2024-04-07 22:49:58 +02:00
Niels Dossche
2aae14c8a9 Fix GH-13860: Incorrect PHP_STREAM_OPTION_CHECK_LIVENESS case in ext/openssl/xp_ssl.c - causing use of dead socket
php_socket_errno() may return a stale value when recv returns a
value >= 0. As such, the liveness check is wrong.
This is the same bug as #70198 (fixed in GH-1456). So we fix it in the
same way.

Closes GH-13895.
2024-04-07 21:35:43 +02:00
Jakub Zelenka
11caf094f1 Fix GH-13620: Failing openssl_private_decrypt tests
Use OPENSSL_PKCS1_OAEP_PADDING padding in tests

Closes GH-13667
2024-03-29 19:33:37 +00:00
Jakub Zelenka
100258ffd6 Fix test for GH-10495: feof on OpenSSL stream hangs 2024-03-29 16:32:23 +00:00
Jakub Zelenka
c1bd9a932a Fix GH-10495: feof on OpenSSL stream hangs indefinitely
This fixes the issue with unbounded waiting on SSL_peek which can happen
when only part of the record is fetched. It makes socket non blocking so
it is possible to verify if OpenSSL is expecting some more data or if
there is an error.

This also fixes bug #79501

Closes GH-13487
2024-03-29 16:22:22 +00:00
Ilija Tovilo
bc6a1c933f [skip ci] Mark another openssl test as xfail 2024-03-10 15:15:12 +01:00
Ilija Tovilo
932982f867 [skip ci] Mark problematic openssl tests as xfail for now 2024-03-08 19:09:14 +01:00
Peter Kokot
218a93b898 Use EXTENSIONS instead of SKIPIF sections in *.phpt
This also fixes skipped tests due to different naming "zend-test"
instead of "zend_test" and "PDO" instead of "pdo":

- ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/zend_test/tests/observer_sqlite_create_function.phpt

EXTENSIONS section is used for the Windows build to load the non-static
extensions.

Closes GH-13276
2024-01-31 11:18:21 +01:00
Jakub Zelenka
f90b40416f Fix #50713: openssl_pkcs7_verify() may ignore untrusted CAs
Closes GH-12499
2023-11-17 19:42:28 +00:00
Jakub Zelenka
b2f6b6ea9c Merge branch 'PHP-8.1' into PHP-8.2 2023-10-22 13:21:56 +01:00
Jakub Zelenka
83a242ec0c Fix GH-12489: Missing sigbio creation checking in openssl_cms_verify
Closes GH-12490
2023-10-22 13:20:43 +01:00
Jakub Zelenka
58141f062b Merge branch 'PHP-8.1' into PHP-8.2 2023-06-09 16:38:14 +01:00
James Lucas
fd09728bb6 Fix bug GH-9356: Incomplete SAN validation of IPv6 address
IPv6 addresses are valid entries in subjectAltNames. Certificate
Authorities may issue certificates including IPv6 addresses except
if they fall within addresses in the RFC 4193 range. Google and
CloudFlare provide IPv6 addresses in their DNS over HTTPS services.

Internal CAs do not have those restrictions and can issue Unique
local addresses in certificates.

Closes GH-11145
2023-06-09 16:33:46 +01:00
George Peter Banyard
81732056fe Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix duplicated FILE section in test bug80747.phpt
2023-01-23 13:51:13 +00:00
Niels Dossche
974dba3b80 Fix duplicated FILE section in test bug80747.phpt
Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-23 13:50:49 +00:00
Jakub Zelenka
c8d8bf7c59 Merge branch 'PHP-8.1' into PHP-8.2 2022-11-25 14:07:41 +00:00
Jakub Zelenka
500b28ad04 Fix GH-10000: Test failures when OpenSSL compiled with no-dsa 2022-11-25 14:02:03 +00:00
Jakub Zelenka
c022ce92fb Merge branch 'PHP-8.1' into PHP-8.2 2022-11-25 12:50:38 +00:00
Jakub Zelenka
ce57221376 Fix GH-9064: PHP fails to build if openssl was built with no-ec 2022-11-25 12:49:12 +00:00
George Peter Banyard
a27ae67c0f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Add missing EXTENSION section to tests
2022-10-27 14:42:17 +01:00
George Peter Banyard
a4acba9e52 Add missing EXTENSION section to tests 2022-10-27 14:39:43 +01:00
Jakub Zelenka
35e2a25d83 Add openssl_cipher_key_length function
This function works in exactly the same way as openssl_cipher_iv_length
but for a key length. This is especially useful to make sure that the
right key length is provided to openssl_encrypt and openssl_decrypt.

In addtion the change also updates implementation of
openssl_cipher_iv_length and adds a test for it.
2022-08-28 12:27:16 +01:00
Jakub Zelenka
1407968891 Implement FR #76935: OpenSSL chacha20-poly1305 AEAD support
This adds support for ChaCha20-Poly1305 AEAD algorithm so it is possible
to use it in the same way as AES GCM and other AEAD algorithms. This is
available in OpenSSL 1.1.0+.
2022-08-28 12:15:58 +01:00
Jakub Zelenka
505e8d2a04 Fix GH-9310: SSL local_cert and local_pk do not respect open_basedir restriction 2022-08-28 12:11:14 +01:00
Jakub Zelenka
cb5d5d885c Merge branch 'PHP-8.1' 2022-08-17 19:50:58 +01:00
Jakub Zelenka
93bed982e8 Merge branch 'PHP-8.0' into PHP-8.1 2022-08-17 19:50:16 +01:00
Jakub Zelenka
84dcf578b1 Fix GH-9339: OpenSSL oid_file path check warning contains uninitialized path 2022-08-17 19:49:36 +01:00
Jakub Zelenka
13e46a0cb1 Merge branch 'PHP-8.1' 2022-06-09 23:03:37 +01:00
Jakub Zelenka
56382493eb Merge branch 'PHP-8.0' into PHP-8.1 2022-06-09 23:02:50 +01:00
Jakub Zelenka
2f78c1f9d9 Fix and improve OpenSSL VCWD path checking test for bug #50293 2022-06-09 23:01:52 +01:00
Jakub Zelenka
03b9dbc9ce Merge branch 'PHP-8.1' 2022-06-09 20:10:28 +01:00
Jakub Zelenka
95f6984216 Merge branch 'PHP-8.0' into PHP-8.1 2022-06-09 20:09:57 +01:00
Jakub Zelenka
cb9a48a0c5 Pass signature to openssl_verify in bug81713 test 2022-06-09 20:09:08 +01:00
Jakub Zelenka
a6387fa383 Merge branch 'PHP-8.1' 2022-06-09 19:57:08 +01:00
Jakub Zelenka
976cbba76e Merge branch 'PHP-8.0' into PHP-8.1 2022-06-09 19:55:46 +01:00
Jakub Zelenka
b765d4cd41 Fix bug #50293 and #81713: file path checking in OpenSSL functions
It introduces a single function to check file paths passed to OpenSSL
functions. It expands the path, check null bytes and finally does
an open basedir check.
2022-06-09 19:49:59 +01:00
Remi Collet
3670fa3b32 Merge branch 'PHP-8.1'
* PHP-8.1:
  use sha256 in openssl test suite
2022-06-01 11:46:59 +02:00
Remi Collet
03a4ccd912 use sha256 in openssl test suite 2022-06-01 11:46:47 +02:00
Jakub Zelenka
834e32e59b Merge branch 'PHP-8.1' 2022-05-15 16:52:59 +01:00
Jakub Zelenka
74f75db0c3 Fix bug #79589: ssl3_read_n:unexpected eof while reading
The unexpected EOF failure was introduced in OpenSSL 3.0 to prevent
truncation attack. However there are many non complaint servers and
it is causing break for many users including potential majority
of those where the truncation attack is not applicable. For that reason
we try to keep behavior consitent with older OpenSSL versions which is
also the path chosen by some other languages and web servers.

Closes GH-8369
2022-05-15 16:52:12 +01:00
Christoph M. Becker
973c4d406b Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix openssl_x509_checkpurpose_basic.phpt
2021-12-12 14:28:49 +01:00
Christoph M. Becker
f19250a3a1 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix openssl_x509_checkpurpose_basic.phpt
2021-12-12 14:28:16 +01:00
Christoph M. Becker
2c2b0abd4a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix openssl_x509_checkpurpose_basic.phpt
2021-12-12 14:27:07 +01:00