Skip to content
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

feat: Option to disable RAND engine override #5108

Merged
merged 3 commits into from
Feb 19, 2025

Conversation

goatgoose
Copy link
Contributor

@goatgoose goatgoose commented Feb 11, 2025

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.

@github-actions github-actions bot added the s2n-core team label Feb 11, 2025
@goatgoose goatgoose force-pushed the disable-rand-override branch 6 times, most recently from f08612f to d5fc754 Compare February 12, 2025 19:51
@goatgoose goatgoose force-pushed the disable-rand-override branch from d5fc754 to 1d2120c Compare February 12, 2025 20:07
@goatgoose goatgoose marked this pull request as ready for review February 12, 2025 20:44
@goatgoose goatgoose requested a review from dougch as a code owner February 12, 2025 20:44
@goatgoose goatgoose requested a review from lrstewart February 12, 2025 20:44
codebuild/spec/buildspec_disable_rand_override.yml Outdated Show resolved Hide resolved
docs/BUILD.md Outdated Show resolved Hide resolved
docs/BUILD.md Outdated Show resolved Hide resolved
docs/BUILD.md Outdated Show resolved Hide resolved
@goatgoose goatgoose requested a review from lrstewart February 18, 2025 21:24
@goatgoose goatgoose added this pull request to the merge queue Feb 19, 2025
Merged via the queue into aws:main with commit c936e91 Feb 19, 2025
46 checks passed
@goatgoose goatgoose deleted the disable-rand-override branch February 19, 2025 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to disable OpenSSL RAND engine override
3 participants