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

Add new PQ TLS Policies #4327

Merged
merged 3 commits into from
Jan 18, 2024
Merged

Add new PQ TLS Policies #4327

merged 3 commits into from
Jan 18, 2024

Conversation

alexw91
Copy link
Contributor

@alexw91 alexw91 commented Dec 14, 2023

Resolved issues:

None

Description of changes:

Creates some new PQ TLS Policies that are also FIPS compliant.

Call-outs:

RSA Key Exchange is currently FIPS compliant, but was excluded from the FIPS rules due to it being removed in upcoming 2024 FIPS standards, (further discussion here).

Rather than create the secondary S2N_FIPS_140_3_LEGACY_SUPPORT that was proposed in that previous PR, I opted to instead not add the S2N_FIPS_140_3 rule to PQ-TLS-1-2-2023-12-13.

Testing:

Unit Testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@alexw91 alexw91 force-pushed the pq-tls-policies-2023-q4 branch 2 times, most recently from 3068242 to b8d6b0b Compare December 20, 2023 23:54
@alexw91 alexw91 marked this pull request as ready for review December 21, 2023 05:19
@alexw91 alexw91 requested a review from lrstewart December 21, 2023 05:19
@alexw91 alexw91 force-pushed the pq-tls-policies-2023-q4 branch 2 times, most recently from ccae06b to 0cc028f Compare December 29, 2023 00:16
Comment on lines +1905 to +1908
&s2n_rsa_with_aes_128_gcm_sha256,
&s2n_rsa_with_aes_256_gcm_sha384,
&s2n_rsa_with_aes_128_cbc_sha256,
&s2n_rsa_with_aes_256_cbc_sha256,
Copy link
Contributor Author

@alexw91 alexw91 Dec 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These RSA Key Exchange ciphers cause PQ-TLS-1-2-2023-12-13 to fail the S2N_FIPS_140_3 rule checks in s2n as they exist today, but it seems that s2n's checks might be stricter than necessary.

See this discussion about how RSA Key exchange ciphers are technically still allowed by FIPS if necessary, but no longer recommended and proposed a separate S2N_FIPS_140_3_LEGACY_SUPPORT rule.

While these guidelines do not recommend cipher suites using RSA key transport, there may be
circumstances in practice where RSA key transport is needed. For example, if an agency uses a
network appliance for regulatory or enterprise security purposes that only functions with these
cipher suites, then these cipher suites may need to be enabled.

And this NIST doc that deprecates PKCSv1.5 padding.

Effective as of the final publication of this revision of SP 800-131A, uses of PKCS 1,
version 1.5 and other RSA key-agreement or key-transport schemes that are not
compliant with SP 800-56B are deprecated.

After December 31, 2023, the use of PKCS1-v 1_5 padding scheme is disallowed.

Copy link
Contributor

@lrstewart lrstewart Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't end up including the "LEGACY_SUPPORT" version of the rule because csosto-pk was right that the FIPS docs are pretty clear that RSA kex / PKCSv1.5 is not allowed after 2023, regardless of circumstances. So I don't think the rule is stricter than necessary for RSA kex.

It's 2024 now ;)

@alexw91 alexw91 force-pushed the pq-tls-policies-2023-q4 branch from 0cc028f to eb42fb6 Compare January 2, 2024 22:35
Comment on lines +172 to +173
const struct s2n_kem_group *kem_group = kem_prefs->tls13_kem_groups[i];
const struct s2n_ecc_named_curve *curve = kem_group->curve;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any FIPS restrictions on the pq kems, or just the classical ones?

Copy link
Contributor Author

@alexw91 alexw91 Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIST published new Key Derivation standards in 2020 that allow simple concatenation of a FIPS shared secret with a non-FIPS shared secret to still be considered allowed by FIPS, which is what the draft TLS 1.3 RFC does today. So no FIPS requirements apply to the PQ KEM's, just the FIPS ECDHE curves which are already FIPS approved.


In addition to the currently approved techniques for the generation of the shared secret Z as
specified in SP 800-56A and SP 800-56B, this Recommendation permits the use of a “hybrid”
shared secret of the form Z′ = Z || T, a concatenation consisting of a “standard” shared secret Z that
was generated during the execution of a key-establishment scheme (as currently specified in [SP
800-56A] or [SP 800-56B]) followed by an auxiliary shared secret T that has been generated using
some other method. 

From Section 2: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Cr2.pdf


3.3.  Shared secret calculation

   Here we also take a simple "concatenation approach": the two shared
   secrets are concatenated together and used as the shared secret in
   the existing TLS 1.3 key schedule.  Again, we do not add any
   additional structure (length fields) in the concatenation procedure:
   for both the traditional groups and Kyber, the shared secret output
   length is fixed for a specific elliptic curve or parameter set.

   In other words, the shared secret is calculated as

       concatenated_shared_secret = shared_secret_1 || shared_secret_2
...

   *FIPS-compliance of shared secret concatenation.* [NIST-SP-800-56C]
   or [NIST-SP-800-135] give NIST recommendations for key derivation
   methods in key exchange protocols.  Some hybrid combinations may
   combine the shared secret from a NIST-approved algorithm (e.g., ECDH
   using the nistp256/secp256r1 curve) with a shared secret from a non-
   approved algorithm (e.g., post-quantum).  [NIST-SP-800-56C] lists
   simple concatenation as an approved method for generation of a hybrid
   shared secret in which one of the constituent shared secret is from
   an approved method.

From section 3.3 of the draft Hybrid TLS 1.3 RFC: https://datatracker.ietf.org/doc/html/draft-ietf-tls-hybrid-design-09#section-3.3

tls/s2n_security_policies.c Outdated Show resolved Hide resolved
@lrstewart lrstewart requested a review from jmayclin January 3, 2024 17:49
@alexw91 alexw91 force-pushed the pq-tls-policies-2023-q4 branch 4 times, most recently from f2ba14a to 38fc03e Compare January 11, 2024 18:18
@lrstewart lrstewart self-requested a review January 12, 2024 23:05
@alexw91 alexw91 force-pushed the pq-tls-policies-2023-q4 branch 2 times, most recently from d3a89ef to 7b31d72 Compare January 17, 2024 23:57
@alexw91 alexw91 force-pushed the pq-tls-policies-2023-q4 branch from 7b31d72 to d9ee2f1 Compare January 18, 2024 09:57
@lrstewart lrstewart merged commit 7f84701 into aws:main Jan 18, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants