feat: Option to disable RAND engine override #5108
Merged
+90
−0
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:
Adds an option to prevent s2n-tls from overriding the libcrypto RAND engine.
Resolved issues:
Resolves #5102.
Description of changes:
s2n-tls will currently override the libcrypto RAND engine with the custom s2n-tls random implementation, when linked to some libcryptos. This has been shown to conflict with some environments that are sharing the libcrypto with s2n-tls, see aws/aws-sdk-cpp#3287.
This PR provides a build option to prevent s2n-tls from overriding the libcrypto RAND engine to support these environments.
s2n-tls overrides the libcrypto implementation by default for increased security. However, not all use cases will require the security guarantees that the custom s2n-tls random implementation provides. I added documentation to help users determine if they are able to safely disable this feature.
Call-outs:
None
Testing:
Testing this is kind of weird. I added a new unit test that asserts that the RAND engine will not be overridden, and gated this behind an environment variable that's set when s2n-tls is known to be built with the RAND engine disabled (kind of like S2N_KTLS_TESTING_EXPECTED). And I added a codebuild job that sets this environment variable. If anyone thinks of a better way to test this let me know!
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.