feat: feature probe S2N_LIBCRYPTO_SUPPORTS_ENGINE#4878
Merged
Conversation
camshaft
reviewed
Nov 9, 2024
Contributor
Author
|
Questions:
|
b329d11 to
f051bbf
Compare
lrstewart
reviewed
Nov 12, 2024
toidiu
commented
Nov 13, 2024
camshaft
reviewed
Nov 14, 2024
camshaft
approved these changes
Nov 14, 2024
toidiu
commented
Nov 14, 2024
lrstewart
reviewed
Nov 15, 2024
toidiu
commented
Nov 15, 2024
toidiu
commented
Nov 18, 2024
toidiu
commented
Nov 18, 2024
lrstewart
reviewed
Nov 21, 2024
5 tasks
lrstewart
approved these changes
Dec 4, 2024
tests/unit/s2n_random_test.c
Outdated
Comment on lines
+51
to
+52
| bool s2n_libcrypto_is_fips(void); | ||
| bool s2n_libcrypto_is_openssl(); |
Contributor
There was a problem hiding this comment.
Nit: looks a bit wonky to specify void for one no-arg method but not for the other
Contributor
There was a problem hiding this comment.
we usually need void for compatibility with older compilers
Contributor
There was a problem hiding this comment.
Suggested change
| bool s2n_libcrypto_is_fips(void); | |
| bool s2n_libcrypto_is_openssl(); | |
| bool s2n_libcrypto_is_fips(void); | |
| bool s2n_libcrypto_is_openssl(void); |
Contributor
Author
There was a problem hiding this comment.
Fixed this and opened an issue for others in our codebase #4952
camshaft
reviewed
Dec 4, 2024
Co-authored-by: Cameron Bytheway <bytheway.cameron@gmail.com>
camshaft
approved these changes
Dec 4, 2024
Closed
2 tasks
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.
Description of changes:
Some platform are removing the
openssl/engine.hheader, which causes s2n-tls builds to fail (#4705, #4873).This PR splits the static
S2N_LIBCRYPTO_SUPPORTS_CUSTOM_RANDcheck into a:Additional benefits:
The split limits the scope of the conditional compilation to ENGINE related features. The feature probe is also more comprehensive and flexible than the static check (eg. check for the openssl/engine.h header).
Existing checks (
S2N_LIBCRYPTO_SUPPORTS_CUSTOM_RAND):New checks:
ENGINErelated APIs are defined: (feature probe)RAND_METHODsignature: (feature probe. due to awslc signature differences)Testing:
I added a negative test for the feature probe. The positive test is missing due to unrelated feature probe failure on AL2. There is an issue for AL2 and I verified that only AL2 was failing by testing this commit in isolation. GeneralBatch Fail vs Pass after the test was removed.
Manual testing
I build s2n-tls linked to an openssl configured and build with the
no-engineoption.Local build instructions **(Click to Expand)**
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.