-
Notifications
You must be signed in to change notification settings - Fork 754
feat(build): Add option to enforce correct libcrypto feature probing #5579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
c621063 to
069efec
Compare
dougch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Played with this a bit, looks good minus the nix helper function.
| -DCMAKE_PREFIX_PATH=$LIBCRYPTO_ROOT \ | ||
| -DBUILD_SHARED_LIBS=on | ||
| -DBUILD_SHARED_LIBS=on \ | ||
| -DS2N_ENFORCE_PROPER_LIBCRYPTO_FEATURE_PROBE=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding this flag to https://github.com/aws/s2n-tls/blob/main/nix/shell.sh#L54 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I added this flag to a CI job was mostly just to make sure it works when you enable it (and the demonstrated failure for ubuntu25 wasn't because enabling the flag just always causes the build to fail, for example). Ideally we should just enable the flag by default when/if it's safe to do so and then all of our CI would get it. But it doesn't hurt to add it early to nix as well.
|
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
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.