feat: add strict and interop CNSA 2.0 policies#5760
Merged
CarolYeh910 merged 13 commits intoaws:mainfrom Mar 19, 2026
Merged
Conversation
maddeleine
reviewed
Mar 3, 2026
maddeleine
reviewed
Mar 5, 2026
alexw91
reviewed
Mar 10, 2026
alexw91
reviewed
Mar 10, 2026
alexw91
reviewed
Mar 10, 2026
alexw91
reviewed
Mar 12, 2026
alexw91
approved these changes
Mar 12, 2026
Contributor
alexw91
left a comment
There was a problem hiding this comment.
Only comment left is to add a code comment to link to https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.202.pdf
maddeleine
reviewed
Mar 13, 2026
maddeleine
reviewed
Mar 13, 2026
maddeleine
reviewed
Mar 19, 2026
maddeleine
approved these changes
Mar 19, 2026
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.
Goal
Create the strict CNSA 2.0 TLS policy and a transitional policy from CNSA 1.0 to 2.0
Why
Define the CNSA 2.0 policy to satisfy upcoming customer use cases for ML-KEM and ML-DSA algorithms. This PR also includes an interop policy that combines CNSA 1.0 (RFC 9151) and CNSA 2.0, allowing customers to smoothly migrate from CNSA 1.0 (non-PQ) to 2.0 (PQ only).
How
cnsa_2policy based on the CNSA 2.0 specification. Specifically, this policy restricts the available options in TLS configurations to ensure a high security standard. The major requirements in the CNSA 2.0 Suite are as follows:cnsa_1_2_interoppolicy that combines all the supported algorithms incnsa_2andrfc9151. Notably, therfc9151policy enforces the cert key preferences, thus I added a new certificate key type formldsa_87gated by the ML-DSA feature flag. I also created a 'cnsa_1policy alias torfc9151` for standardization.s2n_pq_mlkem_policies_test.cto verify the correctness and compatibility of thecnsa_2andcnsa_1_2_interoppolicies, along with small changes in existing tests to expand coverage.Callouts
I was considering adding a check for ML-DSA support when users try to configure the
cnsa_2policy, but found out that s2n-tls could not load an ML-DSA cert if the libcrypto didn't support ML-DSA (sees2n_mldsa_test.c). This may serve as an alternative validation.The current s2n FIPS rule does not consider ML-DSA (using
S2N_HASH_SHAKE256_64for hash) as FIPS-aligned. I updated thefips_hash_algslist and added ML-DSA to thetest_all_fipspolicy.Testing
Regarding the test certificates, I used the RFC test cert
/mldsa/ML-DSA-87.crtforcnsa_2(with the host name "LAMPS WG") and a localhost cert/permutations/ec_ecdsa_p384_sha384forcnsa_1_2_interop.Each policy has 5 test cases in
s2n_pq_mlkem_policies_test.c. Forcnsa_2, there are 2 success tests (with 1 HRR) and 3 failure tests (missing either ML-KEM-1024 or ML-DSA-87). Forcnsa_1_2_interop, all 5 tests are successful with 2 non-standard policies that trigger HRR.I also updated the pure ML-KEM interop tests in the rust bindings to use the
cnsa_2policy and verified ML-KEM-1024 and ML-DSA-87 were negotiated.TlsConfigBuilderPairloads an RSA2048 cert chain by default, which is not compatible withcnsa_2. I added an initialization methoddefault_without_certs()as a workaround.In
s2n_security_policies_test.c, there was a check that enforces every TLS 1.3 policy to include an RSA_PSS signature algorithm. This check is only necessary when a policy supports RSA signatures in TLS 1.2 to ensure version compatibility.Related
resolves #5152
release summary: Add the strict CNSA 2.0 TLS policy and a transitional policy from CNSA 1.0 to 2.0
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.