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

Remove PQ TLS 1.2 Support #5022

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

alexw91
Copy link
Contributor

@alexw91 alexw91 commented Jan 10, 2025

Release Summary:

Removes draft support for post-quantum TLS 1.2 (draft-campagna-tls-bike-sike-hybrid) from s2n-tls. Support for post-quantum TLS 1.3 (draft-ietf-tls-hybrid-design) is kept.

Resolved issues:

None.

Description of changes:

Removes draft support for post-quantum TLS 1.2 (draft-campagna-tls-bike-sike-hybrid) from s2n-tls. Support for post-quantum TLS 1.3 (draft-ietf-tls-hybrid-design) is kept.

Call-outs:

  1. Removes PQ TLS 1.2 support and the TLS_ECDHE_KYBER_RSA_WITH_AES_256_GCM_SHA384 cipher entirely from s2n-tls.
  2. Older PQ TLS policies that should no longer be used have been deprecated.
  3. s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384 was removed from all cipher preference lists. If this removal made the cipher preference list identical to an already existing cipher preference list, then the entire cipher preference list was deleted and security policies migrated to use the other already existing cipher preference list. Otherwise, if no equivalent cipher preference list existed then s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384 was removed in-place (eg for cipher_suites_pq_tls_1_0_2021_05_24).
  4. All PQ TLS 1.2 tests have either been deleted or modified to support TLS 1.3.
  5. The function s2n_connection_get_kem_name() is kept, but now hardcoded to always return NONE in all circumstances so as to not break customers.

Testing:

Remember:

  • Any change to the library source code should at least include unit tests.
  • Any change to the core stuffer or blob methods should include CBMC proofs.
  • Any change to the CI or tests should:
    1. prove that the test succeeds for good input
    2. prove that the test fails for bad input (eg, a test for memory leaks fails when a memory leak is committed)

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

Comment on lines +154 to +155
/* Ensure that PQ enabled Policies support TLS 1.3 since TLS 1.3 is now required for PQ support. */
EXPECT_TRUE(has_tls_13_cipher);
Copy link
Contributor Author

@alexw91 alexw91 Jan 10, 2025

Choose a reason for hiding this comment

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

Moved "TLS 1.3 + PQ checks" further down in the function so that this block has access to the has_tls_13_cipher variable. This move allows adding this check that requires TLS 1.3 support for all PQ policies.

@alexw91 alexw91 requested review from lrstewart and jmayclin January 10, 2025 18:53
@alexw91 alexw91 force-pushed the remove-pq-tls12 branch 2 times, most recently from 87b1a7d to a2b0656 Compare January 15, 2025 23:13
Copy link
Contributor

@lrstewart lrstewart left a comment

Choose a reason for hiding this comment

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

The diff here is still very large, so I'm still worried. If there's any possible way to keep breaking this change down into smaller chunks, that would probably make this review move faster and make the change safer.

Comment on lines 1222 to +1225
const char *deprecated_security_policies[] = {
"KMS-PQ-TLS-1-0-2019-06",
"KMS-PQ-TLS-1-0-2020-02",
"KMS-PQ-TLS-1-0-2020-07",
Copy link
Contributor

Choose a reason for hiding this comment

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

Your changes to the policy list are very hard / impossible to visually verify. Could you maybe run a manual test to confirm that s2n_array_len(security_policy_selection) + s2n_array_len(deprecated_security_policies) is the same before and after your change? Like maybe add some logic to a test or other binary that can report that number, and then run that test with and without your change.

I'm not sure we could add a permanent, committed test without requiring that it be updated every time someone adds a new policy :/

It might be even better if you can confirm no changes to the names. Maybe the test/binary could write the names to a file instead of just reporting a number, and then you can diff the files with and without your change.

Comment on lines -717 to +605
.cipher_preferences = &cipher_preferences_pq_tls_1_0_2021_05_26,
.cipher_preferences = &cipher_preferences_20210825_gcm,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this not change the security policy? Why is this safe? (Same for the other policies)

Comment on lines -386 to +247
return query == kex->hybrid[0] || query == kex->hybrid[1];
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need the previous kex/query check if you're just going to return false anyway

Comment on lines -73 to -74
.kem_count = s2n_array_len(pq_kems_r3_2021_05),
.kems = pq_kems_r3_2021_05,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are these changes safe / why do they not change policies in active use?

Comment on lines 1611 to -1877
S2N_TLS13_CIPHER_SUITES_20190801,
&s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this change safe?

Comment on lines -593 to +557
.client_policy = &security_policy_pq_tls_1_1_2021_05_21,
.client_policy = &security_policy_pq_tls_1_0_2021_05_24,
Copy link
Contributor

@lrstewart lrstewart Jan 17, 2025

Choose a reason for hiding this comment

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

For your tests: how did you verify that you have the right replacement policy, and aren't changing the behavior of the test?

This is a more general comment then just this line: this PR is really too large for a reviewer to personally verify all your test policy substitutions. How do you know they're all correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't delete all the newlines-- it makes it harder to read.

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.

2 participants