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: Add FIPS mode getter API #4450

Merged
merged 6 commits into from
Mar 14, 2024
Merged

Conversation

goatgoose
Copy link
Contributor

@goatgoose goatgoose commented Mar 5, 2024

Description of changes:

It's currently difficult to determine whether s2n-tls is operating in FIPS mode, which is essential for FIPS compliance. The best way to do this would be to query the linked libcrypto via FIPS_mode(), and then infer that s2n-tls read this value and enabled FIPS mode in s2n_init().

However, this method of validating the FIPS mode doesn't actually check the real s2n-tls FIPS mode. Additionally, this solution isn't possible when S2N_INTERN_LIBCRYPTO is enabled, and the application doesn't have access to the linked libcrypto.

This PR adds a new API to retrieve the s2n-tls FIPS mode to make it easier for applications to validate that their environment is compliant with FIPS.

Testing:

I added a new build test to ensure that FIPS mode is enabled when we think it should be. I tested that this test is working by swapping the FIPS mode checks and ensuring that the AWS-LC/AWS-LC-FIPS codebuild jobs failed as expected.

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 Mar 5, 2024
@goatgoose goatgoose marked this pull request as ready for review March 6, 2024 18:30
api/s2n.h Outdated Show resolved Hide resolved
@goatgoose goatgoose marked this pull request as draft March 11, 2024 17:50
@goatgoose goatgoose marked this pull request as ready for review March 11, 2024 19:47
@goatgoose goatgoose requested a review from lrstewart March 11, 2024 20:25
crypto/s2n_fips.c Outdated Show resolved Hide resolved
api/s2n.h Outdated Show resolved Hide resolved
@goatgoose goatgoose force-pushed the fips-mode-getter branch 2 times, most recently from 5178581 to 1b3bcb8 Compare March 13, 2024 01:51
@goatgoose goatgoose requested a review from lrstewart March 13, 2024 18:51
@goatgoose goatgoose enabled auto-merge (squash) March 14, 2024 20:49
@goatgoose goatgoose merged commit ec12b52 into aws:main Mar 14, 2024
31 checks passed
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.

3 participants