quic: update the guard to check openssl version · nodejs/node@99c80e3 · GitHub
Skip to content

Commit 99c80e3

Browse files
committed
quic: update the guard to check openssl version
Since we need to be able to use the openssl adapter provided by the ngtcp2 library, and because that adapter does not include any compile guards to ensure that OpenSSL 3.5 is being used and that the APIs are actually available, we need to add a compile time check for the openssl version in order to conditionally include the adapter to avoid build errors when using a shared openssl library that is not OpenSSL 3.5. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #59249 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent ebfc28a commit 99c80e3

3 files changed

Lines changed: 92 additions & 10 deletions

File tree

configure.py

Lines changed: 61 additions & 0 deletions

deps/ngtcp2/ngtcp2.gyp

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,36 @@
129129
'HAVE_NETINET_IN_H',
130130
],
131131
}],
132+
# TODO: Support OpenSSL 3.5 shared library builds.
133+
# The complexity here is that we need to use the ngtcp2 ossl
134+
# adapter, which does not include any conditional checks to
135+
# see if the version of OpenSSL used has the necessary QUIC
136+
# APIs, so we need to ensure that we conditionally enable use
137+
# of the adapter only when we know that the OpenSSL version we
138+
# are compiling against has the necessary APIs. We can do that
139+
# by checkig the OpenSSL version number but, currently, the
140+
# code that does so checks only the VERSION.dat file that is
141+
# bundled with the openssl dependency. We'll need to update
142+
# that to support the shared library case, where the version
143+
# of the shared library needs to be determined.
144+
#
145+
# TODO: Support Boringssl here also. ngtcp2 provides an adapter
146+
# for Boringssl. If we can detect that boringssl is being used
147+
# here then we can use that adapter and also set the
148+
# QUIC_NGTCP2_USE_BORINGSSL define (the guard in quic/guard.h
149+
# would need to be updated to check for this define).
150+
['node_shared_openssl=="false" and openssl_version >= 0x3050001f', {
151+
'sources': [
152+
'<@(ngtcp2_sources_ossl)',
153+
],
154+
'direct_dependent_settings': {
155+
'defines': [
156+
# Tells us that we are using the OpenSSL 3.5 adapter
157+
# that is provided by ngtcp2.
158+
'QUIC_NGTCP2_USE_OPENSSL_3_5',
159+
],
160+
},
161+
}]
132162
],
133163
'direct_dependent_settings': {
134164
'defines': [
@@ -143,7 +173,6 @@
143173
},
144174
'sources': [
145175
'<@(ngtcp2_sources)',
146-
'<@(ngtcp2_sources_ossl)',
147176
]
148177
},
149178
{

src/quic/guard.h

Lines changed: 1 addition & 9 deletions

0 commit comments

Comments
 (0)