Repository navigation
openssl: fix OpenSSL v4.1 no-deprecated build - #23215
Closed
MarcelRaad wants to merge 1 commit into
Closed
MarcelRaad wants to merge 1 commit into
MarcelRaad wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The compatibility shim converts negative lengths to SIZE_MAX, risking out-of-bounds reads.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Updates OpenSSL ASN.1 length handling for OpenSSL 4.1 compatibility.
Changes:
- Adds a pre-4.1 compatibility shim.
- Migrates certificate parsing to
size_tlengths.
| File | Description |
|---|---|
lib/vtls/openssl.c |
Updates ASN.1 length access and related types. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
`ASN1_STRING_length` has been replaced by `ASN1_STRING_get_length` in the OpenSSL v4.1 API, which now returns `size_t` instead of `int`. Closes curl#23215
MarcelRaad
force-pushed
the
openssl_v4.1
branch
from
October 1, 2026 12:49
5bceca5 to
92f0ab4
Compare
jay
approved these changes
Oct 1, 2026
Member
|
Thanks |
GauChoob
added a commit
to elmadev/elma-classic
that referenced
this pull request
Oct 18, 2026
The macos-26 runner has been updated from openssl 3.6.4 to 4.0.3 This new version of openssl is only supported as of curl-8.20.0 curl/curl#21119 For future reference, openssl 4.1 is supported by curl-8.23.0 curl/curl#23215 The latest libcurl port to meson is curl-8.12.1 Disable openssl for macos-26, falling back to use secure transport
GauChoob
added a commit
to elmadev/elma-classic
that referenced
this pull request
Oct 18, 2026
The macos-26 runner has been updated from openssl 3.6.4 to 4.0.3 Openssl 4.0 is only supported as of curl-8.20.0 curl/curl#21119 Openssl 4.1 is only supported as of curl-8.23.0 curl/curl#23215
jgouly
pushed a commit
to elmadev/elma-classic
that referenced
this pull request
Oct 18, 2026
The macos-26 runner has been updated from OpenSSL 3.6.4 to 4.0.3. OpenSSL 4.0 is only supported as of curl-8.20.0 curl/curl#21119 OpenSSL 4.1 is only supported as of curl-8.23.0 curl/curl#23215
jgouly
pushed a commit
to elmadev/elma-classic
that referenced
this pull request
Oct 18, 2026
The macos-26 runner has been updated from OpenSSL 3.6.4 to 4.0.3. OpenSSL 4.0 is only supported as of curl-8.20.0 curl/curl#21119 OpenSSL 4.1 is only supported as of curl-8.23.0 curl/curl#23215
2 tasks done
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Oct 20, 2026
vszakats
added a commit
that referenced
this pull request
Oct 20, 2026
To avoid name clash when building against OpenSSL forks implementing
this API.
Fixing, when building against BoringSSL 0.20261020.0:
```
lib/vtls/openssl.c:173:15: error: static declaration of 'ASN1_STRING_get_length' follows non-static declaration
173 | static size_t ASN1_STRING_get_length(const ASN1_STRING *str)
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/runner/pkg/boringssl/include/openssl/x509.h:23,
from /home/runner/pkg/boringssl/include/openssl/pem.h:25,
from /home/runner/pkg/boringssl/include/openssl/ssl.h:24,
from /home/runner/work/curl/curl/lib/vtls/openssl.h:69,
from /home/runner/work/curl/curl/lib/vtls/openssl.c:37:
/home/runner/pkg/boringssl/include/openssl/asn1.h:525:23: note: previous declaration of 'ASN1_STRING_get_length'
with type 'size_t(const ASN1_STRING *)' {aka 'long unsigned int(const struct asn1_string_st *)'}
525 | OPENSSL_EXPORT size_t ASN1_STRING_get_length(const ASN1_STRING *str);
| ^~~~~~~~~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/39485527308/job/118844815062?pr=23519#step:38:42
Ref: #23519
Follow-up to 978cce1 #23215
Closes #23520
erikolofsson
pushed a commit
to Malterlib/curl
that referenced
this pull request
Nov 17, 2026
To avoid name clash when building against OpenSSL forks implementing
this API.
Fixing, when building against BoringSSL 0.20261020.0:
```
lib/vtls/openssl.c:173:15: error: static declaration of 'ASN1_STRING_get_length' follows non-static declaration
173 | static size_t ASN1_STRING_get_length(const ASN1_STRING *str)
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/runner/pkg/boringssl/include/openssl/x509.h:23,
from /home/runner/pkg/boringssl/include/openssl/pem.h:25,
from /home/runner/pkg/boringssl/include/openssl/ssl.h:24,
from /home/runner/work/curl/curl/lib/vtls/openssl.h:69,
from /home/runner/work/curl/curl/lib/vtls/openssl.c:37:
/home/runner/pkg/boringssl/include/openssl/asn1.h:525:23: note: previous declaration of 'ASN1_STRING_get_length'
with type 'size_t(const ASN1_STRING *)' {aka 'long unsigned int(const struct asn1_string_st *)'}
525 | OPENSSL_EXPORT size_t ASN1_STRING_get_length(const ASN1_STRING *str);
| ^~~~~~~~~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/39485527308/job/118844815062?pr=23519#step:38:42
Ref: curl#23519
Follow-up to 978cce1 curl#23215
Closes curl#23520
(cherry picked from commit dfab21a)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

ASN1_STRING_lengthhas been replaced byASN1_STRING_get_lengthin the OpenSSL v4.1 API, which now returnssize_tinstead ofint.