Improve OpenSSL 4.0 compatibility, part 1#1005
Conversation
|
It seems there have been other changes in OpenSSL master between 2026-02-03 and today. I will check these later. |
9bc8c24 to
d37837e
Compare
d37837e to
727c4a7
Compare
|
I will not rush merging this until 4.0 alpha is out, as I expect there will be additional breakages, and I want to avoid cluttering the git history with incremental fixes. |
OpenSSL's master branch is changing functions to return const pointers where the returned objects are not meant to be modified by the caller. Update ossl_*_new() to take const pointers accordingly. Unfortunately, *_dup() in older versions of OpenSSL and in LibreSSL/AWS-LC take non-const pointers, so const casts are required.
ossl_ec_new() was removed in commit 94aeab2 (pkey: simplify ossl_pkey_new(), 2017-03-16), but it forgot to remove the declaration while doing so.
ASN1_STRING has been made opaque in OpenSSL's master branch. Use the new accessor functions instead of accessing fields directly. Other uses of ASN1_STRING fields were already updated in <ruby#978>. This patch converts the remaining ones, which require the new functions added in OpenSSL 4.0 and were not available at that time.
OpenSSL master added support for RFC 7919 groups in TLS 1.2. They are preferred over SSLContext#tmp_dh= or #tmp_dh_callback= values if the client advertises them in the supported_groups extension.
67f20c0 to
47676b9
Compare
|
4.0.0-alpha1 was tagged this week. Test failures with OpenSSL::PKCS12 seem to be an issue in OpenSSL. |
|
Thank you for working on this issue. When trying to compile the current latest Ruby master branch commit ruby/ruby@77b5ab1 with the current latest OpenSSL 4.1 dev master commit openssl/openssl@e1eb881, I hit an compile error related to this ticket. Maybe thie PR's patches fix it. |
|
I see the test failure on CI openssl maser branch case below. It is the same with the above failure. https://github.com/ruby/openssl/actions/runs/23138225126/job/67207433887#step:8:52 |
OpenSSL's master branch is going to be OpenSSL 4.0. These functions return const pointers: