1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

848 Commits

Author SHA1 Message Date
ndossche
e9b3ea82b5 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21083: Skip private_key_bits validation for EC/curve-based keys
2026-03-12 22:02:01 +01:00
ndossche
757dadcf1f Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21083: Skip private_key_bits validation for EC/curve-based keys
2026-03-12 22:01:21 +01:00
Ilia Alshanetsky
7950482562 Fix GH-21083: Skip private_key_bits validation for EC/curve-based keys
openssl_pkey_new() checks private_key_bits >= 384 before generating any
key. For EC, X25519, ED25519, X448, and ED448 the size is inherent to
the curve or algorithm, so this check doesn't apply and causes failures
when default_bits is missing from openssl.cnf (which is the case in
OpenSSL 3.6's default config).

Skip the minimum-bits check for key types that don't use private_key_bits.

Closes GH-21387.
2026-03-12 21:53:22 +01:00
Steve Wall
c1d2875a82 Implement GH-20310: No critical extension indication in openssl_x509_parse() output
This add criticalExtensions field to openssl_x509_parse() output that
provides name of all critical extensions.

Closes #20310
Closes #20311
2026-01-14 22:59:10 +01:00
David Carlier
b6a3852b31 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20802: undefined behavior with invalid SNI_server_certs options.
2026-01-01 21:09:01 +00:00
David Carlier
cdcc0c2cd8 Fix GH-20802: undefined behavior with invalid SNI_server_certs options.
close GH-20803
2026-01-01 21:08:35 +00:00
Shivam Mathur
94f2bb0dd5 [skip ci] Fix Windows test for openssl-3.5 upgrade (#19384)
* Fix Windows test for openssl-3.5 upgrade

* Update ext/openssl/tests/check_default_conf_path.phpt

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2025-10-21 03:24:13 +02:00
Ilija Tovilo
b8ba8593b1 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [skip ci] Also skip check_default_conf_path.phpt on Windows & 8.2
  Revert "Fix Windows test for openssl-3.5 upgrade (#19384)"
2025-10-21 01:25:30 +02:00
Ilija Tovilo
ed8a45c8e9 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Also skip check_default_conf_path.phpt on Windows & 8.2
  Revert "Fix Windows test for openssl-3.5 upgrade (#19384)"
2025-10-21 01:25:24 +02:00
Ilija Tovilo
b751582705 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Also skip check_default_conf_path.phpt on Windows & 8.2
  Revert "Fix Windows test for openssl-3.5 upgrade (#19384)"
2025-10-21 01:25:06 +02:00
Ilija Tovilo
f65a574a36 [skip ci] Also skip check_default_conf_path.phpt on Windows & 8.2
I don't know why the output is different only in 8.2. Revert for now to make CI
happy.
2025-10-21 01:23:58 +02:00
Ilija Tovilo
3f6c86a885 Revert "Fix Windows test for openssl-3.5 upgrade (#19384)"
This reverts commit 0e17dcfe54.
2025-10-21 01:23:29 +02:00
Ilija Tovilo
1bfe9340b7 [skip ci] Skip openssl tests currently failing on 8.2 2025-10-21 00:55:08 +02:00
Ilija Tovilo
43621e1e3c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix Windows test for openssl-3.5 upgrade (#19384)
2025-10-21 00:40:27 +02:00
Ilija Tovilo
5d8a3925d2 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix Windows test for openssl-3.5 upgrade (#19384)
2025-10-21 00:40:21 +02:00
Shivam Mathur
0e17dcfe54 Fix Windows test for openssl-3.5 upgrade (#19384)
* Fix Windows test for openssl-3.5 upgrade

* Update ext/openssl/tests/check_default_conf_path.phpt

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

---------

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2025-10-21 00:40:14 +02:00
Jakub Zelenka
2e4dca57dc Fix GH-19994: openssl_get_cipher_methods inconsistent with fetched methods (#20167)
This is fixed by libctx work so this just adds test to confirm it.

The actual fix is 2f5ef4d2b7 .
2025-10-14 19:20:25 +02:00
Gina Peter Banyard
b4ed215299 core: Warn when non-representable floats are coerced to int (#19760)
RFC: https://wiki.php.net/rfc/warnings-php-8-5#casting_out_of_range_floats_to_int
2025-09-21 23:53:16 +01:00
Jakub Zelenka
ba97d8636a Merge branch 'PHP-8.4' 2025-08-12 17:30:07 +02:00
Jakub Zelenka
c8a4207400 Merge branch 'PHP-8.3' into PHP-8.4 2025-08-12 17:29:18 +02:00
Jakub Zelenka
2b415e416e Fix GH-19245: Success error message on TLS stream accept failure
This overwrites the previous message from the successful accept call.

Closes GH-19246
2025-08-12 17:28:33 +02:00
Jakub Zelenka
20c8c12d9e Fix #81724: openssl_cms_encrypt only allows specific ciphers
The allows cipher_algo to be specified as a string. It means the not
only predefined ID ciphers are available which means that also auth
enveloped data can be created using AES GCM.

Closes GH-19459
2025-08-12 15:52:09 +02:00
Jakub Zelenka
702d18de99 Implement #80495: Enable to set padding in openssl_(sign|verify)
This adds support for RSA PSS padding.

Closes GH-19432
2025-08-11 13:11:10 +02:00
Gina Peter Banyard
284e622506 ext/openssl: Deprecate $key_length parameter of openssl_pkey_derive() (#19421)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_key_length_parameter_of_openssl_pkey_derive
2025-08-09 22:55:53 +01:00
Jakub Zelenka
731d36ac61 Fix OpenSSL fetching of alias ciphers
This does not seem like an issue as the aliases seem to be already
fetched most of the time. But there might be cases when it could be
failing like it was failing for MD in GH-19369.

It should be noted that the test does not fail without this change but
it seems useful anyway so it is added as part of this change. I
actually have not found the case where alias is not fetched for cipher
but there might be some.

Closes GH-19437
2025-08-09 23:03:26 +02:00
Jakub Zelenka
066a977840 Clean up test for GH-19369 - openssl_sign issue 2025-08-09 23:02:46 +02:00
Jakub Zelenka
c8d7318daf Fix GH-19369: openssl_sign() - support for alias digest algs broken
Closes GH-19436
2025-08-09 22:06:59 +02:00
Jakub Zelenka
75931a2ce3 Merge branch 'PHP-8.4' 2025-08-09 18:02:10 +02:00
Jakub Zelenka
f52a59ff4f Merge branch 'PHP-8.3' into PHP-8.4 2025-08-09 17:44:25 +02:00
Jakub Zelenka
9e2aa658a8 Fix GH-19428: openssl_pkey_derive segfaults for DH derive with low key_length
This happens only for OpenSSL 1.1.1 because key_length is ignored for
DH. It means that the provided string is overwritten with longer buffer.
2025-08-09 17:43:04 +02:00
Shivam Mathur
4a934005b4 Fix Windows test for openssl-3.5 upgrade (#19384)
* Fix Windows test for openssl-3.5 upgrade

* Update ext/openssl/tests/check_default_conf_path.phpt

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

---------

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2025-08-06 16:11:38 +05:30
Jakub Zelenka
ce6e7a2786 Integrate OpenSSL libctx to pwhash (#19236)
This allows using OpenSSL Argon2 password hashing on ZTS.

Closes GH-19236
2025-07-29 15:06:34 +02:00
Jakub Zelenka
b1fce8a98c Add digest algo param to public encrypt and private decrypt
Specifically, it is added to openssl_public_encrypt() and
openssl_private_decrypt() functions. The purpose is to specify digest
algorithm for OEAP padding. It currently defaults to SHA1 for some
OpenSSL versions which is not preferred for modern setup and causes
problems in compatibility with web crypto.

Closes GH-19223
2025-07-25 12:56:47 +02:00
Jakub Zelenka
0d19984cda Merge branch 'PHP-8.3' into PHP-8.4 2025-07-15 11:24:34 +02:00
Jakub Zelenka
6b2b60f683 Fix bug #80770: openssl cafile not used in SNI SSL_CTX
The issue is about not being able to connect as cafile for SNI
is not used in its SSL context. This sets it up so it is possible
to capture the client certificate which is only possible when
verify_peer is true.

Closes GH-18893
2025-07-15 11:23:10 +02:00
Jakub Zelenka
7a15d2a5c0 Merge branch 'PHP-8.3' into PHP-8.4 2025-06-05 18:05:24 +02:00
Jakub Zelenka
444cc78a3e Skip OpenSSL proxy test for bug #74796 on Windows 2025-06-05 16:18:06 +02:00
Jakub Zelenka
086a470208 Merge branch 'PHP-8.3' into PHP-8.4 2025-06-05 14:10:57 +02:00
Jakub Zelenka
42f6c15186 Fix bug #74796: Requests through http proxy set peer name
This issue happens because http wrapper sets peer_name but then does not
remove so it stays in the context. The fix removes the peer name from
the context after enabling crypto.

In addition to bug #74796, this also fixes bug #76196.

In addition it should be a final fix for those SOAP bugs:

bug #69783
bug #52913
bug #61463
2025-06-05 14:08:28 +02:00
Niels Dossche
87ff5479fc Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix memory leak of X509_STORE in php_openssl_setup_verify() on failure
2025-06-03 23:46:21 +02:00
Niels Dossche
08a9579883 Fix memory leak of X509_STORE in php_openssl_setup_verify() on failure
Closes GH-18750.
2025-06-03 23:45:51 +02:00
Niels Dossche
d689ff63e8 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix memory leak in openssl_sign() when passing invalid algorithm
2025-04-02 20:18:57 +02:00
Niels Dossche
74720a22f3 Fix memory leak in openssl_sign() when passing invalid algorithm
Closes GH-18185.
2025-04-02 20:15:53 +02:00
Jakub Zelenka
4936c32772 Merge branch 'PHP-8.3' into PHP-8.4 2025-02-28 14:51:52 +01:00
Jakub Zelenka
6bb56fe0cf Change openssl_x509_verify test to use cert generator (#17882)
This also prevents verifying cert with SHA1 signature
2025-02-28 14:51:12 +01:00
Jakub Zelenka
d2977b026f Merge branch 'PHP-8.3' into PHP-8.4 2024-12-31 15:20:06 +01:00
Jakub Zelenka
e0dabe326f Merge branch 'PHP-8.2' into PHP-8.3 2024-12-31 15:05:18 +01:00
Jakub Zelenka
37504f123d Port OpenSSL gh10495, gh13860 and gh9310 test to use ephemeral ports 2024-12-31 15:02:08 +01:00
Jakub Zelenka
44a9154e75 Merge branch 'PHP-8.1' into PHP-8.2 2024-12-31 14:39:59 +01:00
Jakub Zelenka
b8731767d8 Fix GH-16955: Use empheral ports for OpenSSL server client tests
And refactor some client server tests.

Closes GH-17180
2024-12-31 14:25:19 +01:00