feat(build): Add option to enforce correct libcrypto feature probing #5579
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.
Release Summary:
-DS2N_ENFORCE_PROPER_LIBCRYPTO_FEATURE_PROBE).Resolved issues:
Related to #5078
Description of changes:
It was indicated in #5078 that there could be ways to build s2n-tls such that the libcrypto feature probes are unable to successfully link to the libcrypto, but s2n-tls itself is during the actual build. This would lead to a state where none of our feature probes are enabled, but the libcrypto does actually support some of these features. This isn't great, since our feature probes determine some rather important stuff such as TLS 1.3 support.
This PR adds a new CMake option to enforce that the feature probes were actually able to link to the libcrypto and correctly determine feature support, and fail the build otherwise.
Call-outs:
We should consider enabling this option by default after users who may not want this behavior opt out (the CRT maybe?).
Testing:
I built s2n-tls on ubuntu25 with this CMake option enabled (without #5572), and with this change the build failed at configuration time rather than build time:
Build log
The flag was also set when building the unit tests, which ensures that setting this flag doesn't cause the build to fail under normal circumstances.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.